Shop OBEX P1 Docs P2 Docs Learn Events
EEPROM verify error on COM — Parallax Forums

EEPROM verify error on COM

Bobb FwedBobb Fwed Posts: 1,119
edited 2010-03-23 19:40 in Propeller 1
I am using 24LC512-I/SM EEPROM and I have had a problem a few times. Under certain circumstances I erase the used EEPROM space with the code below.
About 50% of the time after the EEPROM has been erased, I can no longer program the EEPROM, I get this error: "EEPROM verify error on COM #". It programs the RAM fine, it says it programs the EEPROM, but then as soon as it tries verifying the EEPROM it fails. The propeller will not boot off the EEPROM.

Any ideas how I can fix the problem (without replacing the EEPROM -- it is potted and thus I don't have any access to it), and/or prevent the problem with changes to the below software.

PRI _erase | i, empty[noparse][[/noparse]16]
'' erase EEPROM memory

  longfill(@empty, 0, 16)

  REPEAT i FROM $0 TO $4500 STEP 64
    MEM.write(i, @empty, 64)



MEM method:
PUB write (addr, valueAddr, size) | time
'' write page to EEPROM with watchdog  

  IF i2c.WritePage(i2c#EEPROM, addr, valueAddr, size)
    ABORT
  time := cnt
  repeat while i2c.WriteWait(i2c#EEPROM, addr)                                  ' wait for watchdog
    if cnt - time > clkfreq / 10
      ABORT

  RETURN true



using attached i2c program (mildly modified Basic i2c Driver)

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
April, 2008: when I discovered the answers to all my micro-computational-botherations!

Some of my objects:
MCP3X0X ADC Driver - Programmable Schmitt inputs, frequency reading, and more!
Simple Propeller-based Database - Making life easier and more readable for all your EEPROM storage needs.
String Manipulation Library - Don't allow strings to be the bane of the Propeller, bend them to your will!
Fast Inter-Propeller Comm - Fast communication between two propellers (1.37MB/s @100MHz)!

Comments

  • Zap-oZap-o Posts: 452
    edited 2010-03-18 17:33
    As far as I understand it your code may be over writing the running code. Not sure of the technical name but its sort of like over writing the stack.
  • Bobb FwedBobb Fwed Posts: 1,119
    edited 2010-03-18 17:51
    Well, the point of the function is to erase the code from the EEPROM. The propeller doesn't use the EEPROM except during bootup and when I have it in my software to do such. It shouldn't affect the propeller at all (until Reboot -- and it doesn't in my experience).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    April, 2008: when I discovered the answers to all my micro-computational-botherations!

    Some of my objects:
    MCP3X0X ADC Driver - Programmable Schmitt inputs, frequency reading, and more!
    Simple Propeller-based Database - Making life easier and more readable for all your EEPROM storage needs.
    String Manipulation Library - Don't allow strings to be the bane of the Propeller, bend them to your will!
    Fast Inter-Propeller Comm - Fast communication between two propellers (1.37MB/s @100MHz)!
  • Zap-oZap-o Posts: 452
    edited 2010-03-18 17:56
    So where is the code going to reside for the propeller to run. Hum this is new to me, so you are saying that after you boot the propeller it loads code from EEprom then erase the EEprom and the code that was loaded will still run in the propeller?
  • Clock LoopClock Loop Posts: 2,069
    edited 2010-03-18 18:03
    I noticed this error when my crystal had a bad solder joint. It would program ram, but the eeprom would only take 1/2 the time.
  • Bobb FwedBobb Fwed Posts: 1,119
    edited 2010-03-18 18:09
    Zap-o said...
    So where is the code going to reside for the propeller to run. Hum this is new to me, so you are saying that after you boot the propeller it loads code from EEprom then erase the EEprom and the code that was loaded will still run in the propeller?
    Once the propeller uses the EEPROM to boot, you could remove the chip and the propeller wouldn't know the difference (unless it reboots or your software accesses it).
    Clock Loop said...
    I noticed this error when my crystal had a bad solder joint. It would program ram, but the eeprom would only take 1/2 the time.
    I could see how that may happen, it starts clocking wrong and screws up the data. My crystal is fine. The software I can put on the RAM verifies the timing is all correct.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    April, 2008: when I discovered the answers to all my micro-computational-botherations!

    Some of my objects:
    MCP3X0X ADC Driver - Programmable Schmitt inputs, frequency reading, and more!
    Simple Propeller-based Database - Making life easier and more readable for all your EEPROM storage needs.
    String Manipulation Library - Don't allow strings to be the bane of the Propeller, bend them to your will!
    Fast Inter-Propeller Comm - Fast communication between two propellers (1.37MB/s @100MHz)!
  • Dave HeinDave Hein Posts: 6,347
    edited 2010-03-18 18:49
    Your software doesn't set values for _clkmode or _xinfreq, so I don't think your using the crystal oscillator.· Maybe that's the problem.
  • Clock LoopClock Loop Posts: 2,069
    edited 2010-03-18 19:36
    Dave Hein said...
    Your software doesn't set values for _clkmode or _xinfreq, so I don't think your using the crystal oscillator. Maybe that's the problem.

    Nice catch, I wonder if this has a similar effect of a loose crystal. (in both situations the prop would run from the act of programming (generating emi) into the XI circuitry?)
  • Bobb FwedBobb Fwed Posts: 1,119
    edited 2010-03-18 21:18
    I cannot post the full program but the parent object (the one that contains _erase) does declare the both _clkmode and _xinfreq. But even without that it shouldn't affect my ability to program the EEPROM. During both the programming (from the Prop Tool) and bootup it is using internal oscillators anyway.

    The problem seems to be in the EEPROM or how the Propeller communicates with the EEPROM. The _erase method doesn't erase the entire EEPROM, just the part with the software on it.
    Has anyone had problems with damaging an EEPROM if the power is cut while a write is taking place?

    There is any way to "format" the EEPROM to set it back to its original state is there?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    April, 2008: when I discovered the answers to all my micro-computational-botherations!

    Some of my objects:
    MCP3X0X ADC Driver - Programmable Schmitt inputs, frequency reading, and more!
    Simple Propeller-based Database - Making life easier and more readable for all your EEPROM storage needs.
    String Manipulation Library - Don't allow strings to be the bane of the Propeller, bend them to your will!
    Fast Inter-Propeller Comm - Fast communication between two propellers (1.37MB/s @100MHz)!
  • Bobb FwedBobb Fwed Posts: 1,119
    edited 2010-03-19 18:42
    No other ideas?
    This is potentially an expensive problem. EEPROMS going bad, only solution is to replace entire circuit board potted enclosure.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    April, 2008: when I discovered the answers to all my micro-computational-botherations!

    Some of my objects:
    MCP3X0X ADC Driver - Programmable Schmitt inputs, frequency reading, and more!
    Simple Propeller-based Database - Making life easier and more readable for all your EEPROM storage needs.
    String Manipulation Library - Don't allow strings to be the bane of the Propeller, bend them to your will!
    Fast Inter-Propeller Comm - Fast communication between two propellers (1.37MB/s @100MHz)!
  • Clock LoopClock Loop Posts: 2,069
    edited 2010-03-19 19:11
    It might help to post the schematic or top and bottom copper pcbs. Perhaps the eeprom is just a bad one.
    Has this happened to more than a single board?
  • Bobb FwedBobb Fwed Posts: 1,119
    edited 2010-03-19 19:40
    It has happened on at least 2 possibly 3 (I can't find the third one at the moment, but I seem to remember three). But I have made 80 or so that haven't had a problem. But 90% of those have never had the need to invoke the _erase method. I fear that the two or three that have died expose a staggeringly high percentage of potential failures (in just the set of boards that have needed to call the method). If the percentage persists across the entire set then I can expect many failures.

    Attached is the schematic. It's not the complete board, but it is everything pertaining to programming the Propeller and the EEPROM.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    April, 2008: when I discovered the answers to all my micro-computational-botherations!

    Some of my objects:
    MCP3X0X ADC Driver - Programmable Schmitt inputs, frequency reading, and more!
    Simple Propeller-based Database - Making life easier and more readable for all your EEPROM storage needs.
    String Manipulation Library - Don't allow strings to be the bane of the Propeller, bend them to your will!
    Fast Inter-Propeller Comm - Fast communication between two propellers (1.37MB/s @100MHz)!
    1076 x 1126 - 58K
  • Bobb FwedBobb Fwed Posts: 1,119
    edited 2010-03-22 23:14
    I just had another one die on me. Exact same error exact everything.

    Can someone with a 24LC512 try running the code above. I want to know if it is somehow the wiring (can't see how) or something in the software, or what!?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    April, 2008: when I discovered the answers to all my micro-computational-botherations!

    Some of my objects:
    MCP3X0X ADC Driver - Programmable Schmitt inputs, frequency reading, and more!
    Simple Propeller-based Database - Making life easier and more readable for all your EEPROM storage needs.
    String Manipulation Library - Don't allow strings to be the bane of the Propeller, bend them to your will!
    Fast Inter-Propeller Comm - Fast communication between two propellers (1.37MB/s @100MHz)!
  • mparkmpark Posts: 1,305
    edited 2010-03-23 19:40
    Probably unrelated, but I was getting EEPROM verify errors with my homemade Propeller board. Removing the pullup on SCL cleared that up for some reason. If you're grasping at straws, that may be one.
Sign In or Register to comment.