I've read on these forums, peoples opinions to use Serin, Serin2, or debugin for different applications.
Can someone give me a quick rundown on the differences between the three - which one has what advantage, purpose better suited to etc?
Also, one project im working on uses a pic to listen to data being sent via a serial port, and upon a certain character sequence of 6 characters, will either switch a relay on or off.
Upon testing with hyperterminal sending a text file to the serial port, if the text file only contains the character sequence and nothing else, it switches fine, but once the sequence characters are embedded within random text, the pic does not catch the sequence and switch the relay.
Data is @ 9600 bps, PIC16F628A @ 4 and at 20 mhz, the problem is there. Should I be using serin2 or should i be checking the data differently
Code:
loop:
DEBUGIN 10000,loop,[WAIT("-RLY_O"), TriggerChar] ' TriggerChar = input character: o'N' or o'F'f in 10 sec
If TriggerChar = "N" then PwrON
If TriggerChar = "F" then PwrOFF
Thanks
Bookmarks