View Full Version : Propeller Tool to Propeller via XBee
05-24-2008, 09:08 PM
I would like to eliminate the cord for Propeller Programming. I wanted to use two XBee transceivers for this. Does this sound technically feasible? Collecting data via the link while program is running would also be nice.
On the PC end, I think the Propeller Tool requires a real or virtual com port. I'm hoping a USB or Serial Development Board could work here.
On the Propeller end, the XBeeŽ 802.15.4 (Series 1) has a 3.3V serial UART. I hope that could interface where the Prop Plug connects. Perhaps it could plug right onto the Education Kit board (see "2 ch PWM.JPG").
Has anybody done this? Any suggestions?
These are the development kits available from Digi. I'm not sure if they have all necessary software for setting up the XBee transceivers.
$129 XBee 802.15.4 (Formerly Series 1) Starter Development Kit
has 2 low power transceivers, 2 dev boards, one Serial, one USB
$179 XBee-PRO 802.15.4 (Formerly Series 1) Starter Development Kit
has 2 high power transceivers, 2 dev boards
$399 Drop-in Networking Professional Development Kit http://www.digi.com/products/wirelessdropinnetworking/dinprodevkit.jsp
has 5 transceivers
05-24-2008, 09:19 PM
There's no RF link that would work for programming the Propeller using the Propeller Tool and the built-in bootloader. The timing required just doesn't work with a packetized link like the xBee and a direct link is not reliable enough.
If you're willing to provide your own downloader, there have been implementations of XMODEM and, I think, YMODEM protocols in Spin. It wouldn't be hard to do KERMIT and any of these would work well for wireless downloading.
An xBee link for data works fine. BoeBotBasic (from the Object Exchange) has an option to use xBee for its "console" and that works fine.
05-24-2008, 09:32 PM
Thank you. I hadn't thought about the packet timing issue. That makes total sense.
I'm not sure what a downloader is. For the downloader, would I need to make binaries from the Propeller Tool, then send those over the XBee? Then at the Propeller chip end, the XBee is programmed as a downloader?
05-24-2008, 09:55 PM
You need a program to run on the Propeller that's always there that takes care of receiving another program via the RF link and writing it to EEPROM somewhere other than the 32K used for the download program. If the download program is small enough, you can use the rest of the 32K as a buffer for the downloaded program. It's best to use a 64K or larger EEPROM rather than the minimum of 32K needed for the Propeller.
There's a loader that's part of FemtoBasic that will load and run a program from an EEPROM area other than the 1st 32K
05-24-2008, 10:25 PM
I might make the PWM program (part of a robot) look for certain data from the xBee that says 'go run the download program now'. So, in Hyperterminal on the PC, I could type "getprogram" and then the Propeller is waiting for Kermit to download a file.
I'm programming in Spin and assembly now and loving it. I'll should look into what the FemtoBasic is about so I can extract the dowloader, or launch a Femto Basic program to do the download.
05-26-2008, 02:26 AM
FYI, I checked the pin spacing specifications for the XBee modules. They have 2mm spacing, not .1 inch spacing. So, they will not plug into the Education Kit boards.
05-27-2008, 10:28 AM
Check here for adapter boards.
I don't know why the XBee uses a 2mm spacing, it sees incompatible with anything I ever use.
05-27-2008, 07:55 PM
Yeah, I got caught out on the 2mm spacing too - ended-up getting the Sparkfun XBee breakout board (http://www.sparkfun.com/commerce/product_info.php?products_id=8276) and 2mm 10pin XBee Sockets (http://www.sparkfun.com/commerce/product_info.php?products_id=8272)
You'll always have as many take-offs as landings, the trick is to be sure you can take-off again ;-)
BTW: I type as I'm thinking, so please don't take any offense at my writing style http://forums.parallax.com/images/smilies/smile.gif
06-06-2008, 05:51 PM
Thanks for the references Bill and simonl. The Sparkfun and AppBee-Proto both look good for me.
11-20-2008, 07:48 PM
I wrote a Spin implementation of Kermit.ˇ This is very limited Kermit, it just gets one file, that's it.ˇ See attachment "KermitGet - Archiveˇ [Date 2008.11.20ˇ Time 03.46].zip".ˇ It's a demo program, not a proper object, so I did not put it in the Object Forum.ˇ This was tested on a Demo Board, via the USB cable.ˇ The sending application was the "HyperTerminal" that comes with Win XP.ˇ It works fine this way.
My next step will be to try some input pins other than 30, 31 via an XBee module.ˇ I got a pair of these in Digi's $129 XBee 802.15.4 (Formerly Series 1) Starter Development Kit ($99 on sale).ˇ I also got a couple of the Sparkfun Xbee breakout boards, with connectors, that Simon suggested.ˇ I plan to test this on the Demo Board also.
I also attached a screen shot of the VGA monitor that shows the results of a Kermit file get.
11-21-2008, 12:32 AM
Very nice, it is always great to see someone working on something that hasn't been done on the Propeller yet (Kermit and wireless programming). Definitely keep us posted with your progress on wireless programming.
Paul Baker (mailto:email@example.com)
Propeller Applications Engineer
Parallax, Inc. (http://www.parallax.com)
11-22-2008, 01:53 AM
I use the XBee's all the time and they are great. In fact I use them with more than one kind of microcontroller (but mainly SX). Here is some advice for using XBee modems:
1) Buy the $129 802.15.4 kit for testing and use. You can buy two XBee pros additionally and end up with 4 modules (2-1mW and 2-60mW) for just a little more than buying the development kit for the pro version. The development kit is nice because it comes a USB board, Serial board and a loopback connector. If you don't need that though, you can just buy two modules, You don't actually need to have a developer kit, its just nice for interfacing w/ a PC.
2) Sparkfun has breakout boards and sockets for the narrower spaced pins.
3) Use the AT transparent mode. Its probably sufficient for most needs, only use packet mode if you really know what you are doing.]
4) Make sure you are buying new modules. The version A (pre dec 2007) modules can't upgrade to the newest firmware (buying from company should be fine)
5) 802.15.4 is the best way to go most of the time. Using zigbee or digimesh seriously impairs transmission speeds (by a factor of 100 sometimes), but you can always download different firmware to change with mode you use as the 802.15.4 and digimesh modules are the same hardware w/ different firmaware
6) These go nice with SX chips that can run at 3.3V optionally and I assume they would be great with propeller as they are 3.3V native.
7) The XBee PRO modules are a LOT better. Not only are they more powerful, but they have a more sensitive receiver and are especially necessary if you are doing any indoor application at all.
Hope this helps!
Thomas Talbot, MD
Gunpowder, MD, USA
11-22-2008, 04:26 AM
This may have been stated already, but if you get Xbee Pro's, you could put a spare EEPROM (or 64k boot EEPROM ), transfer the boot program over byte by byte to the spare area, confirm by whatever method you like, checksum or sending the same file twice, then once the file is received in tact, copy it from once EEPROM location to the main boot location, then reset the Prop with code. The XBee pros operate just like straight wire in the moist basic mode, it couldn't be simpler. You have choices of board mounted antenna or a tiny antenna that sticks up, or even a connector for a larger external antenna. I once tested the Pro's at 150 feet outdoors and it worked reliably. I think they have some modules that will get you miles of coverage.
11-23-2008, 05:08 PM
Does this mean it also would not work with Bluetooth?
11-24-2008, 07:50 PM
Thanks for your encouragement.
I did get the kit you mentioned, only better, it is on sale!ˇ I got it from Digi directly, but I think it may have the old A version modules, the "IC ID" is 4214A-XBEE.ˇ See photograph.ˇ Yes, this is much more cost effective than paying $300 + for un-needed 5 dev boards if you want to develop ZigBee.ˇ I am playing around with baud rates and will try the hardware flow control.ˇ It's working pretty well in transparent mode.
So far, the plain XBee is working well to the fartheset corner of my apartment in the range test.ˇ Even to my car outside, about 100 feet away.ˇ My plan is to write directly to EEPROM first, like F11.ˇ Then (much harder), with an all Assembly version, to RAM directly, then launch the Spin interpreter.
I think Bluetooth is in the same un licensed band, but a totally different protocol.
Post Edited (EricR) : 11/24/2008 1:09:22 PM GMT
11-24-2008, 09:59 PM
Last fall I did some range testing on these things. Using an XBee Pro (Series 1) on a BS2 board, I was able to communicate at 2400 Baud about 490 feet away, with the transmitting unit sitting on my second-story kitchen table inside a glass patio door facing the direction I was walking down the street holding the receiving unit. I didn't think at the time to check the range in the other direction (that is, with my building between the transmitter and receiver), but I was pretty impressed. It was right about at the 500 foot range that communications became flaky.
11-25-2008, 05:24 PM
Bluetooth will work as a terminal at 110,200 baud but the proptool does not recognize it and there is no remote reset.
12-23-2008, 08:59 PM
Range testing at 3 feet shows 700 cps (characters per second) using XBee transparent mode, and 400 cps at 40 feet.ˇ This is indoors with a few walls passed through, still with the lower powered plain XBee.ˇ Baud rate is 57,600.ˇ This is based on receiving a 6K .JPG file.ˇ I find that sending "eeprom" and "binary" files takes about the same time for small programs.ˇ This is because Kermit has RLE (run length encoding) compression.
I still did not actually save to EEPROM or RAM yet!ˇ I refined the monitor display with annotation, and now have the Kermit receive program able to receive multiple files.ˇ Next up is to change the program a Kermit receive object that is actually useful.
Included in the archcive is a slightly improved 'FullDuplexSerial' called "FullDuplexSerial128".ˇ It has a 128 byte buffer and fixes a 1ms error in the receive timeout routine.ˇ Also, it has a receive timeout routine with microseconds units for those who are really impatient http://forums.parallax.com/images/smilies/smile.gif.
The picture, "Xbee On Prop 57600.JPG", shows the result of receiving a small file with characters 0 to 50 hex.ˇ The program is archived in "Kermit_XBee - Archiveˇ [Date 2008.12.23ˇ Time 05.20].zip".ˇ Some test files to send from Hyperterminal are also included in the archive zip.
01-29-2009, 04:17 AM
I've been following this thread before registering. Thanks for the reference to SparkFun. I have two Explorer USB interfaces coming via USPS to host my extra XBee devices. I put the 8003 DigiMesh firmware on a pair of devices (XBIB-U-DEV and XBIB-R). I couldn't get a good "range test" going as the device on the RS232 board wasn't working with the RS232 port. The "node discover" worked fine. I've dropped back to firmware 10CD. That provides a good range test. Currently, I have WIN32 code processing the API mode 2 packets. I need to perform a "node discover" capable of handling whatever arrives. The application will have a railroad locomotive performing a "node discover" to find the rail cars in the yard. The names and addresses of the nodes that reply are put in a linked list. The rail cars will have the XBee attached to a PIC18F6680 that current operates my SmartCharger. The locomotive will pass a query packet to each car (from the linked list). Each car replies with GPS LAT/LON and digital compass heading. That
permits the locomotive to discern which cars are on the same rail as the locomotive. After sequencing the cars from the GPS data, a "wakeup" packet will be sent to the cars to boot the PC104 system to access the higher level capability (anglecock, cutlever, handbrakes). I'm going to run the RS232 at 9600 bps as currently envisioned.
I'm hoping Digi will "fix" the DigiMesh to work with the RS232 board in the near future. It was a disappointment to find it non-functional in 8003. The mesh capability is something I really need down the road when a train grows to upwards of 200 cars.
07-15-2010, 05:38 PM
FYI... I've recently been using the XBee (2 mW version) for commands and debugging info to my mobile robot. It is not always working well with this low power level.
Perhaps a neighbor's or my WiFi is interfering. Sometimes this low power module pair has trouble 20 feet away in my Kitchen, through a wall and some cabinets. Turning power off and back on will sometimes help this. I think I will be trying the Pro version for more power. It might also be a polarization issue, now the robot's antenna is horizontal, while the fixed central antenna is vertical. It always works in the same room at 10 feet, with perhaps just one character missing out of each 200 transmitted.