Ram Data after MCU Reset

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Ram Data after MCU Reset

3,032件の閲覧回数
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,642件の閲覧回数
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,642件の閲覧回数
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,642件の閲覧回数
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 件の賞賛
返信