This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

counting external events in low-power mode

Other Parts Discussed in Thread: CC430F5125

I have an application where I need to count external pulses while the MSP430 is in low-power mode.  Specifically, I wish to use a CC430 part (e.g. CC430F5125) and put it in low power mode 4 with a periodic wakeup from the WDT, having only the VLO clock enabled.  I can program a Timer_A to count an external TACLK, but my question is, will it continue to count TACLK in low power mode 4?  Or does the Timer_A require at least one internal clock to function?  If it won't count in LPM4, what is the lowest-power mode that will support Timer_A counting an external clock signal?  I've looked in the data sheet, users guide, and application notes, and I haven't found an answer to this question.

Second question: if Timer_A will count in low power mode, can a timer overflow interrupt wake up the CPU? 

  • Brad Rodriguez said:
    I can program a Timer_A to count an external TACLK, but my question is, will it continue to count TACLK in low power mode 4?

    Yes. The LPMs will deactivate the internal clocks. And since power consumption of CMOS devices mainly consists of changes, this puts all in low power. However, if you have an external clock (your events) the hardware will still continue. And (of course) each event that is counted will cause a (minimal) peak in supply current. Just as if the signal had come from an internal clock.

    Brad Rodriguez said:
    if Timer_A will count in low power mode, can a timer overflow interrupt wake up the CPU? 

    Yes. The overflow and also the capture and compare interrupts still work in LPM. However, waking the CPU takes some time (see datasheet for wakeup times) and bringing up the crystals (if you need them) will take even more time (in the meantime the CPU will run from DCO)

    Keep in mind that when clockign the tiemr from external signal, tiemr counts and timer register read are not synchronized. This means that when you read the timer count register at the very same tome of an external clock impulse, readings can be wrong. You can loop until two subsequent readings are identical, or make a majority vote of three readings. However, this only ensures proper results if MCLK is significantly faster than the external clock frequency. Well, if you got the interrupt by overflow, you know the timer value at the moment of interrupt: zero :)

**Attention** This is a public forum