janetsmith2000@yahoo.com
New Member
I have studied your tutorial 7 on RS232. I have a little bit unclear about the timing of XMIT.
where Bit_Delay is
From my calculation, Bit_Delays takes 2 + (Bit_Wait) 95 + (Return) 2 = 99 instructions cycles.
and Thus,
Ser_Loops takes 1 +4 + 2 + 99 + 1 + 2 = 109
Instead of 109, 104 is given in your tutorial.
I wonder, if my calculation is wrong, or the error is within the tolerance range, and thus 109 is acceptable.
Thanks
Code:
Ser_Loop RRF Xmit_Byte , f ;send one bit
BTFSS STATUS , C
BCF SER_PORT, SER_OUT
BTFSC STATUS , C
BSF SER_PORT, SER_OUT
CALL Bit_Delay
DECFSZ Bit_Cntr , f ;test if all done
GOTO Ser_Loop
BSF SER_PORT, SER_OUT
CALL Bit_Delay
RETURN
where Bit_Delay is
Code:
Bit_Delay MOVLW 0x18
MOVWF Delay_Count
Bit_Wait NOP
DECFSZ Delay_Count , f
GOTO Bit_Wait
RETURN
From my calculation, Bit_Delays takes 2 + (Bit_Wait) 95 + (Return) 2 = 99 instructions cycles.
and Thus,
Code:
RRF 1
BTFSS 1
BCF 1
BTFSC 1
BSF 1
CALL Bit_Delay 2 + 99
DECFSZ 1
GOTO 2
Ser_Loops takes 1 +4 + 2 + 99 + 1 + 2 = 109
Instead of 109, 104 is given in your tutorial.
I wonder, if my calculation is wrong, or the error is within the tolerance range, and thus 109 is acceptable.
Thanks