PDA

View Full Version : Self-Reprogramming using a transmitter and reciever, has anyone attempted it?



nemesis
- 9th February 2009, 22:24
Has anyone used the internal EEPROM of a PIC to "program itself"? Here is what I am invisioning...

1. Update your pbp code, compile.
2. Send compiled data to a device with an EEPROM on it and transmitter. This could also be done with a serial connection to a pic that has a transmitter on it.
3. Broadcast updated program code, have a leading identifier to say which module you are updating.
4. The device to be updated has a receiver in it, writes out the data to the internal or external EEPROM.
5. PIC Resets and a boot loader copies the code.
6. DeviceID sends back a message indicating program was updated.

I have searched around and mostly what I find is your standard rs-232 connection straight to a pc.

Just a couple of nice benefits off the top of my head:

Update pic's program code in hard to reach/access locations.
Mass update many pics at once.

Thanks,
Nemesis

mister_e
- 9th February 2009, 22:40
No need for EEPROM but for a custom PC & PIC bootloader which would perform all RF thingy + possible home-made encryption + CRC check + + + and at the end probably eat a lot of code space.... no longer a real big deal though.

Doable for sure. There's a load of open-source bootloader for PIC16,PIC18, PIC24, DsPIC, PIC32 here and there (USB, Ethernet, Serial, I2C, SPI and all sort of custom protocol). Pick one and work 'round it.

The core remain the same, it's only the protocol who change. And yes I did it. Even with a Cell-Phone based unit (kind of cell-phone) 1-2 years ago.