Hi S,I'm thinking this code may be more "correct":
nxt_rxin:
If PIR1.RCIF = 0 Then 'char = nothing
str1(0) = 0
rxi = 0
Goto skip1
Else
nxt_rxchk:
If PIR1.RCIF = 1 Then 'CHAR = $ or other 'No need for this line, check at end instead
You already know PIR1.RCIF =1 because the test above for =0 is false
Hserin char
If char = "?" Or char = 0x0a Then Goto msg_eol
If char = "$" Then
str1(0) = "$" 'CHAR = $
rxi = 1
If str1(0) = "$" Then
For x = 1 To rxi
Goto nxt_rxin
str1(rxi) = char
rxi = rxi + 1
if rxi > "limit" then goto someerror
'If char <> "$" Then'????????????????????
Next x
'Endif'?????????????????????
Endif
Endif
Endif
If PIR1.RCIF = 1 Then goto nxt_rxchk
Endif
"Wrong wrong" Apology not necessary, I encourage free speech, and it reminds me that it can be frustrating, for contributors.
Here is your modified CODE, plus 4x frames from the SIM which I hope help to illustrate what's happening.
Note;
RCREG and PIR1.RCIF in Special function registers.
SEND STRING BOX and RXBUFFER 1 and 2.
Even though there is a $sentence in the SEND STRING BOX, a '0' appears, which when READ by [ If PIR1.RCIF = 0 Then ] appear that there is no CHAR and goes to SKIP1
C
Attachments
-
1.6 KB Views: 2
-
710.3 KB Views: 2
-
810.9 KB Views: 2
-
721.1 KB Views: 2
-
726 KB Views: 2
Last edited: