XBee troubles: receives fine with PST and X-CTU but not with Propeller
Ken Gracey
Posts: 7,401
Hey there,
Not much in this program, but apparently enough for me. The transmitting XBee module is sending data the way it should be, which I can verify with another XBee connected to a SparkFun USB carrier board. The data properly streams into either Parallax Serial Terminal or the XB X-CTU utility. Therefore I have verified operation of the transmitter and that the two XBee modules are configured similarly. Transparent mode, not API mode.
However, I'm unable to receive it with the Propeller and display it back into PST or anywhere else.
Transmitting connections:
XBee Vcc to Propeller VDD (3.3V)
XBee Din to Propeller 5
XBee Gnd to Propeller Gnd
- nothing else connected
Receiving connections:
XBee Vcc to Propeller VDD (3.3V)
XBee Dout to Propeller 24 (P25 is not connected - will read XBee docs to see if this is necessary)
XBee Gnd to Propeller Gnd
- nothing else connected
PST is properly configured at 9600 bps on the correct COM port. I've tested this setup without the RF receiving lines of code, and it works fine.
I am pretty sure my problem is in the usage of the XB_Object. Once in a while I receive a few bytes of trash, but nothing like I've seen when I'm doing XBee from Prop to USB transmissions.
Any help would be appreciated. I've struggled with this one until late last night.
Thanks,
Ken Gracey
And the receiver:
Post Edited (Ken Gracey (Parallax)) : 10/29/2009 5:07:56 PM GMT
Not much in this program, but apparently enough for me. The transmitting XBee module is sending data the way it should be, which I can verify with another XBee connected to a SparkFun USB carrier board. The data properly streams into either Parallax Serial Terminal or the XB X-CTU utility. Therefore I have verified operation of the transmitter and that the two XBee modules are configured similarly. Transparent mode, not API mode.
However, I'm unable to receive it with the Propeller and display it back into PST or anywhere else.
Transmitting connections:
XBee Vcc to Propeller VDD (3.3V)
XBee Din to Propeller 5
XBee Gnd to Propeller Gnd
- nothing else connected
Receiving connections:
XBee Vcc to Propeller VDD (3.3V)
XBee Dout to Propeller 24 (P25 is not connected - will read XBee docs to see if this is necessary)
XBee Gnd to Propeller Gnd
- nothing else connected
PST is properly configured at 9600 bps on the correct COM port. I've tested this setup without the RF receiving lines of code, and it works fine.
I am pretty sure my problem is in the usage of the XB_Object. Once in a while I receive a few bytes of trash, but nothing like I've seen when I'm doing XBee from Prop to USB transmissions.
Any help would be appreciated. I've struggled with this one until late last night.
Thanks,
Ken Gracey
''***************************************************** ''* XBee RF Transmitter Example * ''* Uses XB24 to send a byte at a time * ''* Author: Ken Gracey * ''* Date: November 2009 * ''***************************************************** CON _clkmode = xtal1 + pll16x '80MHz operating frequency. _xinfreq = 5_000_000 Hz = 100 OBJ XB : "XBee_Object" Comm : "FullDuplexSerial" Num : "Numbers" VAR long value Pub Start | check XB.start(6,5,0,9600) ' XBee Comms - RX,TX, Mode, Baud XB.AT_Init ' Initialize for fast AT command use - 5 second delay to perform num.init ' Initialize Numbers object Repeat Value from 150 to 200 XB.Dec(Value) XB.tx(13) waitcnt(clkfreq / Hz + cnt) Repeat Value from 200 to 100 XB.Dec(Value) XB.tx(13) waitcnt(clkfreq / Hz + cnt) Repeat Value from 100 to 150 XB.Dec(Value) XB.tx(13) waitcnt(clkfreq / Hz + cnt)
And the receiver:
''***************************************************** ''* XBee RF Receiver Example * ''* Uses XB24 to receive a byte at a time * ''* Author: Ken Gracey * ''* Date: November 2009 * ''***************************************************** CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 Hz = 100 VAR long range long value long loopcounter OBJ Serial : "FullDuplexSerial" Debug : "FullDuplexSerialPlus" HB25 : "HB-25" XB : "XBee_Object" Num : "Numbers" PUB Start | check XB.start(24,25,0,9600) ' XBee Comms - RX,TX, Mode, Baud HB25.config(7,1,1) Debug.startPST(9600) XB.AT_Init ' Initialize for fast AT command use - 5 second delay to perform num.init ' Initialize Numbers object loopcounter := 1 Repeat loopcounter := loopcounter + 1 debug.dec(loopcounter) debug.carriagereturn if XB.RxCheck value := xb.rx debug.dec(value) debug.carriagereturn
Post Edited (Ken Gracey (Parallax)) : 10/29/2009 5:07:56 PM GMT
spin
42K
Comments
Transparent Operation
When operating in transparent mode, the modules act as a serial line replacement. All UART data
received through the DIN pin is queued up for RF transmission. When RF data is received, the data
is sent out through the DOUT pin. The module configuration parameters are configured using the
AT command mode interface.
Data is buffered in the serial receive buffer until one of the following causes the data to be
packetized and transmitted:
• No serial characters are received for the amount of time determined by the RO (Packetization
Timeout) parameter. If RO = 0, packetization begins when a character is received.
• The Command Mode Sequence (GT + CC + GT) is received. Any character buffered in the
serial receive buffer before the sequence is transmitted.
• The maximum number of characters that will fit in an RF packet is received.
RF modules that contain the following firmware versions will support Transparent Mode:
20xx (AT coordinator), 22xx (AT router), and 28xx (AT end device).
Particularly confusing to me is that the manual says "The XBee modules support both transparent and API (Application Programming Interface) serial interfaces." However, in the same page (excerpt above) is the statement that only certain firmware versions will support transparent mode. So I checked my firmware and it's not one of the transparent mode versions. My firmware is 1084, yet the last bullet from the manual says that only 20xx, 22xx and 28xx support transparent mode.
Thanks,
Ken Gracey
Parallax Inc.
Post Edited (Ken Gracey (Parallax)) : 10/29/2009 5:29:02 PM GMT
I did unsuccessfully try to read data received by an XBee into a Propeller a couple of months ago. I didn't have time to really dig into it, but I didn't ever get it working, despite confirming as you did that the XBee was receiving properly.
These are model XB24, function set 802.15.4, and version 10E6.
Therefore, it seems that we have similar firmware. Sounds like you got stuck at the same place as me in the past: PC reception is good but not via a Prop. Hmm. I'll take a look at Martin Hebel's book in the meantime.
Thanks, Ken Gracey
http://forums.parallax.com/showthread.php?p=814317
I can see that Parallax has a bunch of work to provide some working examples for these little XBee critters.
BTW, we are going to stock them really soon.
Ken Gracey
Parallax Inc.
Our engineers will scold me for posting such raw programs. There's certainly some room for improvement, but this got me started.
Ken Gracey
Parallax Inc.
These modules would be great for stocking. And now you have something running
BTW Nothing wrong with the code you posted... Clear and simple !
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)
· Search the Propeller forums·(uses advanced Google search)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
Glad you got it worked out, but I think I told you in my Email you were sending DEC's are trying to receive characters... Sorry if my Email wasn't clear enough on that :P
After an accident I'm working one handed for a while, so my Emails have been a little short worded.
-Martin
My best wishes.