In Donebyte, before re-enabling the INT0 interrupt, it clears the Timer4 flag.
INT0IF will still be set and you'll get a false start when there's no data.
Code:
bcf PIR3,3 ; clear the int flag
bsf INTCON,4 ; turn on the INT0 interrupt for next byte
And I think the 1-1/2 bit time is off.
97 would be right if it were decimal, but it's hex.
Try it with 0x61.
Knowing you, this is probably part of a much bigger program with lots of variables ...
You'll probably want to put the variables used in ASM into BANK0
Code:
bit_cntr VAR BYTE BANK0
rcv_byte VAR BYTE BANK0
rcv_buffer VAR BYTE BANK0
There's really no need to stop timer4 when reloading since it's an 8-bit timer.
But adding the reload value to TMR4 instead of just loading it will cancel out any latencies.
<br>
Bookmarks