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

About nordic51822 pwm_library Settings

Use the Nordic \ nRF5_SDK_12 _f012efa 2.0-3 d \ examples \ peripheral \ pwm_library routines, now can output two lines of PWM, but want to two way different PWM phase have what way? As shown in figure now is like this: image description

Want two road PWM phase diagram is different: image description

You can achieve?

Thank you very much looking forward to your reply

Parents
  • Hi,

    If you want one of the signals to be low, when the other is high, you can switch the polarity:

    /* 2-channel PWM, 200Hz, output on DK LED pins. */
    app_pwm_config_t pwm1_cfg = APP_PWM_DEFAULT_CONFIG_2CH(5000L, 1,2);
    
    /* Different polarity for the channels. */
    pwm1_cfg.pin_polarity[0] = APP_PWM_POLARITY_ACTIVE_LOW;
    pwm1_cfg.pin_polarity[1] = APP_PWM_POLARITY_ACTIVE_HIGH;
    
Reply
  • Hi,

    If you want one of the signals to be low, when the other is high, you can switch the polarity:

    /* 2-channel PWM, 200Hz, output on DK LED pins. */
    app_pwm_config_t pwm1_cfg = APP_PWM_DEFAULT_CONFIG_2CH(5000L, 1,2);
    
    /* Different polarity for the channels. */
    pwm1_cfg.pin_polarity[0] = APP_PWM_POLARITY_ACTIVE_LOW;
    pwm1_cfg.pin_polarity[1] = APP_PWM_POLARITY_ACTIVE_HIGH;
    
Children
No Data
Related