Ram Data after MCU Reset

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Ram Data after MCU Reset

2,972 Views
bobkang
Contributor II

Hi, I'm using MC68HC908AP64.My question is, is the RAM data will be cleared to 0 after MCU Reset from watchdog or RAM can memorize the data value after MCU reset?

Labels (1)
0 Kudos
Reply
3 Replies

1,582 Views
donw
Contributor IV

I don't know that micro variant, but typically the Ram memory is not affected by a reset.

Only a low supply voltage will corrupt it.

don

 

0 Kudos
Reply

1,582 Views
bobkang
Contributor II

Thx a lot!:smileyhappy:

And if I declare a variable without initialization. In the program,the value of this variable is set to 0 by default or it will be assigned to a random value?

0 Kudos
Reply

1,582 Views
bigmac
Specialist III

Hello,

 

After a POR or LVD reset, the state of each RAM location will be undefined.  After other types of reset, the RAM will retain the state that existed prior to the reset.  This is what the hardware does.

 

Following any type of reset, what then happens will depend on whether ANSI initialisation was enabled or disabled when the project was first created.  If enabled, the global and static variables will be initialised within a "copydown" process.  Any variables that do not have an explicit initialisation value will be zeroed.  This does not apply to any local variables which reside on the stack.

 

If ANSI initialisation was disabled, the copydown process does not occur, so all variables will remain undefined, even if explicitly initialised in the variable defininition.  In this case, you would need to assign a value to each variable when it is first used.

 

Regards,

Mac

 

0 Kudos
Reply