Hello TI Team,
We are using the MSP430F6636 Controller. We are targeting to generate the PWM using Timer-TA2 -on CCR0 (PIN NUM: 47 ). But we weren't able to generate PWM for our Project.
Please verify below snippet code and let us know if we missed something .
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
GPIO_setAsPeripheralModuleFunctionOutputPin( GPIO_PORT_P3, GPIO_PIN5 );
//Update timer parameters to start timer
Timer_A_initUpModeParam initUpParam = {0};
initUpParam.clockSource = TIMER_A_CLOCKSOURCE_SMCLK;
initUpParam.clockSourceDivider = TIMER_A_CLOCKSOURCE_DIVIDER_1;
initUpParam.timerPeriod = SMCLK_ACTUAL_CLK/15000;
initUpParam.timerInterruptEnable_TAIE = TIMER_A_TAIE_INTERRUPT_DISABLE;
initUpParam.captureCompareInterruptEnable_CCR0_CCIE = TIMER_A_CCIE_CCR0_INTERRUPT_DISABLE;
initUpParam.timerClear = TIMER_A_DO_CLEAR;
initUpParam.startTimer = false;
//Initialize compare mode to generate PWM
Timer_A_initCompareModeParam initComp2Param = {0};
initComp2Param.compareRegister = TIMER_A_CAPTURECOMPARE_REGISTER_0;
initComp2Param.compareInterruptEnable = TIMER_A_CAPTURECOMPARE_INTERRUPT_DISABLE;
initComp2Param.compareOutputMode = TIMER_A_OUTPUTMODE_RESET_SET;
initComp2Param.compareValue = RESET;//DUTY_CYCLE2;
Timer_A_initUpMode( TIMER_A2_BASE, &initUpParam );
Timer_A_startCounter( TIMER_A2_BASE, TIMER_A_UP_MODE );
Timer_A_initCompareMode( TIMER_A2_BASE, &initComp2Param );
Timer_A_setCompareValue( TIMER_A2_BASE , TIMER_A_CAPTURECOMPARE_REGISTER_0, 50 );
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Here we are trying to achieve 50% Duty cycle at the moment, but we are not able to achieve so... our target is to achieve 15% Duty cycle.
Kindly please help us to unblock the problem so we can generate PWM on same pin.