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.
Part Number: MSP432P401R
G'Day,
Is there any reason a Timer32 module would occasionally give two interrupts in very short order (a few 10s of uSec apart)?
I'm using SimpleLink 1.4 (yet to move up to v1.6) and I set up the Timer32 module as described by the code fragment below (I'm basically setting it up to give me an interrupt every 10mSec)
uint32_t tickCnt = 0; void timer32_hwi(uintptr_t arg) { MAP_Timer32_clearInterruptFlag(TIMER_1_BASE); tickCnt++; } void timer32_init(void) { // Setup a HWI for the Timer32 module Hwi_Handle hndl; Hwi_Params params; Hwi_Params_init(¶ms); params.priority = 0xe0; hndl = Hwi_create(INT_T32_INT2, timer32_hwi, ¶ms, NULL); // Setup Timer32 Module - not aware of a SimpleLink driver for Timer32, so use driverlib MAP_Timer32_haltTimer(TIMER_1_BASE); MAP_Timer32_initModule(TIMER_1_BASE, TIMER32_PRESCALER_1, TIMER32_32BIT, TIMER32_PERIODIC_MODE); MAP_Timer32_setCount(TIMER_1_BASE, 480000); MAP_Timer32_clearInterruptFlag(TIMER_1_BASE); MAP_Timer32_enableInterrupt(TIMER_1_BASE); MAP_Timer32_startTimer(TIMER_1_BASE, false); tickCnt = 0; }
Sorry, typo. Should be TIMER32_1_BASE.
The example you sent through confused me.
At first glance I thought the example was using the ti.sysbios.family.arm.msp432 API (which I've used quite a bit) but something was off.
The Sysbios API has functions/typedefs like Timer_Handle, Timer_Params, Timer_Params_init() (which I see in the example), but not calls like Timer_open() (which also appear in the example)
It turns out that the Sysbios ti.sysbios.family.arm.msp432 API and the SimpleLink Timer.h API share a bunch of Typedef and function names. Both APIs implement the items behind those shared names differently. This seems a bit evil.
The reason I though I was getting Timer32 interrupts very close together is the following RTOS Analyzer Execuction Graph
Hwi.timer32D_HWI_module_epochCtr() is the HWI for Timer32 TIMER32_1_BASE
Yesterday I was seeing things like the above trace fairly often.
I'm not sure what has changed, but today I don't see interrupts so close together, but I AM still seeing interrupts less than 10mSec apart.
I modified my HWI as follows so that I can detect when interrupts happen too close together.
static uint32_t syst = 0; uint32_t tDiff; tDiff = syst - MAP_SysTick_getValue(); syst = MAP_SysTick_getValue(); if (tDiff < 400000) // 480000 is 10mSec..... { __nop(); } MAP_Timer32_clearInterruptFlag(TIMER32_MODULE_EPOCHCTR); g_timer32_epochCnt_u64++; g_timer32_freeCnt_u32++;
If put a breakpointon the __nop(), every few seconds (its pretty random) exeuction stops at the breakpoint with tDiff varying all over the place (rom about 10,000 to over 300,000)
Screen shot below show registers when stopped at the __nop();
**Attention** This is a public forum