how to remap pin(pin 0 & pin 1) port 0 to gpio

On the nRF5340  P0.00 and P0.01 are used for the 32.768 kHz crystal by default and are not available as GPIO on the connectors.

how to remap  this pins to gpio? 

Parents
  • Ensure you have something like this to stop the pins being configured to use a crystal instead of i/o; this list is for the SDK, there should be something akin to this in nRFConnect:

    #define CLOCK_CONFIG_LF_SRC              0
    #define NRF_SDH_CLOCK_LF_SRC             0
    #define NRF_SDH_CLOCK_LF_RC_CTIV        16
    #define NRF_SDH_CLOCK_LF_RC_TEMP_CTIV    2
    #define NRF_SDH_CLOCK_LF_ACCURACY        1 // <1=> NRF_CLOCK_LF_ACCURACY_500_PPM

    This might also help, though this is for the nRF52832

        // 32kHz Osc pins can be used as GPIOs or 32kHz Oscillator, special case
        if ( (PinId == PIN_XL2) && (NRF_CLOCK->LFCLKSRC & 0x000001) ) return "RTC-OSC-OUT";
        if ( (PinId == PIN_XL1) && (NRF_CLOCK->LFCLKSRC & 0x000001) ) return "RTC-OSC-IN";

Reply
  • Ensure you have something like this to stop the pins being configured to use a crystal instead of i/o; this list is for the SDK, there should be something akin to this in nRFConnect:

    #define CLOCK_CONFIG_LF_SRC              0
    #define NRF_SDH_CLOCK_LF_SRC             0
    #define NRF_SDH_CLOCK_LF_RC_CTIV        16
    #define NRF_SDH_CLOCK_LF_RC_TEMP_CTIV    2
    #define NRF_SDH_CLOCK_LF_ACCURACY        1 // <1=> NRF_CLOCK_LF_ACCURACY_500_PPM

    This might also help, though this is for the nRF52832

        // 32kHz Osc pins can be used as GPIOs or 32kHz Oscillator, special case
        if ( (PinId == PIN_XL2) && (NRF_CLOCK->LFCLKSRC & 0x000001) ) return "RTC-OSC-OUT";
        if ( (PinId == PIN_XL1) && (NRF_CLOCK->LFCLKSRC & 0x000001) ) return "RTC-OSC-IN";

Children
Related