I'm using nRF52832 with an external motion co-processor. As a part of a robust reset strategy, I want to connect a single nRF52 pin to the co-processor's nRST pin to generate a short active-low reset pulse in case the co-processor gets stuck. The co-processor guarantees a hardware reset being asserted 500ns after its nRST pin being held low. So anything longer than 500ns + some safety margin is good - no need to be precise there.
My thought process:
- Set any available GPIO pin using NRFX_GPIOTE_CONFIG_OUT as OUTPUT HIGH using nrfx_gpiote_out_set
- If the co-processor doesn't respond, set this GPIO as OUTPUT LOW using nrfx_gpiote_out_clear
- Start app_timer (I use SoftDevice and few app_timers are already enabled) for a single shot after 10 ticks or so at 32,768 kHz
- In the timer timeout handler set the GPIO back to OUTPUT HIGH using nrfx_gpiote_out_set
- The co-processor takes about 400ms to reboot and initialize, and it would assert one of its pins to HIGH if everything goes OK. This pin can be wired to another nRF52 GPIO (say GPIO2) to generate an interrupt and tell nRF52 that we're good to go. I'm planning to initialise the second GPIO with NRFX_GPIOTE_CONFIG_IN_SENSE_LOTOHI (false) to avaid using HFCLK
I don't think this solution is the most elegant though. I couldn't find a dedicated SDK library that would generate a single short external pulse instead, but maybe I'm missing something? I've come across this post, but it's 6 years old and I was thinking maybe a newer SDK has a better implementation?
This feature shouldn't be used very often, but low power consumption would still be a key as the device is battery powered.
Notes on the HW circuit:
- nRST line has an external pull-up resistor to VDD, so the GPIO might not even need to be initialized until the reset pulse is actually required to help save power consumption on nRF52
- nRST line also has a small capacitor to GND to prevent any noise from resetting the co-processor