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

Does app_button use all four GPIOTE channels on nRF51822?

Hi,

I'm working on a project with nRF51822QFAA on nRF5_SDK_12.3.0.

I'd like to ask if the app_button library uses all four GPIOTE channels?

In my project there are 9 buttons and so GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS was set to 9 and it works properly.

Now I want to use Timer+PPI+GPIOTE to generate a one-shot pulse on a GPIO (say 1ms pulse).

As I know nRF51822 only has four GPIOTE channels.

Why 9 buttons can be accepted?
Is it because port event is used if the number of buttons is larger than four?

If port event is used, how many GPIOTE channels are occupied by the app_button library?

Thanks for help.

Parents
  • Hi,

    The app_button implementation does not use GPIOTE. However, the same driver (nrf_drv_gpiote) is used regardless of configuration. The problem here is likely that you have not set the GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS in sdk_config.h high enough, and in that case you will get returned NRF_ERROR_NO_MEM during initialization.

    If you use 9 buttons (which don't need high accuracy), then you should set NRF_ERROR_NO_MEM to at least 9. Then the total number of "channels" will be the physical GPIOTE channels (4) plus the specified number of low accuracy "channels" (which are not real channels, but just a SW abstraction as the same driver is used for both).

  • Hi,

    Thanks for your reply.

    I modified the GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS to 10 and was able to setup and use the GPIOTE+PPI+TIMER as the same time with the app_button library.

Reply Children
No Data
Related