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

GPIOTE simultaneous interrupts

nRF52, SDK12.1, Eclipse, gcc 5.4.1, FreeRTOS, no soft-device.

I am having a problem with GPIOTE. I have six interrupts programmed on six different pins. As long as the signals do not transition at the same time, the firmware receives interrupts from all pins independently; everything works fine. However, if any two signals change simultaneously, the GPIOTE seems to stop responding altogether: no further interrupts are generated.

Five of the interrupts are configured like so:

nrf_drv_gpiote_in_config_t config = GPIOTE_CONFIG_IN_SENSE_LOTOHI(false);
config.pull = NRF_GPIO_PIN_PULLDOWN;
ret_val = nrf_drv_gpiote_in_init(adxl_isr_pin[i], &config, adxl_event_handler);

The sixth interrupt is configured using NRF_GPIOTE_POLARITY_TOGGLE as it must interrupt on both edges. There are three different event handlers.

In this post is the following quote:

If power-consumption is not an issue and the signals may transition at the same time, then I would initialize the pins with nrf_drv_gpiote_in_init with a nrf_drv_gpiote_in_config_t struct where hi_accuracy is set to true and register a separate event handler for each of the pins.

This post implies that signals that transition simultaneously must use high accuracy. Is this true? If a GPIOTE event is configured for "low accuracy", can multiple simultaneous events be detected? Assuming that simultaneous events cannot be detected, is this restriction removed / eliminated if "high accuracy" is used? Why does this happen?

  • OK, lets keep FreeRTOS out of this as it seems it has nothing to do with the problem. The low accuracy thing says whether to use PORT interrupt or IN EVENTS interrupt. Since you are using low_accuracy, it uses port interrupts. It should not technically matter if one pin has changed or all pins has changes simultaneously to trigger the PORT event. I am not sure why GPIOTE stops responding in such a situation. I do not think that GPIOTE hardware have any problems, could be a driver issue. Can you upload your project so that i can reproduce your issue?

  • Unfortunately, there's too much customer specific code in this project to upload it. Also, the project is targeted to a board that has unusual peripherals: it probably won't run without serious modification. I will attempt to make a project using the Rigado BMD-300 that exhibits this behavior and upload that.

    Also, I am not convinced that I am using FreeRTOS correctly. This could be the problem.

    Can you tell me why power consumption and simultaneous signal transition in are specifically noted in this post (see answer #1)? When I read this it implies that simultaneous signal transitions using PORT events are not supported.

    Thanks for your time,

    ACV

  • I also met this problem, is this problem solved? How to solve it?? Thank you!! [email protected]

Related