;
; K8LH General Purpose Serial RX Subroutine
;
rx232 ; 9600 baud
btfss rxpin ; start bit (1)? yes, skip, else
goto rx232 ; loop (wait)
DelayCy(52*usecs) ; delay 1/2 bit time
movlw 8 ;
movwf count ; count = 8
rxbit DelayCy(104*usecs-7) ; precise 104-usec bit timing
clrc ; assume '0'
btfss rxpin ; a '0' bit? yes, skip, else
setc ; set to '1'
rrf rxdata,F ; b0 comes first, b7 comes last
decfsz count,F ; done? yes, skip, else
goto rxbit ; get another bit
return ;