HCS08 and stop3 mode

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

HCS08 and stop3 mode

跳至解决方案
1,298 次查看
zorrotz
Contributor III

Hi,

 

I have a problem with the stop3 mode in MC9S08SH16.

After executing the STOP instruction the MCU enters in stop3 mode, but sometimes stop3 is exited when MTIM (modulo timer) interrupt occurs.

The datasheet doesn't say that MTIM interrupt is a source to exit from stop3 mode, but I have checked that it is.

The STOP instruction first enables the interrupts (the I bit in the condition code register (CCR) is cleared to

enable interrupts) and then inhibits the oscillator to put MCU into the stop condition.

My question is: if the MTIM interrupt takes place between the two steps of the STOP instruction, that is, MTIM interrupt takes place after the STOP instruction enables the interrupts but before the oscillator is inhibited, the MCU doesn't enter in stop3 mode?

 

Thanks in advance.

标签 (1)
0 项奖励
回复
1 解答
897 次查看
bigmac
Specialist III

Hello,

 

Did you try explicitly stopping the MTIM counter prior to executing the STOP instruction.  This can be accomplished with MTIMSC_TSTP = 1;

 

This would then be re-enabled on exit from stop 3 mode.

 

Regards,

Mac

 

在原帖中查看解决方案

0 项奖励
回复
2 回复数
898 次查看
bigmac
Specialist III

Hello,

 

Did you try explicitly stopping the MTIM counter prior to executing the STOP instruction.  This can be accomplished with MTIMSC_TSTP = 1;

 

This would then be re-enabled on exit from stop 3 mode.

 

Regards,

Mac

 

0 项奖励
回复
897 次查看
zorrotz
Contributor III

Hello,

 

Yes I tried. Stopping the MTIM or disabling MTIM interrupt works.

 

Thank you. 

0 项奖励
回复