When debugging serial, you really need to clear the input buffer before receiving a new packet or the '#' will always be there even if there were errors.
A simple while loop to clear the input buffer at the end of a successful transmission is needed..
On Interrupt
Save System
If RCSTA.OERR = True Then 'any error reboot serial module..
RCSTA.CREN = 0
RCSTA.CREN = 1
Goto fin
Endif
serdata = RCREG '; get character(reading clears the RCIF)
If serdata > 0 Then
data(j) = serdata 'store data in buffer
j = j + 1
If j = 12 Then
j = 0
outptr = True
Endif
Endif
fin:
Resume
You want me to clear serdata or data ? cause data is getting cleared after the array buffer has been processed using
For k = 0 To 12 Step 1 'clear buffer
data(k) = 0x00
Next k
now i tried the same software on another MCU 16f690 had brand new ones around.
one 690 works and the other 690 does not.
After power up. The first time data is sent to the rx pin the MCU halts for say a good 3secs i know this cause there is a status led blinking every 0.5sec
which does not blink.
Then after that 3sec of halt the Status led starts to blink again and any data sent after this is accepted by the Chip.
Same issue was there with the working 16f628A also, the second 690 when the data is sent first time same halt but does not resume after 3 sec same as other 628a's
very confusing this is ..... please help or advice.