Part Number: MSP430F5438A
Hi
I have a custom board where some of the 5438A Rev F MCUs Timer A TA0R some times (It works just fine maybe 99 times out of 100 Timer A starts) never starts and when I halt the CPU MC is MC_2 and TASSEL is TASSEL_1 (ACLK).
volatile unsigned char g_bWaitForDelay = 0;
#pragma vector=TIMER0_A0_VECTOR
__interrupt void TIMERA0_A0_ISR(void)
{
g_bWaitForDelay = 0;
__low_power_mode_off_on_exit();
}
Before starting Timer A I have verified that it isn't running (i.e. MC == 0)
unsigned short delay = 0x140; //LPM for 10 ms with ACLK at 32kHz
g_bWaitForDelay = 1;
Timer_A_clearCaptureCompareInterrupt(TIMER_A0_BASE, TIMER_A_CAPTURECOMPARE_REGISTER_0);
Timer_A_enableCaptureCompareInterrupt(TIMER_A0_BASE, TIMER_A_CAPTURECOMPARE_REGISTER_0);
Timer_A_setCompareValue(TIMER_A0_BASE, TIMER_A_CAPTURECOMPARE_REGISTER_0, delay);
Timer_A_initContinuousModeParam param;
param.clockSource = TIMER_A_CLOCKSOURCE_ACLK;
param.clockSourceDivider = TIMER_A_CLOCKSOURCE_DIVIDER_1;
param.startTimer = true;
param.timerClear = TIMER_A_DO_CLEAR;
param.timerInterruptEnable_TAIE = TIMER_A_TAIE_INTERRUPT_DISABLE;
Timer_A_initContinuousMode(TIMER_A0_BASE, ¶m);
At this point I do a
while(g_bWaitForDelay)
{
__bis_SR_register( LPM0_bits + GIE );
}
To save power during the wait.
At this point my application some times get stuck since TA0R is stuck at 0x0000 and I'm waiting for the interrupt at TA0CCR0. (I have at this point tried to get the TA0R to run again by using the debugger and switching MC to MC_0, resume execution, and then put it back to MC_2 but TA0R is still stuck at 0x0000)
I'm just showing the code related to Timer A (Unfortunately I have not been able create a small sample project that gives the same problem so there might be something else causing this that I don’t understand).
Note that this only happens on some of the boards with 5438A’s.
What am I doing wrong on the failing 5438A’s?