fatehi
Newbie level 2

avr with at24c256
Hi all,
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!
Thanks a lot
A.B.Fatehi
Hi all,
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:
Code:
I2cstart 'generate start
I2cwbyte EEPROMAddrW 'slave adsress for writing
I2cwbyte Pgno 'PageNumber
I2cwbyte Addr 'Address
I2cstart 'repeated start
I2cwbyte EEPROMAddrR 'slave address for reading
I2crbyte memvalue , Nack 'read byte
I2cstop 'generate stop
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!
Thanks a lot
A.B.Fatehi