HCS08 and stop3 mode

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
1,308件の閲覧回数
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 解決策
907件の閲覧回数
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 返答(返信)
908件の閲覧回数
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 件の賞賛
返信
907件の閲覧回数
zorrotz
Contributor III

Hello,

 

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

 

Thank you. 

0 件の賞賛
返信