Wireless picaxe programming idea?

0justin0

New Member
Hello, Ive been reading about picaxe wireless applications, and it seems that programming a picaxe wirelessly with XBee is nigh impossible.

What is we use a different wireless system? Sparkfun sells Bluetooth "serial replacements". They have a Tx pin and an Rx pin, and is made to replace serial.

Heres the link, be sure to checkout the datasheet: http://www.sparkfun.com/commerce/product_info.php?products_id=582
 

moxhamj

New Member
http://www.rev-ed.co.uk/docs/axe210_Xbee.pdf is the xbee data sheet which has been greatly simplified from the data sheet that comes with the xbee. At the very least, to get xbees to work you have to program them to set baud rates and the like.

I'm working on this problem as well, and what we need to do is reduce things down to a a very simple task - high into one xbee = a high out of the other. Ditto a low. Then once that is working, get a series of high/low's to go in one end and come out the other. I can't quite answer this question for xbees at the moment - all I can say is that cheap 433 modules cannot do this. The cheap 433's can certainly send a series of highs and lows, but they cannot transmit a continuous high or low. Essentially this is the difference between an analog RF link and a modem RF link.

I'm going to get some xbees and do some experiments. Manuka might have some answers - he is expert at turning complex problems into simple ones.
 

0justin0

New Member
Then its a good thing i didnt link to the 433 transmitters, eh?

Ill order a pair of those bluetooth dongles sometime in the next month. It wont be cheap ($100 ish), but it would be a real great thign if it works. If anyone has these already...
 

manuka

Senior Member
Thanks for compliments! Hippy pretty much nailed this "no can do " wireless programming once before- do a search. I'd have to unearth all my mad scientist SiChip data from ~2005, but I recall those 433.920 MHz units sending a steady signal simply via a 10k resistor pullup on their data pin. Stan
 

hippy

Ex-Staff (retired)
Dr_Acula has noted the main problem - it's not just serial data which goes from the PC to the PICAXE, but also a 'break signal' a continuous high which has to be passed on. Some USB-Serial cables do not do this, XBee doesn't, and I'm not sure that Bluetooth modules would.

If you can find Bluetooth modules which carry the signals exactly as the Programming Editor puts out then it should be plain sailing.

The alternative is to use trickery to turn the signal from the PC into something which can be carried purely by serial, which can be converted back to what's intended at the other end. With this, any serial link could be workable, IR, IrDA, 433MHz, XBee, Bluetooth. It would still need testing, as there may be timeouts which need to be met which some setups might not cater for.

Converting the Programming Editor download signals into pure RS232-style serial can be done. I've proven that running a 'helper application' on the same PC as the Programming Editor. With download to COM1, COM1 TX goes out to COM2 RX, COM2 TX out to the PIXAXE end, PICAXE Serial Out goes straight back to COM1 RX.

Ideally I'd create a Virtual Serial Port so the Programming Editor would simply choose the Helper's serial port so operation would be totally transparent to the PICAXE programmer.

At the PICAXE end there needs to be something which takes the serial sent from the PC and converts it back to what the PICAXE Serial In expects ( which is what the Programming Editor download signal original was - or close enough to work ). That's theoretically possible, using another PICAXE. It's also necessary to force the PICAXE being programmed to reset prior to download, or it may be stuck in a SERIN or INFRAIN and won't respond to a download, which makes wireless download rather moot.

I haven't done any actual work on the PICAXE side of things and there may be issues which I haven't considered yet. It's certainly not as easy or as simple as it may first appear. Getting it to work over a hard-wired serial link would be the first milestone, then it should be possible to just drop in a wireless link while keeping fingers crossed.
 

moxhamj

New Member
Re Hippy "getting it to work over a hard wired serial link is the first thing". I think that is possible. After zapping a few picaxes with -12V I built my own 'standard' programming system which sits on a small board inside a PC consisting of one 74HC04. For output data, it is RS232 to a 22k/10k network, into two HC04s in series. For input data it goes via another two HC04s in series. For good measure there are a couple of leds showing data transfers. Essentially these are just level translators and buffers but what it means is what comes out of the PC can't zap the picaxe as it is only 0V or 5V at max 20mA.

On the front of the PC are two banana sockets, which go to two wires which go into a breadboard. I also have filtered the PCs internal 5V via an L, a C and a lightbulb in series to limit short circuit current so there are two more banana sockets - 5V and ground. All this sounds complex, but on the breadboard is a totally minimalist programming setup consisting of two components - a picaxe 08/08M chip and a 0.1uF filter cap. Data out to leg 2. Data back to the PC via leg 7. Power to leg 1 and 8. 4 banana plugs on the front of the PC.

What this round about description shows is that the programming signal to a picaxe can be reduced to simple highs and lows on two wires, where low is 0V and high is 5V.

This means the problem reduces now to just the wireless link. We need a system where a high input always results in a high output and is bidirectional. Obviously when the wireless goes out of range the output will go all over the place, but within range it needs a solid transmission. I think zigbee might be able to do it but I'm not totally sure.

Thinking about building a radio modem from scratch, one would translate a high into a tone of one frequency and a low into a tone of another frequency, and then probably use a phase locked loop to detect the frequencies. The frequency needs to be maybe >10x greater than the programming baud rate and I don't know if cheap 433 modules can transmit at 10Khz or if they have internal low pass filters. It might be possible to do this with a 4046 and send the output of the VCO into a comparator to detect high and low. So it may all come back to whether radio modules can transmit a 10Khz tone.

Also, one would need RF modules with different frequencies eg 433 and 900Mhz. Or maybe RF one way and infrared the other. But I don't see a way of doing bidirectional comms using IR only.

I'm pretty sure others have already solved this, including that original link. Off to Google again...

Edited by - Dr_Acula on 27/03/2007 04:34:00
 

