So I've just taken a delivery of a pile of ATmega4809-Nanos. I use CVAVR as my compiler of choice which already has the 4809 in its project wizard.
The nano has an LED on PF5. Run the project wizard and select PF5 as an output. Drop the following code at the top of the source code...
#include <mega4809.h> #include <delay.h> #include <iobits.h>
And the following at the bottom...
while (1) { delay_ms(250); TGLBIT(PORTF.OUT,5); }
And compile it.
Now, how to program the 4809? The nano has an on-board debugger but while looking in the manual I spotted that it will also emulate a USB mass storage device so that you just drag-and-drop a .hex file onto it and it will program the 4809.
So plug in a USB lead, let it install drivers, and lo' it appears as a disk drive. Drop the main.hex onto it and I now have a blinking LED.
How easy was that?