32KB EEPROM Usage for Data Storage?
Miner_with_a_PIC
Posts: 123
Working on the premise that a 32KB (not 64 KB etc.) sized EEPROM is used to boot the Propeller from, is it possible to write to a location within the EEPROM's memory that is unused for program storage?
If so are there any guidelines or advice regarding an address region that is free for data storage? For example if the program just happens to be 16,348 bytes (half of the EEPROM's capacity) in length does this mean the program resides in the region $0000 - $3FFF and the address range $4000 - $7FFF are free for data storage? If the EEPROM is reprogrammed will the data stored in the EEPROM's non-program region be overwritten?
On another note, I noticed that the final 8 bytes in most programs (view info, pressing the F8 key) is a repeat of 2 longs - $FFFFF9FF $FFFFF9FF --> End of program designator? Does anyone have the scoop regarding what this is?
Post Edited (Miner_with_a_PIC) : 3/30/2010 6:18:54 PM GMT
If so are there any guidelines or advice regarding an address region that is free for data storage? For example if the program just happens to be 16,348 bytes (half of the EEPROM's capacity) in length does this mean the program resides in the region $0000 - $3FFF and the address range $4000 - $7FFF are free for data storage? If the EEPROM is reprogrammed will the data stored in the EEPROM's non-program region be overwritten?
On another note, I noticed that the final 8 bytes in most programs (view info, pressing the F8 key) is a repeat of 2 longs - $FFFFF9FF $FFFFF9FF --> End of program designator? Does anyone have the scoop regarding what this is?
Post Edited (Miner_with_a_PIC) : 3/30/2010 6:18:54 PM GMT
Comments
The final 8 longs are a very tight repeat loop that causes the Prop to lock up at the end of a program that does not have an infinite loop.
It works the same way as PBASIC's 'END'.
MacGeek
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
BS2: $49
SX48 Protoboard: $10
Propeller Protoboard: Priceless
www.apple.com
www.parallax.com
www.goldmine-elec.com
www.expresspcb.com
www.jameco.com
When the main (initial) method exits, it executes a return. The run-time stack is initialized with a return address to a location in ROM that executes a COGSTOP with an argument of COGID. This causes the current cog to stop.
The reason for the post was the need to tag Propeller based systems with a unique ID number that must have a very small probability of being overwritten or lost. Based on your inputs I am thinking...
1) To the top level object set a serial number by altering data contained within a data block (i.e. dat ....)
2) Disable write protect and load the target EEPROM with the program which contains the serial number
3) Enable write protect in hardware
4) Validate functionality and perform a test read of the serial number....
5) Next unit...goto step 1
The key is WP and utilizing a data block...not too elegant but this will actually save some development time as the serial number will be loaded to RAM as part of the program during a boot, so no EEPROM read/write routines needed.
Any other ideas, suggestions or cautions would be welcome.