2024-08-02 07:28 AM
Dear All,
I am attempting to migrate a project from a STM32F74NGH MCU to a STM32U599NJH MCU.
In the F7 MCU I am applying the PWM on CH1 of TIM3 that corresponds to pin PB4.
On the new setup I need to apply the PWM to pin PC5, which corresponds to TIM1, CH4N.
I am a bit confused on what exactly does the N mean in CH4N. So far I have not been able to drive my device as expected using the PWM. If I set PC5 to output and set it properly then my external device is operating as expecting for a 100% dutycycle.
In my old project the Internal Clock was set to 200MHz and this is the configuration of timer 3:
Initing PWM is done like this:
HAL_TIM_PWM_Start(&htim3, TIM_CHANNEL_1);
Changing the dutycycle:
__HAL_TIM_SET_COMPARE(&htim3, TIM_CHANNEL_1, value);
where the value is between 0 and 100.
In my new project the clock is running at 160MHz.
My CubeMX configuration looks like this:
The rest for now remains the same except that I am using TIM1 and TIM_CHANNEL_4 for init an changing the dutycycle, but I do not see any response from the device.
Thank you very much for any ideas or assistance
Solved! Go to Solution.
2024-08-02 07:50 AM - edited 2024-08-02 07:51 AM
To start channel 4N, you use HAL_TIMEx_PWMN_Start.
Channel 4N is usually the reverse polarity of channel 4, but the details are more complicated.
2024-08-02 07:50 AM - edited 2024-08-02 07:51 AM
To start channel 4N, you use HAL_TIMEx_PWMN_Start.
Channel 4N is usually the reverse polarity of channel 4, but the details are more complicated.