Shop OBEX P1 Docs P2 Docs Learn Events
Clearing EEPROM — Parallax Forums

Clearing EEPROM

Kurt FinnieKurt Finnie Posts: 21
edited 2011-07-27 13:47 in Propeller 1
I'm new and I can't figure out how to clear the EEPROM.

I mistakenly pressed F11 and loaded a small program into EEPROM and it worked just fine, but now I want to work on my program.
I've tried powering down, removing the USB cable, reinstalling all, etc. etc. The program just starts up again from the EEPROM.

I know this is a no-brainer but I've spent way too much time and not figured it out.

Kurt Finnie

Comments

  • PavelPavel Posts: 43
    edited 2008-03-21 15:09
    You do not need to clear EEPROM, you just upload the new version of your program there, overwriting the old version. Even though the program starts executing when you power the chip, the programming connection will reset the chip to upload the new code.

    In other words, just hit F11 again and new code will go into EEPROM.
  • SeariderSearider Posts: 290
    edited 2008-03-21 16:40
    You can also press F10 and what ever program you have up will load into RAM and execute. When you reset it will go back to runing the program that was last loaded into ROM.

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

    Searider
  • IamretiredIamretired Posts: 56
    edited 2011-07-27 12:28
    I want to also clear EEPROM. I don't want to do anything else. What can I do to clear a program out of EEPROM?

    John
  • RonPRonP Posts: 384
    edited 2011-07-27 12:32
    You could just write a Do Nothing program if that will work for you.
    PUB DoNothing
    

    Upload to EEPROM F11. Upon boot up the Propeller will Do Nothing.

    Ron
  • Bobb FwedBobb Fwed Posts: 1,119
    edited 2011-07-27 13:47
    Or programmatically:
    ' using Basic I2C Driver or PASM I2C Driver
    PRI _errase | i, empty[16]
    '' errase EEPROM memory
    
      longfill(@empty, 0, 16)
    
      REPEAT i FROM $0 TO $7FFF STEP 64
        write(i, @empty, 64)
    
    PUB write (addr, valueAddr, size) | time
    '' write page to EEPROM with watchdog  
    
      IF i2c.WritePage(BootPin, EEPROM, addr, valueAddr, size)
        RETURN false
      time := cnt
      repeat while i2c.WriteWait(BootPin, EEPROM, addr)                             ' wait for watchdog
        if cnt - time > clkfreq / 10
          RETURN false
    
      RETURN true
    
    Probably not as efficient as it could be, but it's the way I've do it on a non-time sensitive system.
Sign In or Register to comment.