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

what's timing requirement of GPIOE detect rising/fall edge?

we now using GPIO as input. when it rise then start timer. but it seem failed. No GPIOE IN event happened.

what's timing need for rising/fall edge detecting? < XX (us)? How sharp it need be?

Parents
  • There is nothing in the GPIO to generate events. When you have enabled the "Sense" mechanism on your input pin through the GPIO configuration, It will generate a detect signal which in turn will generate a PORT event inside GPIOTE.

    This detection sampling should happen atleast at the speed of internal clock, so 0.06us. I am pretty confident that the chip won't miss it if it happens.

  • sorry! I did not remember how much changes in NRF_GPIO->PIN_CNF[]. but this config working for our board. detect the RISE Event.

    NRF_GPIO->PIN_CNF[zx] = (GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos)
                            | (GPIO_PIN_CNF_DRIVE_S0S1 << GPIO_PIN_CNF_DRIVE_Pos)
                            | (GPIO_PIN_CNF_PULL_Disabled << GPIO_PIN_CNF_PULL_Pos)
                            | (GPIO_PIN_CNF_INPUT_Disconnect << GPIO_PIN_CNF_INPUT_Pos)
                            | (GPIO_PIN_CNF_DIR_Input << GPIO_PIN_CNF_DIR_Pos);
    
    NRF_GPIOTE->CONFIG[2] = (GPIOTE_CONFIG_MODE_Event << GPIOTE_CONFIG_MODE_Pos)
                            | ((uint32_t)zx    << GPIOTE_CONFIG_PSEL_Pos)
                            | ((uint32_t)GPIOTE_CONFIG_POLARITY_LoToHi << GPIOTE_CONFIG_POLARITY_Pos)
                            | ((uint32_t)GPIOTE_CONFIG_OUTINIT_Low << GPIOTE_CONFIG_OUTINIT_Pos);
    

    appreciate your help!

Reply
  • sorry! I did not remember how much changes in NRF_GPIO->PIN_CNF[]. but this config working for our board. detect the RISE Event.

    NRF_GPIO->PIN_CNF[zx] = (GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos)
                            | (GPIO_PIN_CNF_DRIVE_S0S1 << GPIO_PIN_CNF_DRIVE_Pos)
                            | (GPIO_PIN_CNF_PULL_Disabled << GPIO_PIN_CNF_PULL_Pos)
                            | (GPIO_PIN_CNF_INPUT_Disconnect << GPIO_PIN_CNF_INPUT_Pos)
                            | (GPIO_PIN_CNF_DIR_Input << GPIO_PIN_CNF_DIR_Pos);
    
    NRF_GPIOTE->CONFIG[2] = (GPIOTE_CONFIG_MODE_Event << GPIOTE_CONFIG_MODE_Pos)
                            | ((uint32_t)zx    << GPIOTE_CONFIG_PSEL_Pos)
                            | ((uint32_t)GPIOTE_CONFIG_POLARITY_LoToHi << GPIOTE_CONFIG_POLARITY_Pos)
                            | ((uint32_t)GPIOTE_CONFIG_OUTINIT_Low << GPIOTE_CONFIG_OUTINIT_Pos);
    

    appreciate your help!

Children
No Data
Related