Hi !
I need to use PWM of STM32F4, mode Channel N,
ex : PWM_TIM1_Start(_PWM_CHANNEL1, &_GPIO_MODULE_TIM1_CH1N_PE8); // setup channel N
But Mikroc don't support !
Can you help me !
Thanks!
PWM Channel N
- filip.grujcic
- Posts: 822
- Joined: 14 May 2018 08:34
Re: PWM Channel N
Hi !
I used STM32F407VGT6,
Mikroc can't creat a PWM channel N,
PWM_TIM1_Start(_PWM_CHANNEL1, &_GPIO_MODULE_TIM1_CH1N_PA7); // note CH1N
Thanks !
Re: PWM Channel N
Hi All !
Can anyone help me?
Thanks!
Can anyone help me?
Thanks!
- filip.grujcic
- Posts: 822
- Joined: 14 May 2018 08:34
Re: PWM Channel N
Hello,
In this case, add TIM1_CCER.B2 = 1; before your PWM_TIM1_Start(_PWM_CHANNEL1, &_GPIO_MODULE_TIM1_CH1N_PA7);
Also, I assume you added the _GPIO_MODULE_TIM1_CH1N_PA7 structure yourself? In case this doesn't work, please zip and attach your __Lib_GPIO_32F4xx_Defs.c file for inspection. It's located in:
C:\Users\Public\Documents\Mikroelektronika\mikroC PRO for ARM\Uses\ST M4
Regards,
You have to enable the CCxNE bit in the TIMx_CCER register prior to calling the PWM_TIMx_Start() function.
In this case, add TIM1_CCER.B2 = 1; before your PWM_TIM1_Start(_PWM_CHANNEL1, &_GPIO_MODULE_TIM1_CH1N_PA7);
Also, I assume you added the _GPIO_MODULE_TIM1_CH1N_PA7 structure yourself? In case this doesn't work, please zip and attach your __Lib_GPIO_32F4xx_Defs.c file for inspection. It's located in:
C:\Users\Public\Documents\Mikroelektronika\mikroC PRO for ARM\Uses\ST M4
Regards,
Filip Grujcic
Re: PWM Channel N
Thank you so much !
It works very well !
Regards !
It works very well !
Regards !
filip.grujcic wrote: ↑03 Feb 2021 15:20Hello,
You have to enable the CCxNE bit in the TIMx_CCER register prior to calling the PWM_TIMx_Start() function.
In this case, add TIM1_CCER.B2 = 1; before your PWM_TIM1_Start(_PWM_CHANNEL1, &_GPIO_MODULE_TIM1_CH1N_PA7);
Also, I assume you added the _GPIO_MODULE_TIM1_CH1N_PA7 structure yourself? In case this doesn't work, please zip and attach your __Lib_GPIO_32F4xx_Defs.c file for inspection. It's located in:
C:\Users\Public\Documents\Mikroelektronika\mikroC PRO for ARM\Uses\ST M4
Regards,