# cannot get P0.09 to operate as a GPIO

I've tried everything I can find on this topic and I still cannot get P0.09 to behave as a GPIO pin. Does it have something to do with the way I'm attempting to initialize the pin (see below)? If so, what are the constraints on this pin as a GPIO?

nrf_drv_gpiote_in_config_t config = GPIOTE_CONFIG_IN_SENSE_HITOLO(false);
// Macro does not set the pullup or pulldown
config.pull = NRF_GPIO_PIN_PULLUP;
err_code = nrf_drv_gpiote_in_init(HESA_TOP_PIN_NUMBER, &config, hesa_pin_event_handler);
APP_ERROR_CHECK(err_code);
nrf_drv_gpiote_in_event_enable(HESA_TOP_PIN_NUMBER, false);

edit retag close delete

Sort by » oldest newest most voted

Hi,

1. Using your name as tag looks awkward.
2. You haven't specified what chip you are using.
3. Assuming you are using nRF52 this indicates that you haven't read Product Specification where you could learn about NFC antenna (ISO14443 peripheral) being tight to P0.09 and P0.10. If you want to disable NFC capabilities of these PINs and use them as generic GPIO you should follow this section. However brief search on this forum would give you answer without asking.

Update:

My first comment to tags you've assigned to question, to the only one tag to be precise. Tags are here to make search easier, your tag doesn't make any sense. To the topic: - In my project's it's enough to define CONFIG_NFCT_PINS_AS_GPIOS and all the job is done in system_nrf52.c start-up file. If you don't use it then simply copy and paste into your code this part or some equivalent:

/* Configure NFCT pins as GPIOs if NFCT is not to be used in your code. If CONFIG_NFCT_PINS_AS_GPIOS is not defined,
two GPIOs (see Product Specification to see which ones) will be reserved for NFC and will not be available as
normal GPIOs. */
#if defined (CONFIG_NFCT_PINS_AS_GPIOS)
if ((NRF_UICR->NFCPINS & UICR_NFCPINS_PROTECT_Msk) == (UICR_NFCPINS_PROTECT_NFC << UICR_NFCPINS_PROTECT_Pos)){
NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Wen << NVMC_CONFIG_WEN_Pos;
NRF_UICR->NFCPINS &= ~UICR_NFCPINS_PROTECT_Msk;
NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Ren << NVMC_CONFIG_WEN_Pos;
NVIC_SystemReset();
}
#endif


Now you should also verify that you don't have connected any NFC matching components on these PINs. If you are using nRF52 DK board then you follow this part of the User Manual, if not then you need to consult your schematics or manufacturer.

Cheers Jan

more

1. odd comment
2. My apologies, and your assumption is correct.
3. I have read the specification and already tried the remedies that I could find in this forum. You didn't read the my question, please read it again. For your edification, here is what I've tried so far:
4. Setting the UICR register directly as in NRF_UICR->NFCPINS = 0xFFFFFFFE;
5. Using the NVMC driver, as in: uint32_t nfcpins = (*(uint32_t *)0x1000120C); if (nfcpins & 1) { nrf_nvmc_write_word(0x1000120C, 0xFFFFFFFE); NVIC_SystemReset(); }
6. Placing CONFIG_NFCT_PINS_AS_GPIOS in the preprocessor defines in uVision.
7. Using the memory attribute as in: `const uint32_t UICR_ADDR_0x20C __attribute__((at(0x1000120C))) __attribute__((used)) = 0xFFFFFFFE;
8. various combinations of the above, and also have attempted various configurations for the pin itself, it just never acts as a GPIO input.
( 2017-03-20 23:14:42 +0100 )editconvert to answer

Updating my answer as comment is too short.

( 2017-03-20 23:27:00 +0100 )editconvert to answer

I've read the question again and you said nothing about any remedies you'd tried there, just that you had 'tried everything you can find on this topic'. If people are using the nRF52 DK they usually miss the fact they need to remove the two 0 ohm resistors and bridge the two NC before P.09 and P.10 work. I'd only do that myself if I'd run out of pins to use.

( 2017-03-21 00:23:27 +0100 )editconvert to answer

[hide preview]

## Recent blog posts

• ### Difference between nRF52840 Engineering A and B reference designs

Posted 2018-01-15 12:27:08 by Martin Børs-Lind
• ### [For Hire] Expert development services of custom Hardware devices | IoT solutions | Mobile Apps

Posted 2018-01-15 09:08:42 by Ilya Surinsky
• ### Rust bindings to nrf52 series

Posted 2018-01-12 23:23:07 by Coleman McFarland
• ### Show And Tell: Poly - Building an RC Airplane The Hard Way

Posted 2018-01-05 01:17:57 by Daniel Veilleux
• ### Bluetooth on a desktop computer (Windows, Mac, Linux)

Posted 2018-01-04 17:56:57 by kbaud

## Recent questions

• ### System off draws more then 80µA

Posted 2018-01-22 22:15:19 by ruetten
• ### How to add driver to an SDK example, in Segger Embedded Studio?

Posted 2018-01-22 21:37:18 by Mark Leavitt
• ### Send more than 60 characters with each call to ble_nus_string_send

Posted 2018-01-22 21:20:21 by fkoran
• ### DFU succeeds but flash is erased

Posted 2018-01-22 20:42:54 by brett_anderson
• ### Uart example stops blinking after a while

Posted 2018-01-22 19:56:29 by oliverpoc