Hi,
I am trying to configure GPIO_SD_B0_05 as PWM1 output, I do not need any interrupts, the pwm frequency should be 80Hz or 1kHz with a duty cycle of 80%.
The configuration that I have are shown below.
PIN config
IOMUXC_SetPinMux(IOMUXC_GPIO_SD_B0_05_FLEXPWM1_PWMB02, 0U);
MODE config
IOMUXC_SetPinConfig(IOMUXC_GPIO_SD_B0_05_FLEXPWM1_PWMB02, 0x10B0U);
PWM Config
pwm_config_t PWM1_UIOreset1_M1_SM2_config =
{
//submodule 2 from PWM1 channel B
.enableDebugMode = true,
.enableWait = true,
.reloadSelect = kPWM_LocalReload,
.faultFilterCount = 0,
.faultFilterPeriod = 0,
.clockSource = kPWM_BusClock,
.prescale = kPWM_Prescale_Divide_128,
.initializationControl = kPWM_Initialize_LocalSync,
.forceTrigger = kPWM_Force_LocalSync,
.reloadFrequency = kPWM_LoadEveryOportunity,
.reloadLogic = kPWM_ReloadImmediate,
.pairOperation = kPWM_Independent,
};
Signal Parameters
pwm_signal_param_t PWM1_UIOreset1_M1_SM2_pwm_function_config =
{
.pwmChannel = kPWM_PwmB,
.dutyCyclePercent = pwm_dutycycle,
.level = kPWM_HighTrue,
.deadtimeValue = 0U,
};
status_t PWM_setup_stat = 0;
PWM_setup_stat = PWM_SetupPwm(PWM1, kPWM_Module_2, &PWM1_UIOreset1_M1_SM2_pwm_function_config, 1U, kPWM_EdgeAligned, 80, 3000000U);
PWM_SetPwmLdok(PWM1, kPWM_Control_Module_2, true);
status_t init_pwm = PWM_Init(PWM1, kPWM_Module_2, &PWM1_UIOreset1_M1_SM2_config);
PWM_StartTimer(PWM1, kPWM_Control_Module_2);
I have debugged and verify the registers values, but still can't get to output the pwm signal from the pin.
Has anyone an idea or is there a configuration that I'm missing?
Thanks!
Hi @pamela_mz,
Thank you so much for your interest in our products and for using our community.
Please check SDK example evkbimxrt1050_pwm, in Config Tools add pin J2 (GPIO_SD_B0_05) as shown below:
Run the example and on pin 2 of the SD Card (SD1_D3) of the MIMXRT1050-EVK you will see the PWM signal you need.
Hope it helps you.
Have a nice day!