This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
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

How to use the PORT event

HI ,all ! I have a question about PORT event function.

as the 4 channels of GPIOTE (channel0 to channel3 ) have been used for other usage.

i need to use a general IO to detect the falling edge signal, the signal is a 50Hz square wave.

How should i do ~~

Parents
  • You configure the pin for sensing, e.g. with

    nrf_gpio_cfg_sense_input(BUTTON_0, NRF_GPIO_PIN_PULLUP, NRF_GPIO_PIN_SENSE_LOW);	
    

    The GPIO has an internal DETECT signal, one for all pins, which is set whenever the SENSE condition for at least one pin is true (here: if the pin BUTTON_0 is low). A change of the DETECT signal from low to high (i.e., from being cleared to being set) will trigger the PORT event in the GPIOTE, which can be be used as any other event (e.g. for triggering an GPIOTE IRQ etc.). The good thing about the SENSE/PORT mechanism is that this does not use up extra current (as the other GPIOTE tasks normally do). Plus, the SENSE/DETECT signal can wake the system from a SYSTEM OFF state.

Reply
  • You configure the pin for sensing, e.g. with

    nrf_gpio_cfg_sense_input(BUTTON_0, NRF_GPIO_PIN_PULLUP, NRF_GPIO_PIN_SENSE_LOW);	
    

    The GPIO has an internal DETECT signal, one for all pins, which is set whenever the SENSE condition for at least one pin is true (here: if the pin BUTTON_0 is low). A change of the DETECT signal from low to high (i.e., from being cleared to being set) will trigger the PORT event in the GPIOTE, which can be be used as any other event (e.g. for triggering an GPIOTE IRQ etc.). The good thing about the SENSE/PORT mechanism is that this does not use up extra current (as the other GPIOTE tasks normally do). Plus, the SENSE/DETECT signal can wake the system from a SYSTEM OFF state.

Children
No Data
Related