Part Number: MSP430FR5969
Hello:
I was using the following code to generate a PWM signal using P1.2 and it all works fine.
/* Ensure the timer is stopped. */
TA1CTL = 0;
/* Start up clean. */
TA1CTL |= TACLR;
// "Connect" PA1.2 to the output of the A1 Timer
GPIO_setAsPeripheralModuleFunctionOutputPin(
GPIO_PORT_P1,
GPIO_PIN2, // TA1.1
GPIO_PRIMARY_MODULE_FUNCTION
);
// we start with interrupts DISABLED, we will only enable interrupts if/when we need to change the duty cycle
TA1CCTL1 = OUTMOD_7 ; // Counter 1 is to be used, program for set/reset output mode, interrupt DISABLED on count expiration
TA1CCR0 = period; // counter 0 will always have the period. Period is always fixed to 800
TA1CCR1 = dutyCycle; // counter 1 is the duty cycle; Duty cycle starts at 1, but may change. When it changes, we enable interrupts so that we can set the value once the interrupt fires
// Interrupts disabled. Clock source = 8Mhz. Running from ACLK, which is set as 8Mhz
TA1CTL = TASSEL_2 | ID__1 | MC__UP; // Set up for up Mode, Interrupts disabled.
With the above code, the PWM signal is generated correctly out of the P1.2 pin.
Now I need to change the above code so that the same PWM signal is generated from Pin 1.3 instead. What would the equivalent code be? I have tried changing all TA1 statements in the above code to TA2, as well as setting up P1.3 with the Primary function, but I am not getting the signal out of P1.3. Any help would be appreciated. Thx.
