Quantcast
Channel: Microcontrollers
Viewing all articles
Browse latest Browse all 219073

Forum Post: RE: MSPM0C1104: specific pwm output pins are not output.

$
0
0
Hi Janz, Thanks for reply. they set the Duty and start PWM output with the sw as below. long Sys_AllPwmDuty(uint16_t Duty) { #if defined(DEV_PWM) uint32_t duty_cycle_count; duty_cycle_count = 1000 - (1000*Duty)/100; DL_TimerG_setCaptureCompareValue(PWM_0_INST, duty_cycle_count, DL_TIMER_CC_0_INDEX); DL_TimerG_setCaptureCompareValue(PWM_0_INST, duty_cycle_count, DL_TIMER_CC_1_INDEX); DL_TimerG_setCaptureCompareValue(PWM_0_INST, duty_cycle_count, DL_TIMER_CC_2_INDEX); DL_TimerG_setCaptureCompareValue(PWM_0_INST, duty_cycle_count, DL_TIMER_CC_3_INDEX); DL_TimerA_setCaptureCompareValue(PWM_1_INST, duty_cycle_count, DL_TIMER_CC_0_INDEX); DL_TimerA_setCaptureCompareValue(PWM_1_INST, duty_cycle_count, DL_TIMER_CC_1_INDEX); DL_TimerA_setCaptureCompareValue(PWM_1_INST, duty_cycle_count, DL_TIMER_CC_2_INDEX); #else uint32_t duty_cycle_count; duty_cycle_count = 1000 - (1000*Duty)/100; DL_TimerG_setCaptureCompareValue(PWM_0_INST, duty_cycle_count, DL_TIMER_CC_0_INDEX); #endif return E_OK; } /******************************************************************************* * Function Name : Sys_PwmStart * Description : Start PWM Timer * Input : None * Output : None * Return : ERROR/OK *******************************************************************************/ long Sys_PwmStart(void) { #if defined(DEV_PWM) DL_TimerG_startCounter(PWM_0_INST); DL_TimerA_startCounter(PWM_1_INST); #else DL_TimerG_startCounter(PWM_0_INST); #endif return E_OK; } Another PWM channels output normally, but only PA24 and PA25 pins do not work. We will follow your guide and ask you a question again. thanks B.R

Viewing all articles
Browse latest Browse all 219073

Trending Articles