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
System Reset cause-codes - how-to?

 
Post new topic   Reply to topic    Forum Index -> ZBasic Language
Author Message
stevech



Joined: 23 Feb 2006
Posts: 657

Posted: 10 March 2006, 3:54 AM    Post subject: System Reset cause-codes - how-to? Reply with quote

what am I as a noob doing wrong here?
This code prints out zero, as does a power-on reset.

Code:

sub main()   
   console.writeline ("Reset cause: " & cstr(Register.ResetFlags) )
   OpenWatchDog(6) ' arg is 16.384 mSec x 2 to the nth power, n=parameter value
end sub
Back to top
mikep



Joined: 24 Sep 2005
Posts: 765
Location: Austin, TX

Posted: 10 March 2006, 5:02 AM    Post subject: Reply with quote

Yes there seems to be a problem here.

If you replace Register.ResetFlags by Register.MCUCSR, I think you achieve the same result. I get a 0x1 for power on, 0x11 for external reset and 0x1011 for the watchdog.
Back to top
stevech



Joined: 23 Feb 2006
Posts: 657

Posted: 10 March 2006, 17:35 PM    Post subject: Reply with quote

OK.
Minor problem.
Back to top
dkinzer
Site Admin


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

Posted: 19 March 2006, 19:38 PM    Post subject: Reply with quote

A Firmware Update has been posted that resolves this problem.

It should be noted that at boot time, the reset flags in the MCUCSR register will be copied to Register.ResetFlags and then the reset flags are cleared from MCUCSR. This strategy is necessary since the existing reset flags are not cleared when the processor resets.
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