Mark Lazarides
Member
I've modified a Delay loop (cheers Nigel!) to incorporate checking for a received byte in the USART every couple of uSeconds. I've modified the inner most iteration to take 10 uS to complete, and have tried to adjust the outer to comply with this. As i don't have the means to practically assess whether I've been accurate with the delay, I was hoping somebody could verify it for me? It's supposed to wait for a period of 250mS, doing the Byte checking thing continuously.
Thanks in advance...
Mark[/code]
Code:
USERC
MOVLW D'250'
MOVWF COUNT1
STD3
MOVLW 0X63 ; do countA 99 times
MOVWF COUNTA
MOVLW 0X01
MOVWF COUNTB
DELAY_3
BTFSC PIR1, RCIF ; if a byte received, call RECVUSER2
CALL RECVUSER2
GOTO $+1
NOP
DECFSZ COUNTA, F
GOTO $+2
DECFSZ COUNTB, F
GOTO DELAY_3
GOTO $+1
GOTO $+1
DECFSZ COUNT1, F
GOTO STD3
Thanks in advance...
Mark[/code]