Tool/software:
I want to output a PWM signal with a controlled duty cycle on P2.4.
I can control the duty cycle when the module block is any non-zero CCR. For example P1.2 using CCR1.
P1DIR |= BIT2;
P1SEL0 |= BIT2;
P1SEL1 &= ~BIT2;
TA1CCR0 = 1000 - 1;
TA1CCTL1 = OUTMOD_7;
TA1CCR1 = 500;
TA1CTL = TASSEL_2 | MC_1;
It is obvious from the logic below that we cannot use the same workflow when the Module Block is 0 (Datasheet Table 6-14). CCR0 is being used to set both the duty cycle and period.
P1DIR |= BIT7;
P1SEL0 |= BIT7;
P1SEL1 |= BIT7;
TA1CCR0 = 1000 - 1;
TA1CCTL0 = OUTMOD_7;
TA1CCR0 = 500;
TA1CTL = TASSEL_2 | MC_1;
I want to output a PWM signal with a controlled duty cycle on P2.4. Perhaps it is possible to use a different CCR for setting the period?