Propeller losing program...
rapscaLLion
Posts: 75
Hi folks,
I've been having a problem with my propellor demo/proto boards, which I conclude must be a software issue.
Basically, I load the program, it works perfectly, runs fine, etc. If I reset, turn off/on, remove power, etc, the
program still works fine. However if the board is off for a few hours or more, the program seems to be lost
when I turn it back on. The propeller simply does not respond, as if the EEPROM is blank. As far as I can tell
this is not the case with other programs, so I assume there must be a problem with my EEPROM read/write
functions embedded in the program. Could I be leaving the EEPROM in an invalid state or something?
The relevent code sections are below:
The functions work fine and EEPROM values are saved and read within the program,
and can still be read properly when the board is reset. However a few hours without
power and the EEPROM seems to lose everything.
Any ideas?
I've been having a problem with my propellor demo/proto boards, which I conclude must be a software issue.
Basically, I load the program, it works perfectly, runs fine, etc. If I reset, turn off/on, remove power, etc, the
program still works fine. However if the board is off for a few hours or more, the program seems to be lost
when I turn it back on. The propeller simply does not respond, as if the EEPROM is blank. As far as I can tell
this is not the case with other programs, so I assume there must be a problem with my EEPROM read/write
functions embedded in the program. Could I be leaving the EEPROM in an invalid state or something?
The relevent code sections are below:
' Initialize EEPROM outa[noparse][[/noparse]28] := 1 ' set SCL high dira[noparse][[/noparse]28] := 1 dira[noparse][[/noparse]29] := 0 ' set SDA as input repeat 9 ' up to 9 cycles outa[noparse][[/noparse]28] := 0 ' put out a clock pulse outa[noparse][[/noparse]28] := 1 if ina[noparse][[/noparse]29] ' if SDA is not high, repeat quit 'read PRI readIt(eepromAddress) ee.i2cReadPage(pinNumber, ee#i2cEEPROM, eepromAddress, @buffer, 4) 'write PRI writeIt(eepromAddress) | startTime if ee.i2cWritePage(pinNumber, ee#i2cEEPROM, eepromAddress, @buffer, 4) 'abort ' an error occured during the write startTime := cnt ' prepare to check for a timeout repeat while ee.i2cWriteWait(pinNumber, ee#i2cEEPROM, eepromAddress) if cnt - startTime > clkfreq / 10 abort ' waited more than a 1/10 second for the write to finish
The functions work fine and EEPROM values are saved and read within the program,
and can still be read properly when the board is reset. However a few hours without
power and the EEPROM seems to lose everything.
Any ideas?
Comments
The EEPROMs are designed to hold their data for at least 20 years, won't write if the power supply voltage is too low to complete the write cycle. Both the Demo Board and the Protoboard have large capacitors across the voltage regulators that will maintain the supply voltage for quite some time after the input source is disconnected, certainly long enough for the EEPROM to finish its cycle and the Propeller has a "brown-out" circuit on the chip that will cause it to stop executing long before the supply voltage is too low for proper functioning.
Anyway, what you suggest doesn't make sense and you've not given enough information to begin to figure out what's really happening. You'll need to post your program (as an attachment) and include a schematic of what's connected to your Prop board (or a thorough description).
Sorry if the F10/11 thing's teaching you to 'suck eggs'.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheers,
Simon
www.norfolkhelicopterclub.co.uk
You'll always have as many take-offs as landings, the trick is to be sure you can take-off again ;-)
BTW: I type as I'm thinking, so please don't take any offense at my writing style