24LC256 wrong address at reading


Closed Thread
Results 1 to 14 of 14

Hybrid View

  1. #1
    Join Date
    May 2006
    Location
    Del Rio, TX, USA
    Posts
    343


    Did you find this post helpful? Yes | No

    Default Re: 24LC256 wrong address at reading

    One thing I see, is you keep writing over the top of the array "TEXT". Also, you don't need the FOR...NEXT loop to read sequentually.

    Try just this:
    Code:
    I2CRead memSDA,memSCL,$A1,addr,[STR TEXT\14]  'Addr is a WORD, with initial value of $0000
    This will read the first 14 bytes of the array.
    To output try this:
    Code:
    TEXT2   VAR TEXT[8]
    serout2 lcdp,lcds,[i,line1,"LOC : ",STR TEXT\6, "  ",STR TEXT2\6 ]             ' Display

  2. #2
    Join Date
    May 2006
    Location
    Del Rio, TX, USA
    Posts
    343


    Did you find this post helpful? Yes | No

    Default Re: 24LC256 wrong address at reading

    One other item. You have this comment: '$A0 does the same as $A1

    I'm assuming this is a reference to the "Control" byte in the command.

    The reason for this, is that the control byte for the EEPROM is $1010XXXR

    The high nibble is $A
    The low nibble is dependent of how the phyical chip select pins are wired. I'm pretty sure you have those either wired to GND or floating. This leaves the two possible values of $A0 or $A1, depending on the last bit. However, the last bit is dependent on whether you are reading or writing, and is controlled by PBP. So, it won't matter what you use there, as long as the 7 MSBs are correct.
    Last edited by SteveB; - 6th December 2012 at 20:23. Reason: typo

Similar Threads

  1. Reading from External Hex Address...
    By sbouda in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 30th October 2008, 06:33
  2. Eeprom 24lc256
    By chip_select in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 23rd March 2008, 19:19
  3. Programming IC2 24LC256
    By Squibcakes in forum General
    Replies: 12
    Last Post: - 20th September 2006, 14:36
  4. 24LC256 and PIC16F877
    By Tomas in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 1st March 2004, 13:01
  5. Writing / Reading EEPROM 24LC256 Problem
    By schmoddel in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 27th February 2004, 18:55

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts