cancel
Showing results for 
Search instead for 
Did you mean: 

4 cahannel PWM making (2 ch + complimentory )

thannara123
Senior

Hai ,

am trying to make a pwm signal to drive an H bridge driver  ,My board is Nucleo-F070RB

I am using the following function 

HAL_TIM_PWM_Start_IT(&htim1, TIM_CHANNEL_1);
HAL_TIMEx_PWMN_Start_IT(&htim1, TIM_CHANNEL_1);
HAL_TIM_PWM_Start_IT(&htim1, TIM_CHANNEL_2);
HAL_TIMEx_PWMN_Start_IT(&htim1, TIM_CHANNEL_2);

 

But not getting any wave  

1 ACCEPTED SOLUTION

Accepted Solutions
  htim1.Init.Period = 40;
[...]
  sConfigOC.Pulse = 222;
[...]
  sConfigOC.Pulse = 123;
[...]

If TIMx_CCRx > TIMx_ARR, you won't see any pulses.

Generally, whatever the problem is, start with reading out and checking/posting relevant TIM and GPIO registers content.

JW

View solution in original post

3 REPLIES 3
  htim1.Init.Period = 40;
[...]
  sConfigOC.Pulse = 222;
[...]
  sConfigOC.Pulse = 123;
[...]

If TIMx_CCRx > TIMx_ARR, you won't see any pulses.

Generally, whatever the problem is, start with reading out and checking/posting relevant TIM and GPIO registers content.

JW

thannara123
Senior

Thankyou Very much .

I am using channel pin as folows

PA7 TIM1_CH1N
PA8 TIM1_CH1
PA9 TIM1_CH2
PB0 TIM1_CH2N

 

But not getting signal on PB0 TIM1_CH2N.

__HAL_RCC_GPIOB_CLK_ENABLE(); clock is already enabled 

 

 

What hardware is this, a "known good" board like Nucleo or Disco, or your own? Make sure you are measuring the signal on PB0, i.e. if this is your board, that there is no bad solder joint or short on this pin. You can test it by setting it to GPIO output and toggling "manually" (like blinking a LED).

And, if this won't help, read out and check/post the GPIOB and TIM registers content.

JW