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

Interrupts on many pins high to low

I want to detect high to low transitions on 28 GPIO independently. I've read in other posts you can configure 4 pin interrupts or a port interrupt for all pins, but I'm not sure that allows the pins to have different states and still be detected.

I'm using GPIOTE. The code below does not seem to work for all pins.

for(int i = 2; ...; i++) {
    nrf_drv_gpiote_in_config_t in_config = GPIOTE_CONFIG_IN_SENSE_TOGGLE(false);
    in_config.pull = NRF_GPIO_PIN_NOPULL;
    err_code = nrf_drv_gpiote_in_init(i, &in_config, in_pin_handler);
    VERIFY_SUCCESS(err_code);
    nrf_drv_gpiote_in_event_enable(i, true);
}

Is the only solution polling?

Parents Reply
  • There are 32 GPIOs on the nRF52832. Some of these GPIOs have shared pins with other features, as described in the pin mappings documentation. On the DK, at least P0.00, P0.01 (XL1, XL2 - low frequency crystal), P0.09, P0.10 (NFCT antenna pins), and P0.21 (nRESET) are not connected to the pin headers on the nRF52-DK. The rest of the pins should all be connected to the headers, but note that many of them are connected to things (P0.05-P0.08 used for UART, P0.13-P0.20 connected to LEDs and buttons, etc.). To use 28 GPIOs on the DK, you need to repurpose and connect at least one of these pins. If you need more GPIOs you need to upgrade to nRF52840, which have up to 48 GPIOs.

Children
No Data
Related