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.
Hi,
i am using the Timer A0 and set a PWM on PIN 2.4
The frequency ist right and everything works fine. Now i want to use PIN 2.5 instead of 2.4 but that doesnt work.
imer_A_PWMConfig pwmConfig =
{
TIMER_A_CLOCKSOURCE_SMCLK,
TIMER_A_CLOCKSOURCE_DIVIDER_1,
24000,
TIMER_A_CAPTURECOMPARE_REGISTER_1,
TIMER_A_OUTPUTMODE_RESET_SET,
12000
};
MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P2, GPIO_PIN5,GPIO_PRIMARY_MODULE_FUNCTION);
MAP_Timer_A_generatePWM(TIMER_A0_BASE, &pwmConfig);
Any idea?
Next question, is it possible to set two PINs for the same PWM? Like if i use PIN 2.4 and PIN 2.5 together?
The Timer A0 can be assigned to this PINS: 7.3, 2.4, 2.5, 2.6, 2.7
Can all output the PWM signal from Timer A0 at the same time too?
I also testet on the "timer_a_pwm_mode" example and set instead of PIN 2.4 the PIN2.5 and the PWM didnt output on the PIN.
I am using the MSP432 Launchpad in RED (Release) and the example was from the MSP432Ware - 3.40.00.25
Is there a Bug on the Software/Hardware from TimerA0?
If a timer module has TA0.0, TA0.1, TA0.2, TA0.3 and TA0.4, you can have four independent hardware PWMs based on the same frequency. CCR0 (TA0.0) sets this frequency. CCR1 (TA0.1), CCR2 (TA0.2), CCR3 (TA0.3) and CCR4 (TA0.4) set the duty-cycle for the PWMs. They can each be different as long as they are within the CCR0 value. Outputting TA0.0 on a pin does not make much sense, only the four PWMs from TA0.1 to TA0.4. The CCR values could be:
Timer clock 10MHz
CCR0 = 1000 for a fixed frequency of 10kHz for all four PWMs
CCR1 = 100 for a duty cycle of 10%
CCR2 = 250 for a duty cycle of 25%
CCR3 = 500 for a duty cycle of 50%
CCR4 = 750 for a duty cycle of 75%
Dennis
Hi Dennis,
thanks for your answer.
So how can i configure all 4 PWMs using driverlib?
Timer_A_PWMConfig pwmConfig =
{
TIMER_A_CLOCKSOURCE_SMCLK,
TIMER_A_CLOCKSOURCE_DIVIDER_1,
1000,
TIMER_A_CAPTURECOMPARE_REGISTER_0, <-----------How do i set all 4 TA0.1/TA0.2/TA0.3/TA0.4 ?
TIMER_A_OUTPUTMODE_SET_RESET,
1000
};
MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P2, GPIO_PIN4,GPIO_PRIMARY_MODULE_FUNCTION);
MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P2, GPIO_PIN5,GPIO_PRIMARY_MODULE_FUNCTION);
MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P2, GPIO_PIN6,GPIO_PRIMARY_MODULE_FUNCTION);
MAP_GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P2, GPIO_PIN7,GPIO_PRIMARY_MODULE_FUNCTION);
MAP_Timer_A_generatePWM(TIMER_A0_MODULE, &pwmConfig);
So the MSP432 can have 4 PWMs Timers TA0.X/TA1.X/TA2.X/TA3.X. Each of those can genarate 4 Outpus with same Frequency and the dulty cycle could be changed. Did i get it right?
Thanks,
Michael
**Attention** This is a public forum