+ Reply to Thread
Results 1 to 2 of 2

Thread: 24c16 Question:how to read and write at address 0xFF to 7FF?

  1. #1
    GraveYard_Killer Newbie
    Join Date
    Aug 2003
    Location
    Philippines
    Posts
    120

    Default 24c16 Question:how to read and write at address 0xFF to 7FF?

    i created a routine for the i2c bus protocol using pic16f877 which can do writes and read. for example, i will read and write a data of 33 to address 01;

    Start Condition --- DeviceAddress(0xA0)---ACK-- Address(0x01) -- ACK -- Data(33) -- ACK -- STOP

    then read it and display in LCD
    Start --- DevAdd (0xA0) -- ACK -- Address(0x01) --ACK -- Start --DevAdd (0xA1) -- ACK -- Receive Data from the 24C16 -- No ACK -- Stop




    i can do this to write in the 24c16. but i have problems reading and writing data with address above 0xFF. how do i write the commands for example i want to put data of 0x44 to address 0x123?

    is this correct:
    Start Condition --- DeviceAddress(0xA0)---ACK-- AddressMSB(0x01) -- ACK --AdressLSB(0x23) -- ACK -- Data(44) -- ACK -- STOP

    then read it and display in LCD
    Start --- DevAdd (0xA0) -- ACK -- AddressMSB(0x01) --ACK -- AddressLSB(0x23) -- ACK -- Start --DevAdd (0xA1) -- ACK -- Receive Data from the 24C16 -- No ACK -- Stop

    is this the way of accessing addresses higher than 0xFF in 24c16? thanks
    Learning is a life-long process...


  2. #2
    Super Moderator Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent
    Join Date
    Nov 2003
    Location
    Derbyshire, UK
    Posts
    29,759

    Default

    Try reading the datasheet for the 24C16!, but basically you have to select the correct page - you might find my PIC tutorial helpful?. The larger EEPROM's use extended addressing to allow a larger range, but the 24C16 only uses standard addressing.
    PIC programmer software, and PIC Tutorials at:
    http://www.winpicprog.co.uk

+ Reply to Thread

Tags for this Thread