I'm using AT24C256 (Atmel's 256K EEPROM) but I can't understand its addressing.
The datasheet says:
Memory Organization:
The 128K/256K is internally organized as 256/512 pages of 64 bytes each.
Random word addressing requires a 14/15-bit data word address.
I'm using BASCOM-AVR to program an ATMega16; and my EEPROM_READ(pgNo,Addr) function body is as following:
PgNo (as byte),Addr (as word),EEPROMAddrW (byte constant),EEPROMAddrR (byte constant) and memValue (as byte) are variables.
It works fine but PgNo can be numbers from 0 to 255 and Addr can be 0-65535.
I don't know PgNo and Addr valid ranges.
Another question: 512(pages)*64(bytes)=32KBytes not 256KBytes!
The AT24C256 is a 256 KBits memory and not 256 Kbytes.
So 256 Kbits = 32 Kbytes = 512(pages)*64(bytes).
I can't answer your first question (i'm not familiar with BASCOM-AVR), but there is basically 2 difrent ways to adress such an EEPROM through a compiler.
Either you use a direct 15 bit adress, or you mention the PgNO and the adress within that page (the compiler will do the convertion for you).
It will also depend on whether you're dealing with Byte write mode or Page write mode.