• AVR Freaks

Hot!Values in new 24FC512

Author
bluewave
Senior Member
  • Total Posts : 57
  • Reward points : 0
  • Joined: 2012/05/19 17:24:14
  • Location: Aotearoa
  • Status: offline
2020/01/19 16:02:48 (permalink)
0

Values in new 24FC512

Just reporting some behaviour I cannot find in the datasheet - or anywhere! Had me scratching my head, and might save someone else doing the same?
 
Reading from a brand new (never written) Microchip 24FC512 gave the following results for a sequential read, anywhere in the array:
 
- first byte of any sequential read = 127 (7Fh)
- every subsequent byte = 255 (FFh)
 
So you can read either 7Fh or FFh from the same location, depending on whether it is the first byte in a sequential read or not.
 
Any written bytes behave exactly as expected - while any never-written bytes continue to show the above behaviour until written the first time (even when other parts of the array are written and behaving normally). So it seems the array has a special "factory" state that the chip can sense.
 
A full write to the entire array is needed to eliminate this state. Wish this detail was in the datasheet - it isn't in my version anyway.
#1

8 Replies Related Threads

    jtemples
    عُضْوٌ جَدِيد
    • Total Posts : 11575
    • Reward points : 0
    • Joined: 2004/02/13 12:31:19
    • Location: Southern California
    • Status: offline
    Re: Values in new 24FC512 2020/01/19 16:07:40 (permalink)
    0
    first byte of any sequential read = 127


    Regardless of the start address?  That sounds like a bug in your read routine.
    #2
    bluewave
    Senior Member
    • Total Posts : 57
    • Reward points : 0
    • Joined: 2012/05/19 17:24:14
    • Location: Aotearoa
    • Status: offline
    Re: Values in new 24FC512 2020/01/19 16:32:36 (permalink)
    0
    Exactly - but I'm fairly certain the read routine is fine.
     
    If I write 127's or 255's to the array, the same read routine gives these expected values. Only if it reads any never-written part of the array does it show the 127,255,255,255.... behaviour.
     
    #3
    bluewave
    Senior Member
    • Total Posts : 57
    • Reward points : 0
    • Joined: 2012/05/19 17:24:14
    • Location: Aotearoa
    • Status: offline
    Re: Values in new 24FC512 2020/01/19 16:42:31 (permalink)
    5 (4)
    I spoke too soon! I think my read routine is the problem and is corrupting the first byte of a sequential read when the MSB is 1.
     
    So the array is FFh from the factory as is typical - my complicated explanation is...totally wrong.
     
    Sorry about that!
    #4
    bluewave
    Senior Member
    • Total Posts : 57
    • Reward points : 0
    • Joined: 2012/05/19 17:24:14
    • Location: Aotearoa
    • Status: offline
    Re: Values in new 24FC512 2020/01/19 17:24:28 (permalink)
    5 (3)
    Yes, had an incorrect ACK at the start of my sequential read routine...zeroing the first received bit.
     
    Thanks JTemples, made me revisit the code a bit more carefully.
     
    #5
    bluewave
    Senior Member
    • Total Posts : 57
    • Reward points : 0
    • Joined: 2012/05/19 17:24:14
    • Location: Aotearoa
    • Status: offline
    Re: Values in new 24FC512 2020/01/20 14:37:55 (permalink)
    0
    To explain fully - problem was I was sending an ACK before receiving the first byte of the sequential read (when I should have just immediately started receive after sending the slave address+read bit).
     
    The extra ACK was causing the first bit of the first byte to read as "0" regardless of its actual value - corrupting any first byte that started with '1' (and turning a 255 into a 127...).
     
     
    post edited by bluewave - 2020/01/20 14:39:50
    #6
    ric
    Super Member
    • Total Posts : 25555
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: Values in new 24FC512 2020/01/20 14:42:23 (permalink)
    0
    That makes sense, but what lead you to believe that writing a value to that address fixed the problem?
     
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #7
    bluewave
    Senior Member
    • Total Posts : 57
    • Reward points : 0
    • Joined: 2012/05/19 17:24:14
    • Location: Aotearoa
    • Status: offline
    Re: Values in new 24FC512 2020/01/20 14:49:50 (permalink)
    0
    Foolishly, I was writing zeros and 127. Neither of which have MSB=1.
    Then I noticed writing 255 did not change the problem...
    #8
    ric
    Super Member
    • Total Posts : 25555
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: Values in new 24FC512 2020/01/20 14:53:35 (permalink)
    5 (2)
    :)
    That's why you should always describe the actual test you did, not just what you think you did...

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #9
    Jump to:
    © 2020 APG vNext Commercial Version 4.5