Thanks Henrik,
Yes, the program is expecting to see the qualifier 254 before the 2 bytes of data that it sticks into variables. I tried what you suggested and it didn't seem to work either.
I setup a mirrored output by connecting the PC pin 2 (PC Serial Input) to PC pin 3 (PC Serial output) via a resistor so that I can see what I am sending down the line in a parsed format. When I entered #254 #1 #1 in the send window and sent it, I got a symbol that looked kind of like a lower case b and lower case p were getting it on (LOL). Not sure what that was. No LED flash so the PIC didn't get what it wanted.
At this point, I've modified the code a bit to simplify it and flash an LED when any qualified serial message is received.
Code:
INCLUDE "bs2defs.bas"relay VAR b3 'relay number storage variable
stat VAR b4 'relay status ON/OFF variable
serpin VAR porta.4 'serial input pin
trisa = 010000
trisb = 000000
High 0
pause 100
Low 0
Pause 200
High 0
Pause 300
Low 0
loop:
SERIN serpin,N2400,[254],relay,stat 'serial data in on PortA.4
High 0
pause 500
low 0
pause 200
high 0
pause 500
low 0
GOTO loop
Seems to me I'm just not sending the right thing down the pipe. Any additional help would be greatly and sincerely appreciated.
best,
Brad
Bookmarks