moxhamj

New Member
Ok, returned from the world of Google with info that 10Khz is the max audio frequency for typical 433 modules. A search of FSK brings up info on wikipedia which suggests it may be possible to run at a bit less than 10khz FSK using a coding called MSK. Generally though it seems it is pretty hard to get over 300 baud using FSK in audio frequencies so download may be a bit tricky.

There is one other thing I have found with my setup above and that is that when programming a picaxe by far the bulk of the data is the download and only a little bit of data goes back to the PC (probably a checksum). So maybe it is possible to send out the data from the PC, buffer it, resend it at 300baud via wireless, buffer it again, send it to the picaxe to be programmed, wait for the return bytes, buffer them, send at a slower rate etc, and hope in the end that there are no timeouts.

Fundamentally, it is possible to squeeze 2400 baud into an audio band of 300 to 3000Khz. Indeed, it is possible to get right up to 33k baud and maybe even 56k. Standard PC phone modems do it all the time. Maybe reconfiguring two external PC modems might be easier. I'll keep researching. Suffice to say the device in the original post is actually cleverer than it initially appears.

Edited by - Dr_Acula on 27/03/2007 08:05:36
 

hippy

Ex-Staff (retired)
There's an additional issue I forgot - The comms is asynchronous and bi-directional, while the PC is holding the line high, it has to be able to receive data back from the PICAXE end. With a single carrier frequency this cannot be easily done. The signal has to become packetised commands to set the line high, then leave the airwaves free for a returning response.
 

manuka

Senior Member
As I see this. Most Picaxe reprogramming will only involve tweaks to an established routine, so it's hence fair to say a wireless based editor may be an overkill as well as error prone. Far more appealing is the use of a wireless technique to just alter run time variables - these can readily be acted on by the native program.

The situation is maybe akin to setting up a new TV set, which of course first needs plugging in & "wired" front panel tuning. Only when it's so primed will the user use an IR remote for volume, mute, channel surfing etc.

The real concern I'd have with wireless reprogramming is that bugs,blunders & interference could set the remote Picaxe device off on an unintended quest. I recall reading of a "smart" $$$$ RC model aircraft here in NZ that suddenly developed a mind of its own after certain ground commands were sent. The owner lost it entirely, as the plane then headed off into the mountainous hinterlands before crashing. Sure- he should have had fail safe etc, but it could have easily become an unguided missile...

Edited by - manuka on 28/03/2007 01:31:36
 

hippy

Ex-Staff (retired)
I see this more as a technological and intellectual challenge, a case of knocking the wall over, than producing anything extremely useful.

The usefulness I can see is in XBee robotic systems where it's desired to reprogram individual robots without contact. It would likewise be useful for any remotely sited wire-free PICAXE system ( eg, remote sensors ). It should be possible ( maybe essential ) to create a system which allows both re-programming and 'user comms' transparently over the same channel.

I do not have any practical use for wireless programming, and given the effort involved, haven't pursued the goal that far, but the subject does seem to crop up regularly in various guises.

It would be interesting to know if there are people who have a real need for this ( and what that need is ), or are likewise looking to see if it can be done simply for the sake of it, or because it would be "cool" to do.
 

moxhamj

New Member
I agree that this is more a challenge than of practical benefit. But then, who hasn't gone and built something just to say it can be done?!

I have standardised all my picaxe projects with sockets, and reprogramming involves opening a box, pulling out a chip, popping it into the programming breadboard and then moving it back. Looking at all my home automation projects (around 60 at current count), the main problem with wireless is that the cost of the wireless module is going to be considerably more than the rest of each project. Pairing a $AU90 xbee with a $AU4 picaxe seems a bit pointless (even assuming xbee would work). I'm still trying to find a reasonably priced true RS232 wireless solution.

The main application for remote programming might be robotics, and for robotics, my personal preference would not to reprogram wirelessly, but to keep the robot very simple and transmit all sensor data to a PC and write the complex visual cortex neural network simulation on the PC using VB or C.

As an aside, I have found some fantastic rf modules on an ebay store <A href='http://stores.ebay.com.au/e-MadeinCHN' Target=_Blank>External Web Link</a> for really good prices, and there are high power modules with 4km ranges as well.
 

manuka

Senior Member
Fantastic is certainly right, &amp; WHAT an RF selection this &quot;Made in CHN&quot; store has! I wouldn't mind getting my hands on some of these to verify performance claims. Which have you bought? Stan
 

manuka

Senior Member
&quot;RF heaven&quot; -guess that's <b>considerably </b> higher than the E layer!? I'm also keen on long range 434 units, so pencil me in for any you may have surplus to needs.Wonder if the 25mW EIRP ISM legal spec. is being - ahem- &quot;pushed&quot; however. If they perform well I'll consider an article on some serious 434 telemetry applications. Stan
 

Dippy

Moderator
Yes, a nice range of products. I'm just a bit wary of claims, especially based on my PRC-made products experience (mostly unhappy). If you divide claims and quality by about 4 then you'll nearer the Real World.

Back on-thread. I suspect that without something really fancy then this programming radio link is a no-goer as hippy suggested somewhere. I would guess you'd have to have an interface using:
PC -- PICAXE Emulator PIC &lt;=RF Link=&gt; PC Emulator PIC -- PICAXE.
Or something like it. The radio link section would have to do error checking and would be full of potential errors. The 'emulators' would have to store the 'code'. Personally, I wouldn't try it.

If you could make it work 95% I'd buy anyone (apart from professionals) a virtual pint. In principle I think its a great idea. I have seen attempts at low cost programming of bootloaded PICs elsewhere.
Obv with a big enough budget and brain-collective then its all possible.

High power 434MHz modules? Great and any neighbours using DTT will really love you.
 
Top