How to configure the P0.00 and P0.01 pins as GPIO?

Sorry for my trivial question but how can I configure the P0.00 and P0.01 pins as GPIO? On my custom board I have a nRF52840 module which has a 32.768KHz crystal connected on P0.00 and P0.01. I read that the theese pins are configured as XL1 and XL2 as default, isn't it?

So how can I configure the P0.00 and P0.01 pins as GPIO? I'm using the SDK 2.2.3 and the nRF Connect v2023.4.179 in VS Code.

And most important, is the 32.768KHz crystal necessary for the BLE or the Zephyr's kernel?

Parents
  • Hi,

     

    If your board has a low frequency 32k crystal connected to the P0.00/P0.01 pins, this must be physically removed in order for you to use those pins as normal GPIOs.

     

    To change the LFCLK source, you can set this kconfig entry:

    CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y

    And most important, is the 32.768KHz crystal necessary for the BLE or the Zephyr's kernel?

    Yes, there's a hard requirement to use a LFCLK.

    Please note that you can use the internal 32k RC oscillator for this, which does not have a GPIO dependency.

     

    Kind regards,

    Håkon

Reply
  • Hi,

     

    If your board has a low frequency 32k crystal connected to the P0.00/P0.01 pins, this must be physically removed in order for you to use those pins as normal GPIOs.

     

    To change the LFCLK source, you can set this kconfig entry:

    CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y

    And most important, is the 32.768KHz crystal necessary for the BLE or the Zephyr's kernel?

    Yes, there's a hard requirement to use a LFCLK.

    Please note that you can use the internal 32k RC oscillator for this, which does not have a GPIO dependency.

     

    Kind regards,

    Håkon

Children
No Data
Related