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

51822 GPIO break donw the chip

51822, config a pin as output , in the param , set disconnect or connect the input pin, when config as output ,what mean disconnct/connect input pin?

I use a pin to light a led, config a pin as output ,and connect the pin to a series resistance and a LED, the other side of the led is VDD(3V), when the GPIO is low,the LED is light, when the GPIO is high ,the LED is not bright. it can work, but a moment ,the chip is down, the current can reach 100mA, the chip is broken. I think the LED GPIO is the cause of this failure. How can I use the GPIO in this case?

 GPIO_PIN_CONFIG(PIN_NO,                       
                    GPIO_PIN_CNF_DIR_Output,      
                    GPIO_PIN_CNF_INPUT_Disconnect,
                    GPIO_PIN_CNF_PULL_Disabled,   
                    GPIO_PIN_CNF_DRIVE_S0S1,      
                    GPIO_PIN_CNF_SENSE_Disabled);

#define GPIO_PIN_CNF_INPUT_Connect #define GPIO_PIN_CNF_INPUT_Disconnect

Parents
  • Hi

    Here is the GPIO drive guide

    When you configure a pin as output, what matters is the drive strength. The rest of the configuration is done as in the nrf_gpio.h:

    __STATIC_INLINE void nrf_gpio_cfg_output(uint32_t pin_number)
    {
    		nrf_gpio_cfg(
    						pin_number,
    						NRF_GPIO_PIN_DIR_OUTPUT,
    						NRF_GPIO_PIN_INPUT_DISCONNECT,
    						NRF_GPIO_PIN_NOPULL,
    						NRF_GPIO_PIN_S0S1,
    						NRF_GPIO_PIN_NOSENSE);
    }
    

    You would only configure the SENSE, the pull and the input differently when using the pin as input, as done in the following definition in nrf_gpio.h

    __STATIC_INLINE void nrf_gpio_cfg_sense_input(uint32_t pin_number, nrf_gpio_pin_pull_t pull_config, nrf_gpio_pin_sense_t sense_config)
    {
    		nrf_gpio_cfg(
    						pin_number,
    						NRF_GPIO_PIN_DIR_INPUT,
    						NRF_GPIO_PIN_INPUT_CONNECT,
    						pull_config,
    						NRF_GPIO_PIN_S0S1,
    						sense_config);
    }
    
  • I agree that this is somewhat confusing, I will attempt to clarify a bit.

    • H0H1 indicates high drive on both logical '0' and '1'.
    • S0S1 indicates standard drive on both logical '0' and '1'
    • S0H1 indicates standard drive on logical '0' and high drive on logical '1'
    • and so forth...

    Best regards,

    Øyvind

Reply Children
No Data
Related