Having problems with Xbees digital pins
Ragtop
Posts: 406
My goal is to attach an (active low 3.3.v) motion sensor pin to the the Digital 0 pin of an xbee to have another xbee at my computer desk turn on and off an led.
But right now I am just trying to attach a button (3.3v active high) to one and attach the led to the same pin on the other xbee.
I have verified communication with the two xbees by looping back the signal lines. I have used x-ctu to change the button/xbee D0 pin to digital input and the led/xbee D0 to output/high.
The problem is that the led stays on no matter the state of button. I removed button and placed the D0 wire to ground and power alternately with no change in led.
Is there something else I have to set in x-ctu?
But right now I am just trying to attach a button (3.3v active high) to one and attach the led to the same pin on the other xbee.
I have verified communication with the two xbees by looping back the signal lines. I have used x-ctu to change the button/xbee D0 pin to digital input and the led/xbee D0 to output/high.
The problem is that the led stays on no matter the state of button. I removed button and placed the D0 wire to ground and power alternately with no change in led.
Is there something else I have to set in x-ctu?
Comments
It has been over a year since I last messed with this, but I believe that you have to set the Sampling Rate (IR) and the Samples Before TX (IT) on your transmitting XBee to get this to work properly. I had success with a project using settings of IR = $1F4 (500 mSec sampling rate) and IT = 2 (two samples before transmit). The default for IR is 0, and that may be your problem.
(later: )
Oh, I see Tracy beat me to this. Yes, I also set the IA on the receiver XBee to match the transmitting XBee's MY number in the project I had working properly.
LED XBEE
+++
ATIR$1F4
ATIT2
ATMY1234
ATIA5678
ATCN
Button Xbee
+++
ATMY5678
ATIA1234
ATCN
base: LED XBEE
remote: Button Xbee
That is minimal. There are a number of other parameters that could affect the result, but the default values should be okay. For example, the default is one 1 sample per transmission, so you shouldn't have to mess ATIT. The button should be set up active low, and the XBee's built in pulllup resistor will pull it high when inactive. If you have the base hooked up to your computer and a terminal program, you should be able to see the packet that is received every 100 ms.
There is a good knowledgebase and forum at Digi, here also an article specifically on digital line passing.
It was way more complicated then I thought it would be, but I just want to temporary attach the xbee to my camera control box without having to modify it's propeller code to talk to the xbee.