The old Mega series such as Mega328p can be programmed over SPI if no bootloader is written on it. The new megaAVR 0-series, which contains the Mega4808, use a UPDI interface for programming. The UPDI Interface has only one communication pin for receive and transmit. So you only need ground ,the UPDI pin and a power supply for programming. An official programmer is the Atmel ICE programmer which costs about 100$. But for the first try most people did not want to spend so much money for a programmer and build a programmer on her own.
Building the UPDI programmer
An cheap DIY programmer is the JTAG2UPDI programmer. You only need and arduino nano, 4.7kOhm resistor and a 10uF capacitor.
- Just connect one end of the 4.7kOhm resistor to the PIN D6 of the arduino nano. The other end of this resistor is your UPDI Connector for the Mega 4808.
- Connect also a 10uF capacitor between reset and ground.
- Now you can solder wires to the free end of the 4.7kOhm resistor (UPDI), to a ground pin of the arduino nano and one to the +5V Supply of the arduino nano.
Now the connection should look like this:
Programming the arduino nano with the programmer image
Now download the JTAG2UPDI github repository. Open the downloaded repository and copy all files in the source folder to a new folder with the name jtag2updi. After this you can open the jtag2updi.ino with arduino. Now select the arduino nano, the serial port and program the arduino.
If it is done you can program the Mega 4808 with this programmer.
Programming Mega 4808 with JTAG2UPDI programmer
Now you can start to program your Mega 4808. You can read here how does it works.
- This programmer has a 5V logic voltage. Please programm only the Mega 4808 if the power supply of the Mega 4808 is also 5V. The Atmel ICE have a logic level shifter inside which can be external feeded with the logic level voltage.
Other posts about Mega 4808