I am working on a project that will remain inactive for the majority of the time. For this reason, LPM4 is ideal for the vast majority of time. When the project is active I will have a wheel spinning and for each revolution a capture interrupt will fire. As the wheel spins I will keep track of the speed and if above a certain point will make measurements using an ADC10 peripheral. In order to keep track of time I understand I can no longer be in LMP4. My question has to do with getting out of LPM4 and back into LPM4 once the wheel stops spinning again. I've added my logic below and was hoping someone could verify if it's good idea or not.
1. Enter LMP4 in Main
2. Upon first Capture Interrupt, enter LPM0 in the ISR. Enable compare interrupt on another Timer_A peripheral.
3. Monitor time between capture interrupts with a compare interrupt using a global variable and test the time with an if loop in the compare ISR.
4. If the down time requirement is met, put the MSP430 back into LPM4. If it does not meet the requirement do nothing.
If I am making a novice mistake please let me know
Take care,
Jon