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.

MSP432P401R: Timer32 reports unexpectedly large delay

Part Number: MSP432P401R

I'm getting an unexpectedly large value for a duration measurement using the Timer32 module on the MSP432P4111.  The code snippet is below:

//------------------------------------------------------------------------------
// Timer32 Setup
//--------------------------------------------------
// Init Timer32 to MCLK div 1 tick, 32bit count, starts at UINT32_MAX and
// counts down to zero, then rolls over and repeats
MAP_Timer32_initModule(TIMER32_BASE, TIMER32_PRESCALER_1, TIMER32_32BIT,
TIMER32_FREE_RUN_MODE);

MAP_Timer32_startTimer(TIMER32_BASE, true);
//---------------------------------------------------------------------------
startValue = MAP_Timer32_getValue(TIMER32_BASE);
__delay_cycles(5000);
endValue = MAP_Timer32_getValue(TIMER32_BASE);
duration = startValue - endValue; // Reversed since Timer32 is count-Down
while(1);

Note that I'm using an explicit 5000-cycle delay, and I have Timer32 configured for a 1x prescalar, which means that the timer should operate at the MCLK speed. I would expect to get a measurement very close to 5000 cycles, yet the value I get back is duration=6695.

Is there anything obviously wrong here?.

Bob

**Attention** This is a public forum