The 24xx256 is an I2C EEPROM and an easy way to extend the memory of your mircoc-controller by 256kbit, which is 32kb (32768 bytes). The 24LC256 version can be bought from SparkFun for $2 and it is very easy to program.
It is good to read the complete 24xx256 Datasheet , but here is a summary:
Byte | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Function |
---|---|---|---|---|---|---|---|---|---|
1st |
1 |
0 |
1 |
0 |
A2 |
A1 |
A0 |
R/W |
|
2nd |
ignored |
Addr<14:8> |
|||||||
3rd |
Addr<7:0> |
![]() |
![]() |
There is a great tutorial on the dangerousprototypes site.
HiZ> m 4 3 1 I2C (mod spd)=( 0 2 ) Ready I2C> W Power supplies ON I2C> P Pull-up resistors ON I2C>
I2C> [ 0xa0 0 0 1 3 2 ] I2C START BIT WRITE: 0xA0 ACK WRITE: 0x00 ACK WRITE: 0x00 ACK WRITE: 0x01 ACK WRITE: 0x03 ACK WRITE: 0x02 ACK I2C STOP BIT I2C>
I2C> [ 0xa0 0 0 ] [ 0xa1 r:3 ] I2C START BIT WRITE: 0xA0 ACK WRITE: 0x00 ACK WRITE: 0x00 ACK I2C STOP BIT I2C START BIT WRITE: 0xA1 ACK READ: 0x01 ACK 0x03 ACK 0x02 NACK I2C STOP BIT I2C>