I read the ATmega3209 datasheet and try to desperately understand how to use EEPROM. But it seems to be quite unclear and I can not find any application note or example code how to do it in practice. I understood that I can read EEPROM easily with lds beginning from address 0x1400, but writing seems to be more complex.
The datasheet says that I should read page buffer by writing to the memory. Does that mean for example:
aa: .db 0x12
Then it does not change EEPROM but read page buffer to where? Should I allocate page buffer and give SRAM address in NVMCTRL_ADDR before executing sts? Should I then modify values in buffer in SRAM and after everything is OK I give ERWP command in NVMCTRL_CTRLA and it writes the EEPROM?
Can I use old method, put data byte in NVMCTRL_DATAL and address in NVMCTRL_ADDR and give ERWP-command? Possibility to write one byte in time is enough, I have to write one or two bytes only when user changes parameters (for example temperature setpoint) manually.
I use assembler and Atmel Studio 7.0 and have hobby level experience with older AVR controllers (like ATmega328 and ATXmega64). I have not assembled a circuit yet and can not experiemnt in practice.