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.

MSP432E401Y: How long after setting TAxCTL.MC does a TimerA peripheral start counting?

Part Number: MSP432E401Y


Tool/software:

Hi all,

I'm using an MSP432P4111.

I have a TimerA peripheral configured to use SMCLK (with MCLK coming from DCO) and to count at 1kHz.  This peripheral is one of the first things I setup as the micro starts up because I want to use this as a fairly accurate (say within 10-20mSec) time since startup count. 

In order to use the timer for this purpose I need to know how long after setting TAxCTL.MC (to 10b for continuous mode) would I expect counting to begin?

My measurements seem to show the timer doesn't start immediately, but rather takes around 65mSec to start up.  This was a surprise so I started looking for a spec in the technical reference and datasheet but I can't find one.  Is there a specification for this?  What sort of tolerance can I expect?

The technical reference says is that "The timer counts when MC > { 0 } and the clock source is active".  I have to imagine the clock source for this timer IS active given that the source is SMCLK which comes from MCLK which is running the micro.  I think MC refers to TAxCTL.MC.

Thank you for you help

Julian

  • I'm pretty sure it starts up within 1 (SMCLK) tick (~333ns). The first tick would happen at ~(333ns*ID*(TAnEX0+1)). TimerA is 16-bit, so it can only count up to 65535.

    The "clock source is active" phrase is primarily a reference to clocks being switched off in LPM. MCLK and SMCLK are active after reset [Ref TRM (SLAU356I) Sec 6.2].

    How are you measuring?

  • I'm monitoring two pins with an oscilloscope.

    • The first pin goes immediately after I set TAxCTL.MC = 10b
    • Second pin toggles every time I hit the timerA interrupt (HWI) giving a 500Hz square wave.

    There is about 65mSec between the first pin going high, and the first toggle of the the second pin. 

  • Ah, I found it! 

    I hadn't setup the capture compare register at initialization so it runs for a full 65.536mSec the first time, then starts the 1kHz operation when the HWI finally sets the capture compare register properly.  Thank you for your time!.