Shop OBEX P1 Docs P2 Docs Learn Events
Newbie Question: Clearing the EEPROM - Page 2 — Parallax Forums

Newbie Question: Clearing the EEPROM

2»

Comments

  • ratronicratronic Posts: 1,451
    edited 2007-09-30 16:32
    That's what I meant, I thought. Doesn't purging the EEPROM everytime the prop is fired up or reset means writing to it?· Dave·


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Fix it, if it ain't broke·
    D Rat


    Dave Ratcliff· N6YEE

    Post Edited (ratronic) : 9/30/2007 4:39:07 PM GMT
  • Mike GreenMike Green Posts: 23,101
    edited 2007-09-30 16:37
    You don't have to purge the EEPROM every time the prop is fired up. Re-read Ken's recent reply.
  • Ken PetersonKen Peterson Posts: 806
    edited 2007-09-30 16:41
    @ratronic:

    We're not talking about clearing the EEPROM every time the Prop is reset. We're talking about clearing the EEPROM once, so that every time the Propeller boots it finds nothing to execute unless it is downloading from the Propeller Tool to RAM.

    Often when you are doing development, you are only loading the program into RAM and not into EEPROM. If you accidentally reset the chip without downloading code, it will automatically execute whatever is in EEPROM. Sometimes you don't know for sure what you put in EEPROM the last time, and you want to make sure there's NOTHING there so that it doesn't start doing crazy stuff after an accidental reset.

    I have fallen into this trap at least once. I'll be working on some code and I'll have an old outdated version of the code in EEPROM. Then, after a reset I'll see a bug that I was sure I had fixed! It can be frustrating if you don't realize that it's running that old version from EEPROM. Being able to clear the EEPROM helps to prevent this from happening.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    The more I know, the more I know I don't know.· Is this what they call Wisdom?
  • ratronicratronic Posts: 1,451
    edited 2007-09-30 16:45
    I guess I didn't state my reply right! I know the EEprom isn't writin to unless you want to. My statement was to point out why I wouldn't want to write to it every time it's powered up or reset to help extend it's life time of write cycles. Sorry for that!! Dave

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Fix it, if it ain't broke·
    D Rat


    Dave Ratcliff· N6YEE

    Post Edited (ratronic) : 9/30/2007 5:06:44 PM GMT
  • Fred HawkinsFred Hawkins Posts: 997
    edited 2007-09-30 19:31
    Phil Pilgrim (PhiPi) said...
    You could just upload a null program to it, which would effectively clear it:

    PUB Start
      repeat
    
    
    


    -Phil
    I have been using this as my null program. Why should it need a repeat?

    '' File: DoNothing.spin
    Pub main·· 'Empty main method
  • deSilvadeSilva Posts: 2,967
    edited 2007-09-30 19:34
    Fred, this question has already been put in this thread, and also been answered to the extreme smile.gif

    (a) You need it to loop
    and
    (b) No, you need not loop
  • Fred HawkinsFred Hawkins Posts: 997
    edited 2007-09-30 19:41
    psshaw, deSilva! I am still proud of it as it was my first useful spin program and I was pestering Phil not you. So there, back after three days of poking at brachopods in the Late Ordovician. How you doing anyway?
  • deSilvadeSilva Posts: 2,967
    edited 2007-09-30 20:39
    Ah,, the Ordovician! No computers all around. But some basic nerve systems if I remember correctly.. Even the first vertebrates coming up. Lovely times, but a little bit dull outside the sea smile.gif

    I try to concentrate on my class (using the Prop) Main problem is the students do not do their homework. Can't help it... They are paying for it...i

    Post Edited (deSilva) : 9/30/2007 8:44:08 PM GMT
  • RaymanRayman Posts: 14,162
    edited 2007-09-30 21:44
    I wonder what a new prop proto board does when it powers up and loads all "0" from eeprom to ram... I'm pretty sure new eeprom chips are full of 0s. Perhaps the spin interpreter catches this and shuts down.
  • Ken PetersonKen Peterson Posts: 806
    edited 2007-09-30 23:38
    EEPROMS start their life with all FF's don't they?

    I think the boot up description in the manual describes what happens if no valid program comes form EEPROM. What exactly they mean by "shut down" is apparently part of the debate in this thread.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    The more I know, the more I know I don't know.· Is this what they call Wisdom?
  • deSilvadeSilva Posts: 2,967
    edited 2007-09-30 23:40
    But we have not yet discussed so much about what a "valid program" could be smile.gif
  • Ken PetersonKen Peterson Posts: 806
    edited 2007-10-01 00:58
    That too, deSilva!

    A lot has been covered in this thread that is WAY beyond WNed's question... smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    The more I know, the more I know I don't know.· Is this what they call Wisdom?
  • WNedWNed Posts: 157
    edited 2007-10-01 01:14
    Well thank you all for showing me that my question was not as trivial as I had originally thought!
    1. The Prop Demo board ships with some program that causes the LED's that share the VGA pins to
    Cylon Strobe once, then they all turn on, and stay on... That's what mine did anyway. I have no idea whether or not
    anything is sent to one of the video outputs, but doubt that it really matters. I was hoping it was some sort of
    power-up check that might be useful.
    2. If you do the Tutorials in the manual, you end up with an annoying program in EEPROM, that runs
    every time the chip gets reset. I was wondering if there was a way to get rid of it.
    3. In the process of getting an answer, I found out that having a program lurking in EEPROM may in fact
    cause problems when I start writing non-trivial applications that interact with hardware, etc.
    4. The most basic way to get rid of said lurking code is to load a null program into EEPROM,
    which will displace anything that is currently there.
    5. The simplest Prop null program appears to be:
    PUB main
    6. Nothing else is required, since the only purpose of the program is to prevent the Prop from doing
    anything perverse on power-up / reset. The null program is not going to idle there for three days... unless
    the house catches fire or your wife gets tired of you always playing with electronics and makes you leave it.
    7. I think that I will eventually write something that polls all the Cogs, and does some flashy display thing
    to let me know they all said Hi, but for now "PUB main" seems to fit the bill.

    Thanks,
    Ned

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "They may have computers, and other weapons of mass destruction." - Janet Reno
  • Ken PetersonKen Peterson Posts: 806
    edited 2007-10-01 01:17
    WNed: Nice summary. I like #6 especially smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    The more I know, the more I know I don't know.· Is this what they call Wisdom?
  • Fred HawkinsFred Hawkins Posts: 997
    edited 2007-10-01 03:20
    In case of fire, this may help:

    ' Donothing.spin
    CON

    _clkmode = xtal1 + pll16x
    _xinfreq = 5_000_000


    OBJ

    text : "tv_text"

    PUB main
    'start term
    text.start(12)
    text.str(string(13,"I love you, INSERT_APPROPRIATE_NAME_HERE",13,13))
    repeat 14
  • deSilvadeSilva Posts: 2,967
    edited 2007-10-01 06:10
    My last remark here: What about a screensaver?
  • QuattroRS4QuattroRS4 Posts: 916
    edited 2007-10-01 12:26
    desilva - turn the screen off when not in use! lol

    Rgds,
    John Twomey

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Necessity is the mother of invention'
Sign In or Register to comment.