24LC256 wrong address at reading


Closed Thread
Results 1 to 14 of 14

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default Re: 24LC256 wrong address at reading

    Quote Originally Posted by Fanias View Post
    Hello all,
    I wonder if someone can help me with this problem.

    I'm storing manualy some values to 24LC256 with an external programmer and editor like this :

    Code:
    :020000040000FA                                                ' THis line was from a blank memory - not changed
    :10000000 48 45 4C 4C 4F 21 FF FF 4B 4D 31 37 57 53 FF 00  'This is the line I edit with my values
    >         0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F
    :10001000 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF  F0    'All zeros
    >         0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F  cksum
    :10002000 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0    'All zeros
    ...........continues.......
    :107FF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF91    'Last line at address 7FF0
    :00000001FF                                                        ' THis line was from a blank memory - not changed
    Fanis
    Looks like you are one byte short on the line you edited. Each line should be 16 bytes plus a checksum. What also looks odd is that the address jumps by
    0x1000 (4k) per line and not 0x10 (16).

    Most good programmers have an editor built in. You would be better off using the editor to change the data and then save it off in a hex format instead of trying to edit the hex file. That way the per line check sum would be correct.
    Last edited by falingtrea; - 6th December 2012 at 20:33. Reason: formatting fix
    Tim Barr

  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 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

  3. #3
    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 21: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, 07:33
  2. Eeprom 24lc256
    By chip_select in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 23rd March 2008, 20:19
  3. Programming IC2 24LC256
    By Squibcakes in forum General
    Replies: 12
    Last Post: - 20th September 2006, 15:36
  4. 24LC256 and PIC16F877
    By Tomas in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 1st March 2004, 14:01
  5. Writing / Reading EEPROM 24LC256 Problem
    By schmoddel in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 27th February 2004, 19: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