Mysterious Reset button trick
M Bush
Posts: 13
I was just perusing Philip Pilgrim's outstanding document "Applying the Boe-bot Digital Encoder Kit" and I came across something that left me very puzzled.
The Wheel Odometry program on page 33 uses the reset button to decide what it is going to do when it starts.· It counts the number of times it is pressed, waits about one second, then branches to the desired location.· Here is the pertinent code:
i· VAR· Word
DATA @64, 0····· ' Initialize reset button count on upload
PAUSE 10········ ' Debounce reset button
READ 64, i······ '·Read reset button count - 1
WRITE 64, i + 1· ' Increment count and save back to EEPROM
PAUSE 1000······ ' Wait one second
WRITE 64, 0······' If not reset agiain during wait, reinitialize count
SELECT i········ ' Act based on reset button count - 1
· CASE 0:·etc
· CASE 1: etc
My question is - what is special about location 64 in EEPROM?· I looked in my handy Stamp Syntax and Reference Manual, but I couldn't find anything at all.· Is this documented somewhere else, perhaps?· What would happen if I needed to put real data into location 64?· Would the reset button overwrite it?
Scratching head....
Mike
The Wheel Odometry program on page 33 uses the reset button to decide what it is going to do when it starts.· It counts the number of times it is pressed, waits about one second, then branches to the desired location.· Here is the pertinent code:
i· VAR· Word
DATA @64, 0····· ' Initialize reset button count on upload
PAUSE 10········ ' Debounce reset button
READ 64, i······ '·Read reset button count - 1
WRITE 64, i + 1· ' Increment count and save back to EEPROM
PAUSE 1000······ ' Wait one second
WRITE 64, 0······' If not reset agiain during wait, reinitialize count
SELECT i········ ' Act based on reset button count - 1
· CASE 0:·etc
· CASE 1: etc
My question is - what is special about location 64 in EEPROM?· I looked in my handy Stamp Syntax and Reference Manual, but I couldn't find anything at all.· Is this documented somewhere else, perhaps?· What would happen if I needed to put real data into location 64?· Would the reset button overwrite it?
Scratching head....
Mike
Comments
Ryan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Ryan Clarke
Parallax Tech Support
RClarke@Parallax.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com