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
Register.ResetFlags anomaly

 
Post new topic   Reply to topic    Forum Index -> ZBasic Language
Author Message
DH*
Guest





Posted: 14 July 2006, 12:38 PM    Post subject: Register.ResetFlags anomaly Reply with quote

I am seeing Register.ResetFlags = 5 at power on. (ZX-40)
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Posts: 2593
Location: Portland, OR

Posted: 14 July 2006, 15:11 PM    Post subject: Reply with quote

That value includes Brown-out Reset (&H04) and Power On Reset (&H01). Depending on the characteristics of your power source, that may reflect reality. It may be best to code your application to give POR the highest precedence, ignoring the presence of other bits.
Back to top
DH*
Guest





Posted: 14 July 2006, 15:39 PM    Post subject: Reply with quote

dkinzer wrote:
That value includes Brown-out Reset (&H04) and Power On Reset (&H01).
I figured that was what it meant and have coded accordingly but I think the manual should reflect that multiple bits may be set.

I'm using a switchmode +5V supply plugged into a powerstrip that has a switch. I see 5 when I use the switch and 1 if I plug the already on PS into my board so it does reflect reality.

Do RAM variables survive a WDT reset?
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Posts: 2593
Location: Portland, OR

Posted: 14 July 2006, 15:53 PM    Post subject: Reply with quote

Quote:
Do RAM variables survive a WDT reset?

No. Statically allocated variables (defined at the module-level or defined within a procedure with the Static modifier) are initialized to zero when the program begins running. Dynamically allocated variables (defined within a procedure without the Static modifier) are uninitialized except for string variables but you can count on their having any particular value.
Back to top
DH*
Guest





Posted: 14 July 2006, 16:26 PM    Post subject: Reply with quote

For troubleshooting purposes it would be handy to have a user writable memory byte that survives resets. I can use EEPROM but aesthetically I like the idea of it being a register type of variable.

I assume you mistyped
Quote:
but you can count on their having any particular value
.
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Posts: 2593
Location: Portland, OR

Posted: 15 July 2006, 14:58 PM    Post subject: Reply with quote

dhouston wrote:
I assume you mistyped
Quote:
but you can count on their having any particular value
.

Indeed. The not is missing.
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