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

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);
Parents
  • 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; while (NRF_NVMC->READY == NVMC_READY_READY_Busy){} NRF_UICR->NFCPINS &= ~UICR_NFCPINS_PROTECT_Msk; while (NRF_NVMC->READY == NVMC_READY_READY_Busy){} NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Ren << NVMC_CONFIG_WEN_Pos; while (NRF_NVMC->READY == NVMC_READY_READY_Busy){} 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

Reply Children
No Data
Related