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
The Mega 4808 can normally programmed over UPDI. The UPDI Interface is great, you need only one data wire and ground, but in some cases you wanna program the microcontroller at your board and you don´…
In most every project your microcontroller does not run all the time. You also don´t want to waste battery capacity, so you should set your microcontroller into a sleep mode.
You wanna use the Arduino serial (UART) with a Mega 4808 board? No, problem. The Mega 4808 has three serial (UART) interfaces. Here you can read on which pins you can use the serial (UART) interface a…
For testing your code for the Mega 4808 with Arduino you need a board where every pin is accesable.
You wanna programm the Mega 4808 or an other megaAVR 0-series microcontroler? Then you need a UPDI programmer. You can buy the Atmel ICE for ~100$ or you can make your own UPDI Programmer.
You wanna use the Mega 4808 with MegaCoreX and Arduino? Then you need the standard pin usage / pinout for it.