spamiam
Joined: 13 Nov 2005
Posts: 661
|
|
Posted: 24 October 2006, 16:51 PM Post subject: location of the top of the program in EEPROM |
|
|
Is there a way to get the compiler to supply the location of the top of the user program in EEPROM?
Actually, I will be using FRAM instead of EEPROM, so that the write cycle limitation is not an issue in case of accidental infinite lops as I debug code.
With 32K FRAM/EEPROM available, there may be quite a bit available for the user to store stuff (rather than using Persistent memory).
If I were to use a larger EEPROM or FRAM, e.g. 64K, how does this influence my use of PutEEPROM and GetEEPROM? Is there a 64K addressing limit on Get/PutEEPROM? From what I saw in the language reference, these issues are not addressed. I also looked in the other reference docs and saw nothing specifically addressing these questions.
I thought I had seen some similar issues arise here in the forum, but I could not find it
Can Zbasic handle the memory allocation in EEPROM similar to regular memory? Or do I have to do it by hand. Not a big problem, I bet....
-Tony |
|
dkinzer Site Admin
Joined: 03 Sep 2005
Posts: 2493
Location: Portland, OR
|
|
Posted: 24 October 2006, 17:12 PM Post subject: Re: location of the top of the program in EEPROM |
|
|
| spamiam wrote: | | Is there a way to get the compiler to supply the location of the top of the user program in EEPROM? | Register.CodeSize is a compile-time constant that indicates the number of bytes your program uses in the Program Memory space. It can also be interpreted as the lowest address in Program Memory that is not used by your program.
| spamiam wrote: | | Is there a 64K addressing limit on Get/PutEEPROM? | Yes. The SPI commands for reading/writing a device that is 64K bytes or smaller are different from those for reading/writing a device that is larger than 64K. From what I've seen, the >64KB devices require three address bytes to be sent. All of the built-in Program Memory accessing code in the VM only sends two address bytes.
Of course, if you connect an additional SPI storage device, you can use SPICmd() to send the proper sequence for addressing >64KB.
| spamiam wrote: | | Can Zbasic handle the memory allocation in EEPROM similar to regular memory? | It does not. You could write a simple heap allocator that allocates from the top of Program Memory downward. |
|