MC9S08QG8 Timer in Stop Mode

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MC9S08QG8 Timer in Stop Mode

1,181 Views
Rhioponomous
Contributor I

Hi All,
 
Is there a way to enable the timer so it keeps a count while in stop3? I need to maintain a count of the time between triggered ADC interrupts while the MCU is in stop3.  I would very much appreciate any help in this regard as I am very new.


Thanks!

Labels (1)
0 Kudos
Reply
2 Replies

374 Views
bigmac
Specialist III

Hello, and welcome to the forum.

 

You would need to use the RTI module to periodically wakeup the MCU, increment a counter variable in RAM, and then re-enter STOP3 mode.  With this method, the timing resolution will be about 8ms minimum.

 

For timing accuracy, you would need to use an external crystal as the clock source, rather than the internal 1kHz oscillator.  The external clock will need to be enabled during STOP3.

 

Regards,

Mac

 

0 Kudos
Reply

374 Views
oudeis
Contributor I

I'm trying the exact same thing on an MC9S08RD60/MC9S08RG60, but I can't figure out how to enable it. The data sheet says (section 5.7):


When using the external oscillator in stop3 mode, it must be enabled in stop (OSCSTEN = 1) and configured for low bandwidth operation (RANGE = 0)[/quote]


 

But I can't find any reference to OSCSTEN. Currently, my timer is configured to generate an interrupt every 1.11 ms (with 15MHz crysta, RTIS is set to 1:1:0, equalling 'T_ext x 1638'). Do I need to change anything to the timer configuration to keep it running when entering stop3 mode?


Regards,

Ruud

Message Edited by oudeis on 2009-03-24 07:42 AM
0 Kudos
Reply