Upload code to an ATMEGA328p-AU chip with ISP from an SD-Card

Hello,

I have built a PCB which uses an ATMEGA328-p standalone chip (no Arduino board). There's a connector on the PCB to program it from a nano with the ISP sketch on it. This works like a charm! However I want to built de nano module into a programmer. What I want to do is have an SD-card on the programmer which has a compiled hex file on it. Then I can hook this programmer up to the PCB and program it.

The whole idea is that this programmer runs on batteries and does not need an external power source and does not require a computer to program the arduino.

Theoretically, this idea sounds really nice in my head. However I am not sure if loading code onto the chip like that, from the SD-card, is even possible. Has anyone of you attempted this before or has some experience?

https://github.com/zevero/avr_boot

Dear Juraj,

Thanks for the link! It's a step in the right direction. However I think this is not quit what I'm looking for. I haven't read the document fully and thoroughly yet but I think this implies that the SD-card is permanently connected to the microcontroller and with each power up it loads the code from the SD-card.

What I am trying to do however, is have one 'programmer' with an SD-card on it which can then program say 10 microcontrollers. And those microcontrollers load the code from their flash post programming.

So basically the programmer needs to upload the code from the SD-card into the flash of a different microcontroller (the one on the PCB).

Maybe nick gammon's Atmega chip stand-alone programmer to upload .hex files can be of help.

Dear Sterretje,

This seems to be exactly what I am looking for! Thank you.