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

gazell and app_pwm conflict

Hi,

I'm using gazell library with app_pwm.

From documentation gazell use Timer2 and PPI channels 0,1,2. APP_PWM use Timer0.

When I disable pwm using app_pwm_disable(&PWM1), gazell can't send any packet, but when I enable it again, everything works fine.

I tried changing PPI channels of PWM with following code, but

PWM1.p_cb->ppi_channels[0] = 10;
PWM1.p_cb->ppi_channels[1] = 11;
PWM1.p_cb->ppi_group = 0;

Is there any solution to this problem ?

Parents
  • Yes, this may be PPI conflict. Changing the PPI channels in the PWM library is not possible. You can change the PPI channels used by Gazell by using gzll_sd_resources_arm.lib instead of gzll_arm.lib. This will make the gazell library use PPI channels 8, 9 and 10 instead of 0, 1 and 2. It will also use TIMER0 and software interrupt 1 instead, see here.

    Alternatively you can allocate PPI channel 0, 1 and 2 by calling nrf_drv_ppi_channel_alloc(..) 3 times before initializing the PWM. I have not tested this, but it should work even though it's a little bit "hacky". This is in my opinion a better solution as you will not get problems with possible conflicts.

Reply
  • Yes, this may be PPI conflict. Changing the PPI channels in the PWM library is not possible. You can change the PPI channels used by Gazell by using gzll_sd_resources_arm.lib instead of gzll_arm.lib. This will make the gazell library use PPI channels 8, 9 and 10 instead of 0, 1 and 2. It will also use TIMER0 and software interrupt 1 instead, see here.

    Alternatively you can allocate PPI channel 0, 1 and 2 by calling nrf_drv_ppi_channel_alloc(..) 3 times before initializing the PWM. I have not tested this, but it should work even though it's a little bit "hacky". This is in my opinion a better solution as you will not get problems with possible conflicts.

Children
Related