Picaxe to Picaxe programming

SAborn

Senior Member
Its not something i have given a lot of thought to, and this may have been asked many times...

Can a picaxe be programmed by another picaxe with the required program loaded into it?

Reason for the question is i have several remote circuits that from time to time i need to change the program in, all very simple other than the need to drag the laptop out and reprogram the chip, it be nice to dump the new program into a little picaxe circuit and simpy transfer the program across.
 

BeanieBots

Moderator
Yes, has been asked several times.
No, it cannot be done. (though I recall Hippy did do something along those lines with an 08).

There is the BootI2C feature which will download a new program from I2C EEPROM for those chips which support it.
 

JimPerry

Senior Member
In theory it could be done BUT Rev Ed would have to make public the download preamble AND some way of storing the compiled Hex code that is the Picaxe program. :eek:

http://www.picaxe.com/docs/RFA020.pdf the new RF modules allow "over-the-air" programming - but you still need a laptop - useful if your remote project is at the top of a tree? :rolleyes:
 

nick12ab

Senior Member
In theory it could be done BUT Rev Ed would have to make public the download preamble AND some way of storing the compiled Hex code that is the Picaxe program. :eek:
The PICAXE could store a program but not a very big one without an external EEPROM to store it. As the compilers require the PICAXE to send something back before the next byte is sent, it might be possible to do this with a PICAXE that doesn't have hardware serial background receive.

The download preamble - why can't that be dumped using another COM port?
 

Buzby

Senior Member
I did some experiments transferring code from one PICAXE system to another, using IR.

You could use RS232, the principle is the same, just the transport medium is different.

The rough code is here : http://www.picaxeforum.co.uk/showthread.php?21546-Transfering-code-from-one-PICAXE-to-another-using-IR

The crux of the system is that the target PICAXE must have booti2c ability.

Assuming this, you could have a small PCB with a PICAXE and an LC24xxx.
Download to the PCB from a PC, then take the PCB and plug into the target system, which then uses booti2c to copy from the LC24xxx.

A lot easier than hacking the Rev-Ed coms protocol !.
 

nick12ab

Senior Member
Assuming this, you could have a small PCB with a PICAXE and an LC24xxx.
Download to the PCB from a PC, then take the PCB and plug into the target system, which then uses booti2c to copy from the LC24xxx.

A lot easier than hacking the Rev-Ed coms protocol !.
However it would take up some program memoy or a slot for this 'bootloader' required to do this.
 

SAborn

Senior Member
There is no spare pins on the circuits in use for I2C in my case.

I guess adjustments could be made to a program by sending serial in at bootup to various variables/eeprom as long as it was written into the program when originally loaded.
It would just mean if no serial data it would time out at bootup and proceed to existing program.
 

Buzby

Senior Member
However it would take up some program memoy or a slot for this 'bootloader' required to do this.
That's true, but the code is tiny.

IF some_condition THEN
BOOTI2C 4
ENDIF

The problem is the 'some_condition'. It needs some resources.

It could be an input pin, or the result of a test for I2C presence.
( The 'test' option is the way I prefer, no hardware requirement. )

Either way there will be a a small code overhead, but no more than a few bytes.
 

SAborn

Senior Member
The target chip is mainly 08m which could be changed to 08m2, but still the I2C pins are used for other functions and do see how they could be dual purpose.
Also there is other chips that is in use.

The easiest way would be just code a chip and swap it over.
 

mrburnette

Senior Member
The target chip is mainly 08m which could be changed to 08m2, but still the I2C pins are used for other functions and do see how they could be dual purpose.
Also there is other chips that is in use.

The easiest way would be just code a chip and swap it over.
The only thing I have seen in this category is several products that appear in the ATmel space that are programmed using the ISP. A company called JeeLabs has a representative device that uses PoGo pins to effect the programming! Pretty neat. Unfortunately, the implementation of the PICAXE firmware makes ISP serial-centric.

One would think that the handshaking and downloading protocols are rather simple since they rarely fail and why such information is not public is beyond me... IF it is the firmware that is the magic, why withhold the servicing protocols? This 'secret/proprietary' stuff with PICAXE has always annoyed me, but it is their business model.

I see no easy approach other than chip-swapping or the purchase of a very cheap notebook to carry around. In my case, I have commodered my wife's HP mini that was long gathering dust after she got her tablet. Reuse & repurpose... so GREEN I could scream!

- Ray

Pogo.jpg
 
Last edited:

manuka

Senior Member
The Basic Stamp slanted "Stache" mentioned in post #13 dates from quite a few years back, & it's price is/was in the US$100 range.

Today's cheap XP netbooks - themselves now nearing quaintness- look to have made it near obsolete. Back in the clunky desktop age such away from base approaches may have had appeal, but the likes of 2008-2011 Acer,Asus & HP mini netbook offerings now flood the used market -at prices as low as US$50. Of course they also let you actually see the code being ported over -or compose poetry while awaiting the arrival of anti-matter/gravity waves/god particles/whatever on your detector.

PICAXE field applications often need program tweaking rather than complete renewal in my experiences. You know how it goes - a program may turn out to have an unsuitably brief PAUSE 100. If you later may want (say) a longer pause then initially equip the program with the ability to adjust the delay to a b0 value. Using the likes of IF b0=1,2,3 etc then PAUSE 100,200,300 etc makes it feasible to reconfigure program action via simple serial transfer of b0 etc values using wireless or IR. (Changes can be further held in PICAXE NVRAM for auto use if a system power loss occurs.)

I used this approach to prolong battery life on a demo "store & forward" 433 MHz simplex repeater. Stan.
 
Top