candy66
Newbie level 6
Receiving bytes
Hey guys i encountered a problem right now...i need to on/off led when i received few btyes at a time(for example, when i recieved 3 bytes, the led should turn" on off and on" agn.Can any one help?Now i only manage to turn on led when i received a byte and off the led when i received the next byte.This is my codes:
uart_ready
btfss PIR1,RCIF ;; 5
goto uart_ready ;if not ready, wait...
movf RCREG,W ;recover uart data
xorwf LATB ;light led
bsf INTCON,7 ;re-enable interrupts
Thanks
Hey guys i encountered a problem right now...i need to on/off led when i received few btyes at a time(for example, when i recieved 3 bytes, the led should turn" on off and on" agn.Can any one help?Now i only manage to turn on led when i received a byte and off the led when i received the next byte.This is my codes:
uart_ready
btfss PIR1,RCIF ;; 5
goto uart_ready ;if not ready, wait...
movf RCREG,W ;recover uart data
xorwf LATB ;light led
bsf INTCON,7 ;re-enable interrupts
Thanks