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

Simultaneous use of GPIOTE and other peripheral

Short version: can I use a pin both as a GPIO input to trigger GPIOTE PPI event, and as SPI MISO *at the same time*?

Detailed version:

I want to use the SPI peripheral to implement a serial driver for another protocol. The protocol is single wire, the nrf52840 is master, and slaves may want to send messages or replies to the master, by driving the pin low.

Until now, I've let the pin be a GPIO while idle. On falling edge, the GPIOTE IRQ sets the pin to SPI miso (and other appropriate settings), and receives data. This works fine, until another IRQ is running and blocking the GPIOTE IRQ for a millisecond or so. Then the IRQ runs too late and misses bits.

So I am trying to implement all this with PPI.

Is it possible (and supported) to have the same pin configured as GPIOTE input, and SPI miso *at the same time*, and get the PPI to react on GPIOTE and start the SPI transfer?

This section of the GPIO chapter seems to imply that it is possible, but it isn't explicit enough for me to trust it without a confirmation: 

> Other peripherals in the system can attach themselves to GPIO pins and override their output value and configuration, or read their analog or digital input value, see Figure 1.

I cannot see on the Figure 1 where the signal is taken to other peripherals. Maybe because the figure resolution is so low.

Parents Reply
  • Hi,

    I might have misunderstood you a bit. Anyways, I did a quick test by merging the nrfx_SPIM example and the pin_change_int example. The modified example would toggle a LED via GPIOTE every time the MISO line would toggle. I think that this would show that it's indeed possible to trigger a task via GPIOTE from a Pin that is already used by SPIM as MISO.

    regards

    Jared 

Children
No Data
Related