Pulse Detection with BS2
coder1024
Posts: 9
I'm using the BS2 with the HomeWork board and interfacing with a separate circuit.· I'm using an input pin to watch a "data ready" output pin from the other circuit.· Most of the time this pin is logic high.· When a byte of data is available, the other circuit will pulse this output (drop low then high again).
What is the best way to have the BS2 wait for a pulse from the other circuit?· I thought a loop which just continues while the pin is high might work, but I'm worried about whether or not it'll miss it.
The POLL series of commands looked like it might be the way to go, but they're not provided for the BS2.
What is the best way to have the BS2 wait for a pulse from the other circuit?· I thought a loop which just continues while the pin is high might work, but I'm worried about whether or not it'll miss it.
The POLL series of commands looked like it might be the way to go, but they're not provided for the BS2.
Comments
starthere:
if in1 = 0 then goto getnewdata
goto starthere
getnewdata:
serin 2, baudrate,[noparse][[/noparse]'data description goes here']
goto starthere
The other way to do this is to use the WAIT parameter with the SERIN command. If your data string has some identifiable characters, let the stamp watch for them then grab the data following. See the Help file.
Cheers
its times like this that I wish I had a good oscilliscope