This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Using 1024K Memory on I2C

Hi All,
Could some one please help me out in the way as to how to read from a 1024K mem.
I am using 512K at the present moment using the operation below.


do{
    GoMaster(addr);             // set address
    if(NoAck==1)SendStop();     // if no acknowledge, end transaction
  }while (NoAck==1);

	SendByte((b_num & 0xff00)>>8);
	SendByte((b_num & 0x00ff));
	SendByte(dat);
	SendStop();

Where I am getting confused is the size of 1024 is 0x20000 so what dose the P0 bit signify the MSB i.e. the single first bit and then the rest of the code and how should I implement it? (16 bit against 17 bit)

This is what I got from the datasheet.

To select a data word in the 1024K memory requires a 17-bit word address.
The word address field consists of the P0 bit of the device address, then the most significant word address followed by the least significant word address
A write operation requires the P0 bit and two 8-bit data word addresses following the device address word and acknowledgment.

Thank you
ajay

  • It would be helpful if you provided part number of the memory IC you are using. If it is Microchip's 24xx1025, then the most significant bit of the address is encoded in the I2C address byte, also known as the control byte in Microchip's docs.

    Regards,
    - mike

  • Hi Mike,
    I am using AT24C1024 IC.
    I am also having trouble in the use of P0 as MSB in device word address. in AT24C512 which i am using A0 and A1 which tell me that i can use 4 devices. Here i know that only two ICs can be connected using A1.
    But what is the use of P0 here?

    thank you
    ajay

  • A quote from the datasheet for AT24C1024:

    The seventh bit (P0) of the device address is a memory page address bit. This memory page address bit is the most significant bit of the data word address that follows.

    Seems clear to me. It appears that P0 is the most significant bit of the 17-bit address.

    Regards,
    - mike

  • Hi Mike,

    I had understood that but what i did not know was where to send it.

    But I found that out from some article that it is to be sent along with the 8 bit address word which contains A1 and then the rest of the sixteen bits as normal in 512.

    Thank you for your help
    Ajay

  • You should extract the 17th bit of the address, place it in the P0 and send it along with the (address + R/W) byte.

    For ex,
    assume the device address bit A1=1.
    if the address of the EEPROM to read is 0x10000, then the very first byte you supposed to send after generating a START is
    '10100111'(i.e. 0xA7)

    - Neo

  • Hi Neo,
    Thank you for that,
    I will do that and try it out.


    Thank you
    Ajay