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.

MSP430F5438A: Cannot generate PWM using A0 timers.

Part Number: MSP430F5438A

I need to implement a PWM on the MSP430F5438A to support a backlit device.  The device is connected to pin 1.1

I found an example that provided a method to setup Timer A0 0 and Timer A0 1 to produce a PWM.

Below is the code:

P1DIR |= BIT1; //Set pin 1.1 to the output direction.
P1SEL |= BIT1; //Select pin 1.1 as our PWM output.
TA0CCR0 = 1000; //Set the period in the Timer A0 Capture/Compare 0 register to 1000 us.
TA0CCTL1 = OUTMOD_7;
TA0CCR1 = 500; //The period in microseconds that the power is ON. It's half the time, which translates to a 50% duty cycle.
TA0CTL = TASSEL_2 + MC_1; //TASSEL_2 selects SMCLK as the clock source, and MC_1 tells it to count up to the value in TA0CCR0.

When executed there was no output on the gpio.

I verified that I could get the A0  0 timer routed to the P1.1 with the code below.:

P1DIR |= BIT1; //Set pin 1.1 to the output direction.
P1SEL |= BIT1; //Select pin 1.1 as our PWM output.
TA0CCR0 = 1*MS_10_TICK; // time is approx 10 msec
TA0CCTL0 = OUTMOD_7;
TA0CTL = TASSEL_2 + MC_1; // SMCLK, upmode

The same implementation does not work using A0 1:

P1DIR |= BIT1; //Set pin 1.1 to the output direction.
P1SEL |= BIT1; //Select pin 1.1 as our PWM output.
TA0CCR1 = 1*MS_10_TICK; // time is approx 10 msec
TA0CCTL1 = OUTMOD_7;
TA0CTL = TASSEL_2 + MC_1; // SMCLK, upmode

Is there some type of mapping that prevents using A0 1?

An alternative would be to use 2 separate interrupts to produce the PWM.  Unfortunately, I may be restricted to A0.  I can generate interrupts,.int54, using A0 0:

P1DIR |= BIT1; //Set pin 1.1 to the output direction.
TA0CCTL0 = CCIE; // CCR0 interrupt enabled
TA0CCR0 = 1*MS_10_TICK; // time is approx 10 msec
TA0CTL = TASSEL_2 + MC_1; // SMCLK, upmode

But do not see them on int53 using the following:

P1DIR |= BIT1; //Set pin 1.1 to the output direction.
TA0CCTL1 = CCIE; // CCR1 interrupt enabled
TA0CCR1 = 1*MS_10_TICK; // time is approx 10 msec
TA0CTL = TASSEL_2 + MC_1; // SMCLK, upmode

Timer A0 1 does not seem to be enable?

I read in other threads that there are device specific restrictions on how the timers can be configured.  Not sure if this is the issue or not.  Any assistance would be helpful.

-Steve

**Attention** This is a public forum