Ram Data after MCU Reset

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Ram Data after MCU Reset

3,014 次查看
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?

标签 (1)
0 项奖励
回复
3 回复数

1,624 次查看
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 项奖励
回复

1,624 次查看
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 项奖励
回复

1,624 次查看
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 项奖励
回复