It is a while though since I last did some PIC assembly....but this one is driving me nuts the whole afternoon (o;
After reset I poll an input for a time pulse from an external device....so a combination of btfss/btfsc is the solution:
Pulse_1:
BTFSC PORTA, 4
GOTO Pulse_1
CALL Wait_0
Pulse_2:
BTFSS PORTA, 4
GOTO Pulse_2
CALL Wait_1
Pulse_3:
BTFSC PORTA, 4
GOTO Pulse_3
So this one works...but not always...sometimes hangs before "Pulse_3"...
When I try the other way around:
Pulse_1:
BTFSS PORTA, 4
GOTO Pulse_1
CALL Wait_0
Pulse_2:
BTFSC PORTA, 4
GOTO Pulse_2
CALL Wait_1
Pulse_3:
BTFSS PORTA, 4
GOTO Pulse_3
..it always hangs before "Pulse_3"....the "CALL Wait_1" and "CALL Wait_2" are just subroutines displaying LED debugging information...
Is there something special about the PIC18F4550?
Think I have configured the PORTA correctly...
MOVLW 0Fh
MOVWF ADCON1
MOVLW 7
MOVWF CMCON
MOVLW h'ff'
MOVWF TRISA