Is it possible to clear the Illegal opcode reset flag?

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

Is it possible to clear the Illegal opcode reset flag?

3,432 次查看
Daniel_FE
Contributor I
Hi all:

I want to perform a reset in my routine.
So I choose the illegal opcode reset for my application.

But when my routine occur the reset. The illegal opcde flag can't be clear.

In the MC9S08AW32 datasheet, they don't tell us how to clear the system reset flag.

Does anyone know how to clear the reset flag in our routine?

Thanks.
标签 (1)
0 项奖励
回复
6 回复数

1,737 次查看
Alban
Senior Contributor II
Hi,

I believe that, like on HC08, you simply need to read SRS for its content to be cleared.

That is why I think it it is better to save its content in a variable before doing different tests to learn the cause of the last Reset.

Alban.
0 项奖励
回复

1,737 次查看
Daniel_FE
Contributor I
Hi Alban: I tried it already, when I read the SRS register, it's seem no effect for clearing the reset flag. I use a LED to indicate that illegal opcode reset flag is true or false. But the LED is always on. It's mean that illegal opcode reset flag is always true. I think the HCS08 is different with HC08. Thanks for you reply.
0 项奖励
回复

1,737 次查看
bigmac
Specialist III
Hello,
 
My understanding of the AW60 data sheet is that the SRS register provides the source of the last reset, and would not be updated until the next reset occurs.  To clear the ILOP bit would need a further reset for which the cause was something other than an illegal opcode.
 
Regards,
Mac
 
0 项奖励
回复

1,737 次查看
Alban
Senior Contributor II
Hello Mac,

I checked with confirmed user and software confirms your understanding.

It is an IMPORTANT change from HC08 to S08.
  1. On HC08, the SRSR is cleared when read.
  2. On S08, the SRS is updated on resets only.

Cheers,
Alban.

0 项奖励
回复

1,737 次查看
Daniel_FE
Contributor I
Hi Alban and Mac:

I'm appreciate yours help.

I'll try it tomorrow.

Thanks again.
0 项奖励
回复

1,737 次查看
peg
Senior Contributor IV
Hi Daniel,
 
Another HC08 to S08 difference here is that the S08 will only show the last reset status whereas the reset causes can accumulate in a HC08 if it is not cleared by reading.
 
The S08 can have multiple bits set if multiple sources were present at reset.
 
You only need to check the SRSR on initialisation, reading from it later makes no sense. Also doing it this way, the fact that it is not resettable is irrelevant.
 
0 项奖励
回复