Is it possible to use internal pull-up/pull-down resistors with I2C, UART, etc?

I need pull-up/pull-down resistors on my UART and I2C lines and am wondering if I can enable the pull-up/pull-down resistors instead.  If this possible?  I can see how to configure them for GPIO, but I'm wondering if I use the same approach if it would interfere with the UART/I2C drivers.  Thanks

Other info:
nRF52480

nRF Connect SDK v2.1.0

Parents Reply
  • Hello,

    I'm running into issues accessing a sensor via i2c ("nordic,nrf-twim") and I just want to verify that the pull-up configuration is not the source of the issue. Is the following configuration OK?

    &pinctrl {
        i2c0_default: i2c0_default {
            group1 {
                psels = <NRF_PSEL(TWIM_SDA, 0, 2)>,
                    <NRF_PSEL(TWIM_SCL, 0, 5)>;
                // bias-disable;
                // bias-pull-up;
            };
        };
        i2c0_sleep: i2c0_sleep {
            group1 {
                psels = <NRF_PSEL(TWIM_SDA, 0, 2)>,
                    <NRF_PSEL(TWIM_SCL, 0, 5)>;
                // bias-disable;
                // bias-pull-up;
                low-power-enable;
            };
        };
    };

    &i2c0{
        compatible = "nordic,nrf-twim";
        status = "okay";
        clock-frequency = <I2C_BITRATE_STANDARD>;

        // Use pin control to specify SDA and SCL pin
        pinctrl-0 = <&i2c0_default>;
        pinctrl-1 = <&i2c0_sleep>;
        pinctrl-names = "default", "sleep";

        lis2dh120:lis2dh@19{    
            compatible = "st,lis2dh","st,lis2dh12";
            reg = <0x19>;
            vin-supply = < &lis2dh_pwr >; // fixed regulator node
            irq-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>, // INT1
                        <&gpio0 7 GPIO_ACTIVE_HIGH>; // INT2
            // disconnect-sdo-sa0-pull-up;
            status = "okay";
        };
    };

    Which is using GPIO0.2 and GPIO0.5 as SDA and SCL on nRF52810. I tried both with and without "bias-pull-up".

    The issue is described in more details in regulator-powered sensor fails to acknowledge over i2c after replacing battery

    Thank you.

Children
Related