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

Higher frequency response from app_pwm_library

I implemented the app_pwm_library, but it seems to "top out" at 500Khz?  Here is a summary of my code.  Is there a set of routines that have a higher speed?

APP_PWM_INSTANCE(PWM1,1);            // Create the instance "PWM1" using TIMER1.

...

ret_code_t err_code;

/* 1-channel PWM, 2 us (500khz)*/
app_pwm_config_t pwm1_cfg = APP_PWM_DEFAULT_CONFIG_1CH(2, PWM_PIN);
/* Initialize and enable PWM. */
err_code = app_pwm_init(&PWM1, &pwm1_cfg, 0);
APP_ERROR_CHECK(err_code);
...

app_pwm_enable(&PWM1);

...

while (app_pwm_channel_duty_set(&PWM1, 0, value) == NRF_ERROR_BUSY);

Thanks for any help!

Parents Reply
  • You can drive up to 4 pins per PWM instance (52832 has 3) as demonstrated by the pwm driver example (nRF5_SDK_15.2.0_9412b96\examples\peripheral\pwm_driver). 

    GPIOTE is not necessary, but you may use PPI to trigger PWM to start.  

    EDIT: forgot to add that there are some pins that you should avoid using for high frequency signals as the may interfere with the radio. Please refer to the pin assignment sections in the PS for the chip package you have to find out which pins have this restriction.   

Children
No Data
Related