I'm new to the 9S08QE8 MCU and I have a question about timing events.
To save battery power I have the QE8 enter stop3 mode for 1 second and then wake up and check one of it's pins for a high input. If the high input pulse is longer than one second and less than two seconds it looks for two follow-up pulses of less than one second each. If it sees this code it continues on and does the rest of the program. If it doesn't see this code it goes back to sleep for one second and wakes up and checks again.
My question is about the QE8 timers. I'm not sure of how use them to check the duration of the pulses or even if it is better to use the Real Time Clock (RTC) or the Timer and PWM module (TPM) to time the events.
You may say it would be better to wait for the pin to go high and then use an interrupt to wake up the MCU but I don't do that because I use the MCU to (power-up/control) additional circuits to conserve power. The QE8 puts the other circuits to sleep then goes into Stop3 mode. When the QE8 wakes up, it turns the power on to the additional circuits and then looks for the high on the input.
I'm working in assembly but if I need to, I can use C.
I would appreciate any thoughts or guidence.