๐ Fixing GPIO Interrupt Issues on P0.09 and P0.10 in nRF-Based Microcontrollers
Introduction
๐ Fixing GPIO Interrupt Issues on P0.09 and P0.10 in nRF-Based Microcontrollers
Introduction
If youโre working with nRF52-based microcontrollers (such as the micro:bit V2) and facing issues where GPIO interrupts are not working on pins P0.09 and P0.10, youโre not alone.
These two pins remain unresponsive even though the same interrupt code works perfectly fine on other GPIOs. In this guide, weโll explore why this happens and how to fix it.
Understanding the Problem
By default, P0.09 and P0.10 are NFC (Near Field Communication) pins. When NFC mode is enabled, these pins cannot function as general-purpose GPIOs. This is why interrupts and digital input fail when using these pins.
Why is this an Issue?
- Hidden NFC Configuration: The NFC feature is controlled by the UICR (User Information Configuration Register), which is stored in non-volatile memory and persists across resets.
- Pins are Read-Only by Default: You cannot modify the NFC configuration directly because it is locked in read-only mode.
- Standard GPIO Configuration Wonโt Help: Simply configuring these pins as GPIOs is not enough; you need to disable NFC mode explicitly.
How to Fix It?
To disable NFC and restore GPIO functionality, you need to modify the UICR->NFCPINS register. This involves enabling writes to non-volatile memory (NVMC), updating the NFC setting, and resetting the device for changes to take effect.
โ Code to Disable NFC and Enable GPIO on P0.09 & P0.10
NRF_NVMC->CONFIG = 1; // Enable writing to UICR
while (NRF_NVMC->READY == 0);
NRF_UICR->NFCPINS = 0; // Disable NFC function (enable GPIO)
NRF_NVMC->CONFIG = 0; // Disable writing
while (NRF_NVMC->READY == 1);
Once NFC is disabled, you need to configure the pins properly for interrupts
Conclusion
The issue with P0.09 and P0.10 not working as GPIOs is due to their default NFC mode. By modifying the UICR register, we successfully re-enabled their GPIO functionality. This solution is persistent across resets and needs to be applied only once.
๋ฉํ๋ฐ์ดํฐ
- post_id
- b3518ddfdb21
- slug
- fixing-gpio-interrupt-issues-on-p0-09-and-p0-10-in-nrf-based-microcontrollers-b3518ddfdb21
- url
- https://medium.com/@pranav-tiwari/fixing-gpio-interrupt-issues-on-p0-09-and-p0-10-in-nrf-based-microcontrollers-b3518ddfdb21
- canonical_url
- https://medium.com/@pranav-tiwari/fixing-gpio-interrupt-issues-on-p0-09-and-p0-10-in-nrf-based-microcontrollers-b3518ddfdb21
- author_url
- https://medium.com/@pranav-tiwari
- status
- ok
- fetched_at
- 2026-07-20 15:35:23