06-12-2021, 18:05
Немного про 24схх, адреса и страницы. Слишком много вопросов возникает. Читаем.
The AT24C16
The AT24C16 is one variant of AT24C series others are AT24C01, AT24C02,AT24C04,AT24C08, the tutorial should hold good for all of these. Table below show memory arrangement for all of these
IC Memory Size Page Numbers
AT24C01 1K Bits(128 Bytes) 0
AT24C02 2K Bits(256 Bytes) 0
AT24C04 4K Bits(512 Bytes) 0 to 1
AT24C08 8K Bits(1024 Bytes) 0 to 3
AT24C16 16K Bits(2048 Bytes) 0 to 7
Memory Map: Each page is 256 Bytes
Note the following from the memory map.
Each page requires 8-bits to to access the 256 locations
Additional 3 bits are required to address 8 pages
Hence 13 bits are required to address the entire 16K Memory.
When using I2C, we send the device ID first and then the Memory address. Now, if looking at the table below, you could observe the following.
The first four bits of the Device ID are same for all the ICs '1010
If the next three bits are A2,A1,A0; these are physical pins on the device, which means if multiple ICs can be connected to I2C bus, however if you calculate for all ICs, the max effective memory will only be 16 K bits.
If the next there bits are P2,P1,P0; they define the page numbers.
IC Device ID
AT24C01 1 0 1 0 A2 A1 A0 R/W
AT24C02 1 0 1 0 A2 A1 A0 R/W
AT24C04 1 0 1 0 A2 A1 P0 R/W
AT24C08 1 0 1 0 A2 P1 P0 R/W
AT24C16 1 0 1 0 P2 P1 P0 R/W
Show ContentSpoiler:
The AT24C16
The AT24C16 is one variant of AT24C series others are AT24C01, AT24C02,AT24C04,AT24C08, the tutorial should hold good for all of these. Table below show memory arrangement for all of these
IC Memory Size Page Numbers
AT24C01 1K Bits(128 Bytes) 0
AT24C02 2K Bits(256 Bytes) 0
AT24C04 4K Bits(512 Bytes) 0 to 1
AT24C08 8K Bits(1024 Bytes) 0 to 3
AT24C16 16K Bits(2048 Bytes) 0 to 7
Memory Map: Each page is 256 Bytes
Note the following from the memory map.
Each page requires 8-bits to to access the 256 locations
Additional 3 bits are required to address 8 pages
Hence 13 bits are required to address the entire 16K Memory.
When using I2C, we send the device ID first and then the Memory address. Now, if looking at the table below, you could observe the following.
The first four bits of the Device ID are same for all the ICs '1010
If the next three bits are A2,A1,A0; these are physical pins on the device, which means if multiple ICs can be connected to I2C bus, however if you calculate for all ICs, the max effective memory will only be 16 K bits.
If the next there bits are P2,P1,P0; they define the page numbers.
IC Device ID
AT24C01 1 0 1 0 A2 A1 A0 R/W
AT24C02 1 0 1 0 A2 A1 A0 R/W
AT24C04 1 0 1 0 A2 A1 P0 R/W
AT24C08 1 0 1 0 A2 P1 P0 R/W
AT24C16 1 0 1 0 P2 P1 P0 R/W
ЛС не работают.