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.
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?
Can you describe what you mean by " want to output a PWM signal with a controlled duty cycle"
Generally, the repetition rate is fixed and you adjust the pwm by adjusting the duty cycle.
Generally, the repetition rate (period) is fixed and you adjust the pwm by adjusting the duty cycle.
Yes, and you adjust the duty cycle using CCRx. If CCRx == CCR0, you lose the ability to adjust the duty cycle.
I think I found confirmation that adjusting the duty cycle is not possible for PWM outputs based on CCR0. In SLAU367P Table 25-6, "Output mode. Modes 2, 3, 6, and 7 are not useful for TAxCCR0 because EQUx = EQU0".
**Attention** This is a public forum