info on making ebay bt module a prop programmer, finding rts/dtr!
rwgast_logicdesign
Posts: 1,464
Ok heres the deal guys we need a BT based solution for programming the propeller not just comunicating with it. well why you ask? ill tell you why...
#1 There needs to be a way to work on projects from the smart phone/tablet. If your like me you have a busy life and you wanna work on projects when a computer set up for the propeller isnt available. but you always have a phone handy. and maybe you have a bt keyboard to make programming easyer.
#2 wires suck and serial ports are limited. so like me maybe u have a few usb hubs connected to extension cables for each work area and then you have real serial cables strewin about. if you work on multiple projects with micros im sure u have clitter plus ftdis and isp programmers cost alot more than a cheapo ssp bt from ebay.
ok everyone knows about the ebay special bt ssp dongle. but its only good for communication right now. why you ask? well the documentation and little breakout boards only tell us about the rx tx vcc and ground pin. to program the propeller that should be enough but we also need the reset line so your software can reset the propeller at the appropriate times while programming. ok so for reset functionaloty the serial device(im this case the ebay bt dongle) needs a dtr or rts line. as i said above there is very little documentation on these bt modules the fewv nuggets of info out there only show pins rx, tx, voltage, ground so there is nothing to suggest these modules have a connection to dtr or rts, the chip itself may not have these lines.
ok so at this point im betting most people just assume they cant use dtr/rts lines and move on with life. so if you want to program ur prop over bt now your sad cuz you got this module based on ggs tutorial hoping you could figure out how to write software to program your prop using it. im sure a few of us did that i almost did, but i didnt and thats how i have some good info for everyone.
in my infinate cheapness i had an old usb bt adapter that i ripped apart to see if i could use it as a serial device, instead of buying the ebay one. well to my surprise it had surface mount pads for rx, tx, vcc and ground (acually took 3 different bt sticks apart before this one almost gave up) but wait it also had msio miso clck cts and RTS. I struck gold! well heres the issue i cant find the usb key online anywhere its 3 years old just said Azio on it. So ya i got lucky but that only helps me and doesnt let me use it in products so bleh. Not to mention that my awfull smt soldering skills ended up tearing the breakout pads off... so now it doesnt help me. Anyways in my research i found more gold! these ebay modules use a CSR17 bt chip. Mine uses a CSR16 chip! So im pretty sure the ebay modules just use the newer version. Since i found this out i have emailed CSR and they havent mailed back ive also ordered a few ebay modules but im waiting on them. here is my module
http://db.tt/mxVart0H
now im about 90 precent sure the chips on the ebay module should be at least rts and spi capable. that means these things have the potential for faster comm and/or prop programming. maybe this is a cheap csr chip with less features but its bigger than mine and most of the time these chips all have the same features its cheaper to just make one chip if your not trying to rip the public off, since these guys wont even answer my request to buy volume im sure they dont deal with the public alot and have no need for feature stripped chips. Since my ebay modules arent here i cant fool with them but im thinkin maybe one of those NC labled pads on the side of the module may be rts at the least.
here is my proposal someone smart who owns appropriate test tools on this board needs to find a reset line. If they arent broke out im sure there on the chip at least. the problem with that is its an smt qfn style so only someone with experince and reflow can get to it. so basically if someone wants a crack at testing the ebay module against my csr16 module with a bus pirate or logic analyzer ir something im more tan wilking to part w it if u can still access the io kines after a heated the padsc off on accident.
im sure there are plenty of hardware solutions to get this working maybe audio cable from smart phone to act as a reset line, an arduino pluged into p30 and 31 recieving the bt signal and passing it on to the prop along with pulling the reset line.. id like to see this bt module be a straight substitue for an ftdi prop plug maybe a discrete transistor if needed. it would be very simple and elegant. im willing to provide any assistance i can.
#1 There needs to be a way to work on projects from the smart phone/tablet. If your like me you have a busy life and you wanna work on projects when a computer set up for the propeller isnt available. but you always have a phone handy. and maybe you have a bt keyboard to make programming easyer.
#2 wires suck and serial ports are limited. so like me maybe u have a few usb hubs connected to extension cables for each work area and then you have real serial cables strewin about. if you work on multiple projects with micros im sure u have clitter plus ftdis and isp programmers cost alot more than a cheapo ssp bt from ebay.
ok everyone knows about the ebay special bt ssp dongle. but its only good for communication right now. why you ask? well the documentation and little breakout boards only tell us about the rx tx vcc and ground pin. to program the propeller that should be enough but we also need the reset line so your software can reset the propeller at the appropriate times while programming. ok so for reset functionaloty the serial device(im this case the ebay bt dongle) needs a dtr or rts line. as i said above there is very little documentation on these bt modules the fewv nuggets of info out there only show pins rx, tx, voltage, ground so there is nothing to suggest these modules have a connection to dtr or rts, the chip itself may not have these lines.
ok so at this point im betting most people just assume they cant use dtr/rts lines and move on with life. so if you want to program ur prop over bt now your sad cuz you got this module based on ggs tutorial hoping you could figure out how to write software to program your prop using it. im sure a few of us did that i almost did, but i didnt and thats how i have some good info for everyone.
in my infinate cheapness i had an old usb bt adapter that i ripped apart to see if i could use it as a serial device, instead of buying the ebay one. well to my surprise it had surface mount pads for rx, tx, vcc and ground (acually took 3 different bt sticks apart before this one almost gave up) but wait it also had msio miso clck cts and RTS. I struck gold! well heres the issue i cant find the usb key online anywhere its 3 years old just said Azio on it. So ya i got lucky but that only helps me and doesnt let me use it in products so bleh. Not to mention that my awfull smt soldering skills ended up tearing the breakout pads off... so now it doesnt help me. Anyways in my research i found more gold! these ebay modules use a CSR17 bt chip. Mine uses a CSR16 chip! So im pretty sure the ebay modules just use the newer version. Since i found this out i have emailed CSR and they havent mailed back ive also ordered a few ebay modules but im waiting on them. here is my module
http://db.tt/mxVart0H
now im about 90 precent sure the chips on the ebay module should be at least rts and spi capable. that means these things have the potential for faster comm and/or prop programming. maybe this is a cheap csr chip with less features but its bigger than mine and most of the time these chips all have the same features its cheaper to just make one chip if your not trying to rip the public off, since these guys wont even answer my request to buy volume im sure they dont deal with the public alot and have no need for feature stripped chips. Since my ebay modules arent here i cant fool with them but im thinkin maybe one of those NC labled pads on the side of the module may be rts at the least.
here is my proposal someone smart who owns appropriate test tools on this board needs to find a reset line. If they arent broke out im sure there on the chip at least. the problem with that is its an smt qfn style so only someone with experince and reflow can get to it. so basically if someone wants a crack at testing the ebay module against my csr16 module with a bus pirate or logic analyzer ir something im more tan wilking to part w it if u can still access the io kines after a heated the padsc off on accident.
im sure there are plenty of hardware solutions to get this working maybe audio cable from smart phone to act as a reset line, an arduino pluged into p30 and 31 recieving the bt signal and passing it on to the prop along with pulling the reset line.. id like to see this bt module be a straight substitue for an ftdi prop plug maybe a discrete transistor if needed. it would be very simple and elegant. im willing to provide any assistance i can.
Comments
edit - might just be my brain is fried.
so you're trying to program a umcu wirelessly?
RTS CTS are 'Hardware' handshaking.
Unless the BT protocol for transferring serial data also has special packets for HW Handshaking, that's not going to work.
And if I don't remember too much wrong, you generally have to get the 'Reset' signal to be of a specific length.
Timing really sucks when going from HW to SW and back again to HW.
Of course, now that I've written this, I expect Phil or someone else to prove me wrong...
However, I instead chose the path of least resistance and posted information on how to use Pololu's Wixels to wirelessly program a propeller.
http://forums.parallax.com/showthread.php?139534-Wireless-Programming-of-a-Propeller-chip-(video)
As you can see from the thread several people have duplicated my success. So for $40 (plus shipping and handling) you can do this too.
This thread title is asking for RTS/DTR, but this is an intermediate step and what you really want is over the air programming, is this correct?
They are already doing over the air programming, just not with the propeller tool. I'm pretty sure when the USB is reset, the FTDI hits the DTR to reset the prop. This is all you need to start reprogramming the prop eeprom through the regular prop initialization sequence.
Also-
On the propforth project, Sal is using BT as cable replacement. The PC is rebuilding the forth.spin programs, (using the propellant library) sending the code to the props, executing the test suite, and checking the results. So this should contain examples of over the air programming as well as wireless communication. The BT support probably is won't be in the standard kernel, but it will be in the extensions so will be easy to isolate and examine. The next public release should be in a couple weeks, there might be something in there you can use.
You should be able to do what you want (program the prop over the air) but it might be problematic to use the serial port hardware flow control to do it. But that should be ok, as the job gets done with out it.
The bluetooth was only transferring the .eeprom data only, and the Prop was storing the data to ram or eeprom, verifying via a chksum, overwriting the boot eeprom, reboot. It takes just an extra few simple steps on BST or Proptool to save binary/eeprom, have another GUI that loads the file and transmits it. The SPIN resources would be minimal if in fact a method could dedicate some time to watch for bluetooth data.
I've been thinking along the same lines, and I think there may even be most of the code already created to do this..
By altering the "default" program in the EEPROM, there is no reason why you couldn't monitor a couple communication lines to look for a notification that a new file needs to be received and written to an SD card. There are several "Launcher" or "Menu" programs which are suitable for installing into the EEPROM which could have some communication routines added to upload to the Propeller. I can think of Xmodem and the file uploader that Andy did for Propterminal off the top of my head, but I'm sure there are others.
OBC
@gadgetman, i am for the most part talking about a hardware solution. like i said i belive these modules have at least rts pins
@braino, yes the thread u posted is about the ebay modules im reffering to. i am talking wireless programming, but the end most definately has to use bluetooth, and it has to be compatible with homespun and gcc. These requoremenys are all to keep compatibiloty with all android phones as a start.
@ t chap, im not sure why it wouldnt be compatible, the bt modules are fast enough.
@martin, so polulu is not bt based? this is aacually great info for anyone who wants wireless programming! the problem with polulu in this case is its not on every smart phone and tablet, otherwise this solves the two many cables on the desk problem
The onboard bootloader micro on my backpack can intercept a hex file and load it directly into the Prop's EEPROM without any need for a preloaded "hex bootloader" in the Prop. For a lot of my pcbs I happen to have the extra pins next to the 4-pin PropPlug so this is easy. If you have Forth preloaded however then you can talk directly to Forth (of course) and load in a source code file which is compiled on the Prop as it's being downloaded at 230400 baud. This is the easy way if you are gifted in and with Forth. If not, then you must throw your lot in with the rest of the poor Forthless sods
Once you trace through and figure out what was done and in what order, you can implement in any language.
The forth part is kind of handy, since its interactive, but its just a stepping stone to the final application, as with any other tool. Of course, lots of forth folks find that the forth implementation is suitable as final.
One of the interesting features of PropForth that is on my list of things to play with is the way the master Propeller in a Master/slave relationship can act as an I2C EEPROM to the slave it is trying to load. It basically resets the slave using an I/O pin and then waits for the slave to boot "from EEPROM". This acutally means that the master Propeller could present any 32K binary image to the slave and load it. Even if you were a Forthless sod*, you could use this mechanism to load any 32K binary onto a slave. At that point, the slave could run anything and the master Propeller becomes a Forth powered communication channel running serial I/O at up to 230400bps to the slave. Each slave requires 5-6 pins to control it (28-31 on the slave plus reset and xin if you want the master to provide a clock).
This along with a wireless gateway makes a multi-propeller (PropForth mastered) cluster a very interesting play thing!!
Peter, put me on the list for a couple of your backpacks - they have a job in the Multi-Prop PropForth lab!
*harsh, but I like it!!!
but you could make a file with a compiler and then send it directly to your prop? ill have to look at what the compilers that run on an android can do in terms of this.
just to clarify im not a fourh hater! i acually am building a calculator for programmers/hardware guys and i want to add bt com and sd. the reasoning is to make it fully wirelessly programmable with the intergrated 4th engine.
the problem at hand though is mostly abobout using a standard wirless protocol to program the prop with its native programming protocol. this makes programming with a phone a snap.
like i said above i belive the ebay chips have spi and rts which could be used as reset. then all the tools are in order to do bt programming from a phone. im willing to mail my bt key to someone to compare with an ebay key if they can find the rts pin on the ebay. this would entail running bt software on any platform that uses rts. monitoring the csr16 wave forms/logic/bus data. then running the same code on the ebay csr17 and trying to find matching wave forms. im sure there are other ways but thats my solution. i just dont have the tools or the know how to connect to the spots where i burned off the pads. im also not sure how to get my key doing spp when pluged into a pc
From the 'Propeller Loader" PDF:
This should probably work for any LMM or COGM memory model PropGCC program. The other memory models would require some additional suport since they first need to load a helper into the Propeller and then load the actual code. So full support of a wirelessly isn't here yet.
Your android compiler would need to be able to generate a Propeller binary.....there's been a thread recently about success in this area. You still need to be able to throw the binary to the Propeller and have it catch it in some manner.
TRUE: the problem is the native programming protocol is locked into the EEPROM and expects certain conditions to be met in order to work. This is where Peter's solution comes in or the ability to front end the binary load with a PropForth master, for example. If you can't communicate to the propeller, handshake and maintain the protocol, it won't load via wire or wirelessly.
...and REMEMBER, there's no U in FORTH!
The U is on the outside, that's why its interactive.
GCC compiles modules to object files and links them to elf executable format. You can get a hex file from the elf file with the objcopy command. It will be something like:
propeller-elf-objcopy -O ihex your_executable.elf your_executable.hex
http://forums.parallax.com/showthread.php?136874-Bluetooth-Programming-Demo&p=1061839#post1061839
Using the BT module I had at hand I had no access to a reset pin so decided to go with a software reset. A modified bootloader is used and contained in additional EEPROM storage. The modifications allowed for an adjustable time setting which extended the time the Prop waits for a program file after reset. In the case where a programming error occurred and the system clock shut down the modifications included automatic recovery from that situation.
The download in the demo was performed using the Proptool IDE, the reset signal was sent using PST
Jeff T.