Problem with BTFSC instruction Pic16f877A in PICC

Thread Starter

anhnha

Joined Apr 19, 2012
905
Hi everyone,
I have a problem with BTFSC in PICC with pic16f877A.I used the following code but it seem that BTFSC do not work.Both bits of portc always is set.
Rich (BB code):
BTFSC 0x4F,1
bsf portc, 5
bsf portc, 6
Could you help me this?
Thanks in advance.
 

John P

Joined Oct 14, 2008
2,026
Does anything ever clear Portc 5 and 6? If you only set them and never clear them, you shouldn't be surprised if they're always set.
 

t06afre

Joined May 11, 2009
5,934
How did you test this? Did you just simulate or test it in a circuit. It is hard to tell anything from the code you posted. For all I know you can be in the wrong memory bank. Or the TRISC register may have the wrong setting. Can you post all your code?
 
Top