Hey there, I am working on some robots that will use an IR picaxe network. I plan on using 3x 08M2s, each having its own IR LED and receiver.
The robots will signal to each other that they want to send a byte message by sending a short high pulse, and then follow with the serial data.
What I need help with is figuring out how long (in seconds) a picaxe data frame is so that I can set the signal pulses length to be greater, and then check it with pulsein.
This is the serial frame as I understand it:
My chips will be talking with a N2400 baud rate, meaning that they will transmit 2400 bits per second. Thus each bit is 417 microseconds long (1/2400 = .000417 seconds.)
A single byte frame would be 10 bits long: 1 start bit, 8 data bits, and 1 stop bit.
Therefore, a one byte frame should be 4.17 milliseconds long.
So, I should set pulsein to check the IR receiver for a high pulse that is longer than 5 milliseconds. The receiver IC will then know that it is about to receive a message and will turn on its serin command.
Does this make sense? Are my numbers correct? I would certainly appreciate any and all help and suggestions.
I made this here picture to illustrate what I think the frame looks like. Is this right? Please correct me if I'm wrong (quite likely )
The robots will signal to each other that they want to send a byte message by sending a short high pulse, and then follow with the serial data.
What I need help with is figuring out how long (in seconds) a picaxe data frame is so that I can set the signal pulses length to be greater, and then check it with pulsein.
This is the serial frame as I understand it:
My chips will be talking with a N2400 baud rate, meaning that they will transmit 2400 bits per second. Thus each bit is 417 microseconds long (1/2400 = .000417 seconds.)
A single byte frame would be 10 bits long: 1 start bit, 8 data bits, and 1 stop bit.
Therefore, a one byte frame should be 4.17 milliseconds long.
So, I should set pulsein to check the IR receiver for a high pulse that is longer than 5 milliseconds. The receiver IC will then know that it is about to receive a message and will turn on its serin command.
Does this make sense? Are my numbers correct? I would certainly appreciate any and all help and suggestions.
I made this here picture to illustrate what I think the frame looks like. Is this right? Please correct me if I'm wrong (quite likely )