Digital pins on xbee 1
jdolecki
Posts: 726
Can one of the digital pins
DIO0DIO7/D08
Be used to show a lost of signal, to stop my bot untin signal strength is regained?
Or should I use one of the analog outputs?
I cant seem to find it in any documation.
thanks
DIO0DIO7/D08
Be used to show a lost of signal, to stop my bot untin signal strength is regained?
Or should I use one of the analog outputs?
I cant seem to find it in any documation.
thanks
Comments
The trick would be to use the I/O line passing feature, available on digital I/O pins 0-7. Pick a pin, and at the bot end use (say) a low level on that pin to stop the bot. At the bot end set the IA parameter to the source address of the other XBee, and set the Tn parameter (n being the I/O number) to a suitable timeout value. Set the Dn parameter for that pin to be output low.
At the controller XBee, tie the same pin to a logic high level. Set the pin's Dn parameter so that it's a digital input. Set the IT parameter to 1, and set IR to a sample interval less than the timeout you established at the bot end. Make sure the destination address is set to the address of the bot XBee - but I assume that'll be the case anyway.
Unless I've missed something out, the controller should now transmit the state of its input pin to the bot's XBee at time intervals determined by IR. The bot will therefore keep its output pin high. But if transmission is lost the input pin state will stop arriving, the timeout will trigger, and the output pin will revert to the low state as set by Dn. When transmission is regained the pin states will start arriving again and the output pin will go high.
See whether that helps
If you know of a way to use RSSI I'd be interested to hear it. It's just that in my understanding RSSI is only updated when a packet is successfully received, so it wouldn't detect an absence of transmissions due to being out of range.
@both:
There is another possibility though. If the controller is programmed to send a "keep-going" packet after a timeout which is reset after any packet is sent to the bot, then the bot's controller could be programmed to shut it down if no packet of any kind is received within (a bit more than) the timeout period. My earlier idea involved nothing more than configuration of the XBees; the software solution would require a bit more effort, but would reduce the packet overhead if that were an issue. And at times of high activity, no "keep-going" packets would be needed at all.
Then layer my RSSI idea on top of that so the bot knows when it's coming near the ouside edge of its range.
:-)
Yes, that I like!