Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Custom GPIOs and PPI

I am developing a custom board with an electronic paper device (EPD) attached, which will be controlled with SPI and a five additional GPIOs (a mixture of inputs and outputs). Before committing to a board design I would like to test the device with an NRF52DK.

I am developing on MacOS Monterey 12.2.1 in VS Code with the nrf Connect extension and vrf Connect SDK v.1.8.0.

When testing the EPD I would like to be able to view the input status pins, which indicate when the device is busy, by glancing at the LEDs on the DK board. I would therefore like to use PPI to automatically set the LEDs according to the status of the input lines.

I have successfully compiled the Zephyr nrfx example and can get status LED0 to change state by pressing button SW0. 

I have added a GPIO pin definition for the EPD's busy line into the board overlay file as follows:

/ {
    gpiocustom {
        compatible = "gpio-keys";
        gpiocus9: gpiocus_9 {
            gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
            label = "Custom gpio 9 - EPD BUSY";
        };
    };
    aliases {
        epdbusy = &gpiocus9;
    };
};

and altered the example code so that the definition of the INPUT_PIN is as follows:

#define INPUT_PIN	DT_GPIO_PIN(DT_ALIAS(epdbusy), gpios)

The code compiles and flashes, but the status of the LED does not change when I pull pin P0.09 low with a hook-up wire.

1/ am I incorrectly referencing P0.09 in the .overlay file? 

2/ is there another step that I am missing that is required to use this pin as part of my project?

3/ once I have solved this basic problem, I might want to use the LEDs to indicate the status of the MOSI and MISO lines on the SPI interface. Is it possible to use PPI to monitor the status of a pin that is being used by the SPI peripheral in this way? If so, how would I adapt the code or .overlay file to associated one of the SPI pins with the PPI input?

Parents Reply Children
No Data
Related