Shop OBEX P1 Docs P2 Docs Learn Events
Bs2sx eprom mayhem — Parallax Forums

Bs2sx eprom mayhem

nick bernardnick bernard Posts: 329
edited 2004-12-04 03:39 in BASIC Stamp
HAIL YOU GUYS!

my bs2sx is having a major malfuction. i have a bs2sx monitorying a vital alarm system. there are 48 switches which are buffered and sucked into the stamp via a PISO shift register. there is a delay function where the status of each point counts up to a contant then triggers an alarm. the status of each point is stored into a byte in the stamps eprom.

for no apperant reason 2 of the bytes in the eprom will count up to 3 then reset to 0, and 2 other bytes will count up to 222.... niether of these values have any significance in the program.....


the catch is that the faulty code runs fine fine on a new bs2sx

also on the problomatic stamps the problem follows those 4 eprom locations and can be fixed by adding an offset to my read writes...


has anyone experianced such a problem...

rox on
nickB

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
League Bowling.... it's not a sport, it's a way of life

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2004-11-27 00:12
    Nick,

    ·· HAIL!· LOL· Without seeing your code I cannot be sure, but I can tell you what I suspect is happening...You mentioned counting using the EEPROM...Depending on how often the EEPROM is being written to, you may very well have worn out those locations on the EEPROM.

    ·· You see, EEPROMs have a finite number of write cycles before they wear out.· It's usually 1 to 10 million writes depending on the EEPROM (Some are lower, even).· But the point is, if you have a loop constantly writing to the EEPROM, you're exceeding the life expectancy of the device in a really short time.· I won't bother to get into the math...Tracy Allen has covered this several times in the past regarding data logging.

    This page says 1,000,000 cycles...·· http://www.parallax.com/html_pages/tech/faqs/gnrl_info.asp

    I think it works out so that if you're writing to the EEPROM 10 times per second, it will be past it's expected life in 69 days.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Knight Designs
    324 West Main Street
    P.O. Box 97
    Montour Falls, NY 14865
    (607) 535-6777

    Business Page:·· http://www.knightdesigns.com
    Personal Page:··· http://www.lightlink.com/dream/chris
    Designs Page:··· http://www.lightlink.com/dream/designs
    ·
  • nick bernardnick bernard Posts: 329
    edited 2004-11-30 15:23
    thx chris

    i'm read writing twice a second....

    this is horrible... if 1 million writes is an average... then that explains why some locations fall out much sooner....

    whoa is me

    i thought

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    League Bowling.... it's not a sport, it's a way of life
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2004-11-30 17:14
    You see, this is one of those situations where your avatar now matches the expected look on your face!· freaked.gif

    You may have to re-think the number of writes per given time-period.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Knight Designs
    324 West Main Street
    P.O. Box 97
    Montour Falls, NY 14865
    (607) 535-6777

    Business Page:·· http://www.knightdesigns.com
    Personal Page:··· http://www.lightlink.com/dream/chris
    Designs Page:··· http://www.lightlink.com/dream/designs
    ·
  • nick bernardnick bernard Posts: 329
    edited 2004-12-02 14:43
    hail chris...
    i just switched my read statements to get and writes to put....
    please dont tell me that there are a limited number of writes to the scratch pad....

    i just wanted the stamp to remember the state of the system in case of a reset or powerloss....

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    League Bowling.... it's not a sport, it's a way of life
  • GadgetmanGadgetman Posts: 2,436
    edited 2004-12-02 14:57
    No, there's no limit to the writes on the Scratchpad, but...

    It's not safe against powerloss, either...

    If you need that, I would suggest either getting some sort of non-volatile memory chip and connect to the BS2sx, or making darn certain that you never lose power.(Battery backup)
  • allanlane5allanlane5 Posts: 3,815
    edited 2004-12-02 15:04
    Note you could write to the scratch-pad, and every 10th write (or whatever) also write to the EEPROM.

    This way your EEPROM stored program state is only a few tens of seconds old, AND you can extend the life of your EEPROM.
  • nick bernardnick bernard Posts: 329
    edited 2004-12-02 15:51
    hail allen and gadgetman
    well my system is backed up by a ups.... and the memory preservation is more of a perk than a necessity....

    ROX ON
    nickB

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    League Bowling.... it's not a sport, it's a way of life
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2004-12-02 18:57
    One last note on backing up the state of the system...Yes, you could use the battery backup, and if you have a device such as the DS1302 you could use some of the extra memory for backups (Assuming the DS1302 has a battery backup).

    One thing we did years ago on a Z80 system (Or was it a 6502 system) was we used a circuit on the Input side of the power supply to detect power loss, then had that generate an IRQ to save the system settings into SRAM (Which was battery backed using a Dallas Semi Smart Socket)...On power-up the system would fetch the settings from the SRAM chip.

    Obviously many choices...But one isn't writing to the EEPROM that often...hehe

    Well, before I forget to mention it, yet again...Parallax could inexpensively repair that BS2 that you over-wrote the EEPROM on...That should be an easy repair.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Knight Designs
    324 West Main Street
    P.O. Box 97
    Montour Falls, NY 14865
    (607) 535-6777

    Business Page:·· http://www.knightdesigns.com
    Personal Page:··· http://www.lightlink.com/dream/chris
    Designs Page:··· http://www.lightlink.com/dream/designs
    ·
  • nick bernardnick bernard Posts: 329
    edited 2004-12-02 20:45
    hail chris
    yeah i have 3 faulty stamps that will have to make a trip back to parallax for repairs... if it is inexpensive... thx for that nibble of info...

    rox on
    nickB

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    League Bowling.... it's not a sport, it's a way of life
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2004-12-04 03:39
    When I say inexpensive, I mean relatively speaking...As in, better than buying a new stamp!· tongue.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Knight Designs
    324 West Main Street
    P.O. Box 97
    Montour Falls, NY 14865
    (607) 535-6777

    Business Page:·· http://www.knightdesigns.com
    Personal Page:··· http://www.lightlink.com/dream/chris
    Designs Page:··· http://www.lightlink.com/dream/designs
    ·
Sign In or Register to comment.