Addressing in the ATmega4809

The ATmega4809 microcontroller used in the Arduino Nano Every differs from the other AVR microcontrollers in other Arduino boards in that all memories can be addressed as part of the data space. This “cheat” means it no longer behaves like a Harvard architecture which simplifies coding.

Literal strings and variables declared as const are now saved in the flash ROM and don’t require special functions to access. Likewise the EEPROM and fuse bytes can be read easily by the programs.

Perhaps the downside of this scheme is the total memory is limited to 64kB. Relatively larger applications may still need the ATMega2560 of the Arduino MEGA or a ARM based microcontroller. The memory map is as follows (copied from the data sheet):

Memory Map of ATmega4809

Note that the I/O registers start at location zero. The CPU registers are no longer directly in part of the address space, although some of them are part of the I/O registers. The flash code is word addressed in the code space but byte addressed in the data space. The compiler sorts things out so that if you request the address of a function it will be the code space (word) address but if you request the address of a const variable it will be the data space address.

While it is possible to configure the part for a boot code section, in the Arduino Every the boot code section is not used and the entirety of the flash memory is available for the application.