I'm really confused.
I have an LDR circuit that generates ~0.1v when dark, and ~2.9v when light (this is a 3.3v circuit). These levels have been verified with an oscilloscope and there is very little noise.
The output from this circuit goes directly to RA0 on a PIC16F722.
I have the following code:
MAIN
BANKSEL PORTA
CLRF PORTA
BANKSEL ANSELA
CLRF ANSELA
BANKSEL TRISA
MOVLW b'00000001' ;RA0 Input
MOVWF TRISA
START
BTFSC PORTA,0
CALL VOL_UP
BTFSS PORTA,0
CALL VOL_DOWN
GOTO START
When I debug with my Pickit 3, can see in the watch that the input is valid, but the code doesn't call the subroutines. In fact the code doesn't seem to do anything whatever the input is!
Can anyone shed some light on this? I'm totally confused by it.