Uploading a new sketch to an atmega2560 using an Arduino UNO via SPI interface


I am a newbie to this forum so my apologies in advance if I make any mistakes.

So what I am trying to do is uploading a new sketch to a atmega2560 on my custom board only via the SPI
interface. Since I cannot physically access to the board and only can access to the SD card extension port connected to the board, I want to break the SD card mount and then connect the SPI pins to an Arduino UNO board I have. It could be easy if I could use the reset pin on my board, but the SD card connection doesn't have anything connected to the reset pin. Does anyone have a good idea on this kind of problem ?

Thank you in advance.

Yes, I have an idea. Prototype your circuit on breadboard or stripboard or protoboard. Test, correct the circuit, test again, make more corrections and test again until you can find no more faults or design errors. Then design a custom board. If you are using any components which are not breadboard friendly, you can often buy adaptor or breakout boards to allow you to prototype with them.

Hi PaulRB,

I will take it as an advice but I did all of the things you mentioned. Of course, the board is working without any issue but I just want to program the board more efficiently without disassemble its case and everything. I know I can re-design the board but before that I am trying to figure out the minor change way. Thanks.

If you have no access to the reset pin, then maybe there is no minor way. In the next version of the board, include pads for an ISP programming port which can be easily accessed. You do not have to solder headers to the pads until you need them.

Hi PaulRB,

Thank you for getting back to me !
Yes, the board already has the ISP Programming port on it.
However, I just want to upload a sketch without disassembling all covers and cases to reach to the serial ports and ISP port. The only port I can access without disassembling it is the SD card extension cable from the board which is placed on outside of its case. I found some interesting resources about uploading a hex file from a SD card to the target board but the only limitation to use that method is that I would have to reprogram the target's bootloader. According to the datasheet from AVR, unfortunately, the programmer side should be able to control the target's reset signal to enable its programming mode. So, I am looking for a way to enable target's programming mode via SPI or from SD Card in any possible way. If there is no option, then I would just go redesigning it for the next version.

Thank you.