Page 1 of 1

problem using two switch at same time PIC16f877

Posted: 01 Oct 2015 22:38
by ravi.gupta1910
hello friends , i am using two switches in a program with pic16f877A, one switch is used as external interrupt (at RB0/INT)and other is used as a normal switch (at RC0), my program and my proteous file is attached





(if both switches are active)
when i run this simulation, and press switch at RB0, output leds i.e. PORTD.B7 and PORTD.B1 are start blinking, instead of steady light. when i pressed again the RB0 sw, next two leds are start blinking and

(if only interrupt switch active)

all led are glow steady as desired,


(but when both switches are activated )

output leds at portd starts blinking

i dont why this happen, is any wrong in my code then please help me . i am new with pic microcontrollers. please

Re: problem using two switch at same time PIC16f877

Posted: 05 Oct 2015 14:08
by biljana.nedeljkovic
Hello,

I have tested the code on EasyPIC v7 Development board only with diodes, because RB0 pin is used for LCD as well on the Easy PIC v7, and I had no problems with blinking. You should consider trying out the actual hardware (simple breadboard and diodes maybe, if not more complex board).

Unfortunately, Proteus is not verified environment for the mikroE compilers, so I haven't tested it in Proteus.

Best regards,
Biljana