One Xbee chip will be connected to an Arduino uno that will receive commmands from a computer. The other chip will be placed on a flatcar. Can I directly hook up the TX and RX ports on my Xbee to the motor driver chip?
The commands or the motor driver are fairly strait forward. A '1' or '2' indicates motor , 'f' or 'r' indicateds direction, '0' - '9' is speed, and '/r', end of command.
If I initiated my first Xbee to receive data from the computer, how would i relay this data to the second chip. I imagine I would want to use the "char getData command to read this data from my computer?
Can I directly hook up the TX and RX ports on my Xbee to the motor driver chip?
Yes.
If I initiated my first Xbee to receive data from the computer
How would you do this? The XBee is a radio. Does your PC have a transmitter that the XBee is compatible with?
Most likely, what you mean is that you are sending data to the Arduino, via the serial port. Whatever arrives on the Arduino's serial port is also transmitted by the XBee.
I imagine I would want to use the "char getData command to read this data from my computer?
What getData command?
No, you don't have to do anything. Anything that arrives on the serial port will be seen by, and transmitted by, the XBee, without you having to do anything. You don't even need an Arduino on the PC end. Use one of these, instead: SparkFun XBee Explorer USB - WRL-11812 - SparkFun Electronics
To add to this previous discussion, I have a serial motor driver board on a flatcar with the TX and RX pins of that board connected to the Din and Dout pins on the Arduino. The TX pin is going to the Din pin on the Arduino. The serial motor driver is running off of 12 volts DC.
The serial motor driver I am using is made by Sparkfun. I have provided a link below.
I am using the 5 v output port on the board to power my X bee. I included two diodes in series to knock down the voltage to 3.3 volts to power Xbee.
The Xbee version I am using is a Series 1 1MW chip.
My other Xbee is connected to an X-CTU program on my computer via an Xbee Explorer USB chip. I am trying to send commands from X-CTU to control the serial motor driver.
Because the baud rate used to control the serial motor driver is set at 115200, I made sure to change the baud rate on each Xbee to 115200. I also checked that they both had the same version of software uploaded.
Commands to Control a Motor:
'1'-Selects Motor 1
'f' or 'r'- selects forward or reverse direction
'1'-'9'-selects speed
'/r'-end of command
When I type these into the XCTU terminal window, I am not getting anything out of the motor driver.
I am obviously doing something wrong, please help.
To add to this previous discussion, I have a serial motor driver board on a flatcar with the TX and RX pins of that board connected to the Din and Dout pins on the Arduino.
The UNO doesn't have any pin labeled Din or Dout. So, try again.
Because the baud rate used to control the serial motor driver is set at 115200, I made sure to change the baud rate on each Xbee to 115200. I also checked that they both had the same version of software uploaded.
What else did you set? To what values? PAN ID? MY? DL?
I am using the 5 v output port on the board to power my X bee. I included two diodes in series to knock down the voltage to 3.3 volts to power Xbee.
You need more than one wire going to the XBee. What else is connected to it, and where?
Is the Xbee on your railcar receiving the serial input correctly? How does that input get from the Xbee to the motor driver? I guess that there is a sketch on the Arduino reading from the Xbee and writing to the motor driver, but it isn't clear.
To add to this previous discussion, I have a serial motor driver board on a flatcar with the TX and RX pins of that board connected to the Din and Dout pins on the Arduino.
The UNO doesn't have any pin labeled Din or Dout. So, try again.
Sorry, I meant to say my serial motor driver is connected to the Dout and Din Pins of my Xbee.
Because the baud rate used to control the serial motor driver is set at 115200, I made sure to change the baud rate on each Xbee to 115200. I also checked that they both had the same version of software uploaded.
What else did you set? To what values? PAN ID? MY? DL?
Xbee on Flat Car
Pan ID -3332
Channel - C
Baud Rate - 115200
Destination Address (High)- 0
Destinatin Address (Low) - 0
My Address- 0 (Only Receives Data)
Xbee on USB Chip
Pan ID-3332
Channel- C
Baud rate- 115200
Destination Address (High)-0
Destination Address (Low)-0
My Address-1
I am using the 5 v output port on the board to power my X bee. I included two diodes in series to knock down the voltage to 3.3 volts to power Xbee.
You need more than one wire going to the XBee. What else is connected to it, and where?
Have two wires connected to the Dout and Din pins.
PeterH:
Is the Xbee on your railcar receiving the serial input correctly? How does that input get from the Xbee to the motor driver? I guess that there is a sketch on the Arduino reading from the Xbee and writing to the motor driver, but it isn't clear.
As of right now, my two Xbees aren't communicating which I realized today, Whenever I try the range test in XCTU, I cannot receive any data back from the other Xbee. The Xbee Dout and DIN pins are directly connected to the RX and TX pins of the motor driver respectively. There is no Arduino connected right now. As of right now, Im trying to test this my sending data from the Terminal Screen of X-CTU.
The DL value 0 denotes the broadcast-to-all address. It is not a valid MY address.
Destination Address (Low)-0
My Address-1
So, this XBee is broadcast to all other XBees on the channel. If you want just two XBees to talk to each other, which is a requirement for the loopback test in X-CTU, MY on one XBee has to match DL on the other, and neither can be 0.
You really need to get another USB Explorer. That way, you can test the communication between the XBees. As it is now, there is nothing on the receiver end that causes the received data to be echoed back, so you have no way of knowing whether they are even talking to each other.