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.

Grace 3.10.0.82 BUG for MSP430FR5969

Hello,

Grace does not generate code for "Interrupt Vector List"-->"Timer0_A3 CCR1-2"-->"CCIE.1" and "CCIE.1" checkboxes. You can see it on the pictures below.

  • Hi E.K.,

    Only Timer0_A3 CCR0 is used in Interval Mode.

    Timer0_A3 CCR1 and CCR2 are only used in PWM Mode and Capture Mode.

    Enabling "Timer0_A3 CCR1-2"-->"CCIE.1" and "CCIE.1" doesn't have any effect if PWM outputs or Capture inputs are not set.

    The MSP430FR58xx, MSP430FR59xx, MSP430FR68xx, and MSP430FR69xx Family User's Guide describes Timer_A operation and which CCRs are used in which modes.

    Let me know if you need more info on Timer_A.

    Regards,

    Joe

  • Hello and thank you for your answer,

    but I think this is not true. According to the documentation CCR1 and CCR2 are allowed in Interval mode - for example "16.2.3.3 Use of Continuous Mode". Here is another document describing the benefits of the rest CCRx registers - Multiple Time Bases on a Single MSP430™ Timer Module.

    I've prepared a simple test code which demonstrate the usefulness of CCR1 and CCR2 in Up Mode. The code generates three frequencies which are out of phase by a fixed amount. The first is the main frequency, the second is out of phase by 76%(-43.2°) and the third is out of phase by 12%(-158.4°). This is easily seen on an oscilloscope.

    Please, let me know what you think.

    #include "driverlib.h"
    
    #pragma vector=TIMER0_A0_VECTOR
    __interrupt void TIMER0_A0_ISR_HOOK(void)
    {
    		P1OUT ^=  BIT3;
    }
    
    #pragma vector=TIMER0_A1_VECTOR
    __interrupt void TIMER0_A1_ISR_HOOK(void)
    {
    	switch (_even_in_range(TA0IV, TA0IV_TACCR2))
    	{
    		case TA0IV_TACCR1:
    			P1OUT ^=  BIT4;
    break; case TA0IV_TACCR2: P1OUT ^= BIT5; break; } } int main(void) { WDT_A_hold(WDT_A_BASE); PMM_unlockLPM5(); P1DIR = BIT3 | BIT4 | BIT5; CS_initClockSignal(CS_MCLK, CS_DCOCLK_SELECT, CS_CLOCK_DIVIDER_1); CS_initClockSignal(CS_SMCLK, CS_DCOCLK_SELECT, CS_CLOCK_DIVIDER_8); CS_initClockSignal(CS_ACLK, CS_VLOCLK_SELECT, CS_CLOCK_DIVIDER_1); CS_setDCOFreq(CS_DCORSEL_0, CS_DCOFSEL_6); CS_clearAllOscFlagsWithTimeout(100000); CS_disableClockRequest(CS_MCLK); CS_disableClockRequest(CS_SMCLK); CS_disableClockRequest(CS_ACLK); Timer_A_initUpModeParam initUpParam = { 0 }; initUpParam.clockSource = TIMER_A_CLOCKSOURCE_ACLK; initUpParam.clockSourceDivider = TIMER_A_CLOCKSOURCE_DIVIDER_1; initUpParam.timerInterruptEnable_TAIE = TIMER_A_TAIE_INTERRUPT_DISABLE; initUpParam.timerClear = TIMER_A_SKIP_CLEAR; initUpParam.startTimer = false; Timer_A_initUpMode(TIMER_A0_BASE, &initUpParam); Timer_A_enableCaptureCompareInterrupt(TIMER_A0_BASE, TIMER_A_CAPTURECOMPARE_REGISTER_0); Timer_A_enableCaptureCompareInterrupt(TIMER_A0_BASE, TIMER_A_CAPTURECOMPARE_REGISTER_1); Timer_A_enableCaptureCompareInterrupt(TIMER_A0_BASE, TIMER_A_CAPTURECOMPARE_REGISTER_2); Timer_A_setCompareValue(TIMER_A0_BASE, TIMER_A_CAPTURECOMPARE_REGISTER_0, 100); Timer_A_setCompareValue(TIMER_A0_BASE, TIMER_A_CAPTURECOMPARE_REGISTER_1, 76); Timer_A_setCompareValue(TIMER_A0_BASE, TIMER_A_CAPTURECOMPARE_REGISTER_2, 12); Timer_A_startCounter(TIMER_A0_BASE, TIMER_A_UP_MODE); __bis_SR_register(GIE); while (1) { } }

    This is the 12% frequency.

    This is the 76% frequency.

  • Hi,

    According to the MSP430FR5969 datasheet, TA0.TAIFG, TA0CCR1.CCIFG and TA0CCR2.CCIFG share the one interrupt vector. So you can enable TAIE checkbox to generate the interrupt handler to handle all those three interrupt flags. 

    Thanks,

    Yang

**Attention** This is a public forum