Enabling Internal Pull-Up Resistors for I2C Lines nRF5340

Hello everyone,

I am working with the nRF5340 and use several sensors using the I2C communication. 

I've read in the product specification that there are internal pull up resistors of 13 kOhm on all GPIOs. How do I enable them?

Thanks in advance,

Morandell Paul

Parents
  • Hello,

    You can enable pull-up on the I2C lines by adding the 'bias-pull-up' property to your i2c pin assignments in the device tree.

    e.g.

    ...
    &pinctrl {
    	i2c1_default: i2c1_default {
    		group1 {
    			psels = <NRF_PSEL(TWIM_SDA, 1, 2)>,
    				<NRF_PSEL(TWIM_SCL, 1, 3)>;
    			bias-pull-up;
    		};
    	};
    
    	i2c1_sleep: i2c1_sleep {
    		group1 {
    			psels = <NRF_PSEL(TWIM_SDA, 1, 2)>,
    				<NRF_PSEL(TWIM_SCL, 1, 3)>;
    			low-power-enable;
    		};
    	};
    ...

    Best regards,

    Vidar

Reply
  • Hello,

    You can enable pull-up on the I2C lines by adding the 'bias-pull-up' property to your i2c pin assignments in the device tree.

    e.g.

    ...
    &pinctrl {
    	i2c1_default: i2c1_default {
    		group1 {
    			psels = <NRF_PSEL(TWIM_SDA, 1, 2)>,
    				<NRF_PSEL(TWIM_SCL, 1, 3)>;
    			bias-pull-up;
    		};
    	};
    
    	i2c1_sleep: i2c1_sleep {
    		group1 {
    			psels = <NRF_PSEL(TWIM_SDA, 1, 2)>,
    				<NRF_PSEL(TWIM_SCL, 1, 3)>;
    			low-power-enable;
    		};
    	};
    ...

    Best regards,

    Vidar

Children
Related