3
\$\begingroup\$

I'm looking into using a PIC24FJ256GB106 to program three other of the same microcontroller.

So this is how it should work:

  • The program is sent across through serial to the master/programming PIC
  • That PIC receives it and uses ICSP to program the other PICs through the five ICSP lines (I/Os)

Before you say it, no, bootloaders are not an option.

Essentially, I'm looking for a program to make a microcontoller act like a PICkit/ICSP programmer. How would one find the code to make this magic happen?

\$\endgroup\$

3 Answers 3

5
\$\begingroup\$

There are several open source PIC programmers that will program the PIC24FJ256GB106. The gotcha is all of these are based on a PIC18, none seem to use a PIC24 to do the programming. Of course since the schematics and firmware are provided, if you are set on using the same PIC24 to do the programming, you could convert one of these boards (and the firmware) over to that chip.

Here are three:

Olin Lathrop's LProg, which you can buy from Microchip DIRECT for $20. Here is the schematic and here is a link to the firmware. This is the one I recommend.

DIY PIC Programmer. You can buy it for €20 here. Firmware available here.

usbpicprog. Looks like you have to make your own board for this one. Schematic available here, firmware here.

\$\endgroup\$
0
2
\$\begingroup\$

I doubt you will find exactly what you want, because the place where you'd most likely find such functionality is in programmers, which are generally meant to program a wide variety of chips, and the functionality is split between the programmer itself and the matching PC application. But you could still check for instance the pickit2 source code (it is available on the Microchip website) for inspiration.

But because you are restricing yourself to just one target chip, rolling it all yourself is not that difficult. Check the programming manual for your chip, it has all the details.

\$\endgroup\$
1
\$\begingroup\$

There's nothing magic or out of the ordinary in what you're asking. Just about every programmer for PICs out there is a PIC that programs other PICs. I would just find one of the myriad of open-source/hardware PIC programmers that are out there, and adapt it to your needs. You would concentrate on the business end -- not the USB or serial comm with a host.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.