2016-07-02 04:09 PM
2016-07-02 06:38 PM
It is unfortunate that the comments are not coherent with what you are doing.
So which pins do you plan on using? PA8 and PB13? Do you enable the clocks for those GPIO Banks? Does Cube/HAL require you to enable the PWM outputs on TIM1, and for the channel pins explicitly?2016-07-04 08:22 AM
Hi Clive1,
Yes I enabled clock for all the PORTs for now. I tried both alternative pin options for CH1 CH1N. PE8-PE9 combination and after that PA8-PB13. In both case the CH1N is not performing PWM action. If I modify the polarity option etc, then I can see the default level of CH1N also changing. So it seems like the CH1N pin is already in its alternate function mode but not performing PWM.Does Cube/HAL require you to enable the PWM outputs on TIM1, and for the channel pins explicitly?
I couldn't find any way to enable the PWM output explicitly for CH1N pin. If I am not doing anything wrong, then what I can do now is to read the datasheet and try configuring the registers to see if there is any bug in CUBEMX.2016-07-05 08:02 AM
Hi s.vinod,
You should enable both CH1 and CH1N by applying the following:/* Start channel 1 */
if(HAL_TIM_PWM_Start(&TimHandle, TIM_CHANNEL_1) != HAL_OK)
{
/* Starting Error */
Error_Handler();
}
/* Start channel 1N */
if(HAL_TIMEx_PWMN_Start(&TimHandle, TIM_CHANNEL_1) != HAL_OK)
{
/* Starting Error */
Check the pulse value if iot correct .
-Hannibal-
2016-07-11 10:02 AM
Thanks Hannibal. :) This solved my problem.