Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

I2C Bootloader

Status
Not open for further replies.

Oznog

Active Member
As I just mentioned in another thread, I have a PIC whose serial port is taken up by a GPS that needs to talk to another PIC.

The GPS port will also be used for the bootloader with a swap of external cables. Now right now the link between the PICs is I2C due to the hardware serial port being taken up by the GPS, which is a bit odd. I need to be able to bootload to the second PIC, but it has no pins or board space for the hardware serial port.

In the other thread dealt with the question of whether I could make a second serial port with software alone. So if you've got ideas along that line please bring it there. What I'm wondering is if a bootloader has ever been made with I2C, so I could hook up to the existing serial port and being able to tell the second PIC to reprogram itself through the I2C port.

Has it ever been done with I2C? PIC's I2C implementation is notoriously buggy and its specifications are severely deficient, but I do have that link working reliably so I don't forsee a lot of problem copying the procedures I made into a bootloader.
 
I've never heard of it being done, but I see no reason why it couldn't be!, it's just a question of writing the code for it.

I don't wish to criticise?, but you appear to be trying to force solutions on badly chosen hardware? - perhaps you should take a step back, and evaluate the project from the top - rather than try and work around limitations set in the early stages?.
 
You should be able to modify the bootloader to run through any interface you want. Since the processor is writing its own code space where you get the new code is eintirely up to you. I've looked at systems that run a bootloader through ethernet. In my current project I'm planning to do a bootloader through a proprietary wireless interface. Your only limitation is the bootloader code space.

If you're unsure about the quality of your I2C interface you might want to verify the sent data before you write it. The controlling PIC sends the data then reads the data back. If the two match then the controlling PIC sends a write command. You could do a parity or CRC check also if you wanted to minimise the back and forth.

I don't wish to criticise?, but you appear to be trying to force solutions on badly chosen hardware?
It certainly would be easier with more peripherals. Doing it this way will be a learing experience though. :)
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top