Hello,
I am using TimerA0 on an 'F5659 to generate a 50% PWM output signal using the output unit. This is desirable because we need minimum jitter on the output. That part has been working fine.
Recently, however, we began wanting some additional timer interrupts.
I began trying to enable interrupts on TimerA0 to use the ISRs. However, when I enable interrupts on TimerA0, the chip seems to freeze.
It seems as though I cannot use the output unit of a Timer and at the same time use the interrupts on that same timer. Does anyone have any insight as to why that is? I have read and re-read the User Guide and cannot see why I can't.
Here is the code snippet that sets up the Timer:
//this will put 120Hz on P1.2
TIMER_A_stop (__MSP430_BASEADDRESS_T0A5__);
TIMER_A_clear (__MSP430_BASEADDRESS_T0A5__);
TIMER_A_clearTimerInterruptFlag (__MSP430_BASEADDRESS_T0A5__);
TIMER_A_generatePWM ( __MSP430_BASEADDRESS_T0A5__,
TIMER_A_CLOCKSOURCE_SMCLK, //20MHz
TIMER_A_CLOCKSOURCE_DIVIDER_64,
1302,
TIMER_A_CAPTURECOMPARE_REGISTER_1,
TIMER_A_OUTPUTMODE_TOGGLE,
50
);
// TIMER_A_enableInterrupt(__MSP430_BASEADDRESS_T0A5__);
// TIMER_A_enableCaptureCompareInterrupt(__MSP430_BASEADDRESS_T0A5__,
// TIMER_A_CAPTURECOMPARE_REGISTER_1
As you can see, I have tried both interrupts, but both lock up the chip in the same way.
Any guidance would be greatly appreciated.