Forum Index
HomeZBasic Home   Forum RulesForum Rules   Forum FAQForum FAQ   MemberlistMemberlist   UsergroupsUsergroups   RSS FeedRSS Feed
Site SearchSite Search   LinksLinks   DownloadDownload   Digests and SubscriptionsDigests and Subscriptions
ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in   RegisterRegister
location of the top of the program in EEPROM

 
Post new topic   Reply to topic    Forum Index -> ZBasic Language
Author Message
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 Reply with quote

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
Back to top
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 Reply with quote

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.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Forum Index -> ZBasic Language Time synchro. with the server - Timezone/DST with your computer
Page 1 of 1

 


All content Copyright © 2005-2012 Elba Corp. All Rights Reserved.
Opinions expressed in posts are those of the author and not necessarily those of Elba Corp.
Powered by phpBB © 2001, 2005 phpBB Group