PDA

View Full Version : recognizing a serin2 string



ehertz
- 8th September 2006, 16:49
Hello all.

I am new to pics and pic basic. I have a project where I would like to detect two different strings of data coming into a serial line. There will be a constant stream of data presented to the line, but I want to set an output port bit on when one sequence of letters/numbers is found and then reset that port bit when another sequence is found. Here are some details.

1. incoming serial parameters, 8 bits, 1 stop, 45.45 baud
2. listen to incoming data, set a bit high when "KC2NWG" is found in the stream
3. listen to incoming data, set a bit low when "NNNN" is found in the stream.
4. loop back to 2

Thats it!

In reality it will be a 5 bit byte coming in but I thought this example would be easiest to understand.

Anyone help with this? I suspect I want to use the WAITSTR for SERIN2 function, but not sure how.

thank you
Eugene

Dave
- 8th September 2006, 19:43
ehertz, Just use the "WAIT" modifier for the serin,Hserin command and place the string you are looking for. Do this for each string in the command and you have it. Its covered in the manual....

Dave Purola,
N8NTA

ehertz
- 9th September 2006, 03:24
thanks very much.