Which adresses are covered by EEPROM?

Hi,

I am using Arduino Nano (Atmega 328P) with avr-lib.
It is possible to access EEPROM with following instructions:

-void eeprom_write_byte (uint8_t *__p, uint8_t __value)
-uint8_t eeprom_read_byte (const uint8_t *__p)

I am just wondered which memory space (which addresses) is covered by EEPROM?
I couldn't find any information in datasheet and decided to use 0x00 as address.
Code works fine and it is possible to write to memory and read data back.

But I am still not sure how to figure out if/why this address belongs to EEPROM...

Thanks for your help!
(Newbie in programming storage...)

It varies from board type to board type. The API in <avr/eeprom.h> suggests that the valid range is 0 to E2END, which will vary depending on what board you are targeting.

The Arduino is a Harvard architecture. The memory areas aren't contiguous. You are thinking of Von Neumann architecture where everything fits in one address space.

Like house number 1 on your street is a different house to the house numbered 1 on a different street.

ATmega has separate address space and registers for EEPROM access. Valid range is 0-E2END as @MHotchin mentioned.

I couldn't find any information in datasheet and decided to use 0x00 as address.
Code works fine and it is possible to write to memory and read data back.

In which datasheet? Try ATmega328P. It is there.
And avr-libc macro: <avr/io.h>: AVR device-specific IO definitions

Thank you so far!!

Try ATmega328P. It is there.

I tried the datasheet of ATmega328P but all information i could find is that EEPROM has a capacity of 1Kbyte.

Is it possible to write to EEPROM using Adress starting at 0x00 up to 0x3E8?

(using this function: void eeprom_write_byte (uint8_t *__p, uint8_t __value))

I am just asking out of interest.
Using EEMEM is the better alternative I figured out.

There is a bit more in the datasheet. Yes, 328p has 1kB = 1024B => max. address is 0x400-1=0x3FF.
Do not afraid to use E2END it is defined as 0x3FF but E2END will work also for different MCU like 168p (=0x1FF) without change in the code. EEMEM has different purpose - to define variable allocation in EEPROM.

Just adding that 1k is not 1000 in comp. terminology (as you supposed 0x3E8 is max. address). It is 1024. All numbers are power of 2, so 2^10 in this case, 2kB is 2048B etc.

This diagram could be helpful:
memSpacex.png

memSpacex.png