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

Edge Triggered wake up from system off mode

I have interfaced a vibration switch with nRF51822 Pin 19 using external pull-up. When there is no vibration the switch is either at open position or close position randomly. The nRF is normally in system off mode. I want to wake up the chip only when there is a vibration(rising or falling edge). I have used following lines to configure the input pin.

//Configuring Channel 3 to Vibration Interrupt NRF_GPIO->PIN_CNF[19] = (GPIO_PIN_CNF_SENSE_Low << GPIO_PIN_CNF_SENSE_Pos) | (GPIO_PIN_CNF_DRIVE_S0S1 << GPIO_PIN_CNF_DRIVE_Pos) | (NRF_GPIO_PIN_PULLDOWN << GPIO_PIN_CNF_PULL_Pos) | (GPIO_PIN_CNF_INPUT_Connect << GPIO_PIN_CNF_INPUT_Pos) | (GPIO_PIN_CNF_DIR_Input << GPIO_PIN_CNF_DIR_Pos);

NRF_GPIOTE->INTENSET = GPIOTE_INTENSET_IN3_Set << GPIOTE_INTENSET_IN3_Pos;

NRF_GPIOTE->CONFIG[3] = (GPIOTE_CONFIG_POLARITY_HiToLo << GPIOTE_CONFIG_POLARITY_Pos) | (19<< GPIOTE_CONFIG_PSEL_Pos) | (GPIOTE_CONFIG_MODE_Event << GPIOTE_CONFIG_MODE_Pos);

Since I can either put sense to high or low. For e.g. if i Use "GPIO_PIN_CNF_SENSE_Low" and if randomly vibration switch stays at close position, giving low output, the nRF wakes up as soon as i put it in system off mode.

Is there any way to make sense functionality into sensing the edge rather than level ?

Parents Reply Children
No Data
Related