|
|
| Author |
Message |
DH* Guest
|
|
Posted: 14 July 2006, 12:38 PM Post subject: Register.ResetFlags anomaly |
|
|
| 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: |
|
|
| 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: |
|
|
| 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: |
|
|
| 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: |
|
|
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: |
|
|
| 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 |
|
 |
|