This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

how to make PWM pulse in both channels

Hi

i wrote the program which is making pulse one time on channel 0 and then followed by channel 1 and then again channel 0 and then 1 going on , my aim is to create pulses on both channel at the same time i tested by conencting buzzer on pin 6 and pin 7 so can anyone help me how to create that any help will be appreicated

Thank you

main.c

Parents
  • The pulses will not be totally synchronous if you use the driver. The driver can only set one channel at the time. You could use app_pwm_disable, but also here the output is set sequentially, so you will have an interval in time where one pin is high and the other is low. bottom line: You cannot do this with the pwm driver.

  • i am using this example from the SDK but this making pulses synchroncially in both pins for infinite time by adding this line

    pwm1_cfg.pin_polarity[0] = APP_PWM_POLARITY_ACTIVE_HIGH;

    then can you tell me how this working ?and also can you tell me how can i make condition for just five pulses (example just five times on and off uniformally) what condition do i have to set

Reply
  • i am using this example from the SDK but this making pulses synchroncially in both pins for infinite time by adding this line

    pwm1_cfg.pin_polarity[0] = APP_PWM_POLARITY_ACTIVE_HIGH;

    then can you tell me how this working ?and also can you tell me how can i make condition for just five pulses (example just five times on and off uniformally) what condition do i have to set

Children
No Data