kcn said:
I am using Nigel's I2C code to interface a 16F628A to
a 24LC512, a 512K bit serial EEPROM.
I am doing tut6_2a.asm, and am confused as to what
are the exact possible ranges for
Code:
Data_Page ;EEPROM page
Adr_Lo ;EEPROM Low address
Adr_Hi ;EEPROM Hi address
I am almost certain that Adr_Lo is in the range from 0x00
to 0xFF, but I am not clear about Data_Page and Adr_Hi.
Could somebody please clue me in? Thanks!
It's explained in the text of the tutorial, a standard EEPROM can only address a very limited amount of memory, based on a number of 256 byte 'pages'. The tutorials use 'Data_Page' to select the page, and 'Adr_Lo' to select the address in that page. Data_Page also selects the address of the particular EEPROM as well, so it limits the number of EEPROM's you can connect on the same bus.
In order to have larger EEPROM's the manufacturers altered the addressing scheme, by making the address register two bytes long, this is called 'extended addressing' - I named these two registers 'Adr-Lo' and 'Adr_Hi', giving a possible 16 bit address space.
The first couple of turorials have two versions, the one with an 'a' on the end are for larger extended addressing, and the ones without the 'a' for smaller standard EEPROM's.
Adr_Lo and Adr_Hi give enough address range for the entire 64K EEPROM you're using.
If you check the datasheets it's all explained there!.