Why can't I assign i2c0 pins to P0.06?

I built a PCB as outlined by the nRF52840 datasheet, however, P0.06 (my SCL line) is not working. I can assign SCL to other pins (like P01.10), however, P0.06 will not work. Why not? It does not mention legal or illegal i2c pins in the datasheet.

The output when using P0.06 is a diamond with a triangle in the middle, instead of actual values.

The following code works, however, I need to use P0.06 for SCL, and P0.27 for SDA.

&uart0 {
    pinctrl-0 = <&uart0_default>;
    pinctrl-1 = <&uart0_sleep>;
    pinctrl-names = "default", "sleep";
    status = "okay";
  };

  &i2c0 {
    label = "I2C_0";
    compatible = "nordic,nrf-twim";
    pinctrl-0 = <&i2c0_tempDEF>;
    pinctrl-1 = <&i2c0_tempSLP>;
    pinctrl-names = "default", "sleep";
    status = "okay";
};

&pinctrl{
    i2c0_tempDEF: i2c0_tempDEF {
        group1 {
            psels = <NRF_PSEL(TWIM_SDA, 1, 1)>,
                <NRF_PSEL(TWIM_SCL, 1, 10)>;
        };
    };

    i2c0_tempSLP: i2c0_tempSLP {
        group1 {
            psels = <NRF_PSEL(TWIM_SDA, 1, 1)>,
                <NRF_PSEL(TWIM_SCL, 1, 10)>;
            low-power-enable;
        };
    };
};

EDIT: Still no solution, but I may have found the cause of the problem. Although this is not listed in the datasheet... the following link indicates that P0.06 has a default setting of "UART", and I have intentionally reassigned the original UART pin to something else, without issue there, UART works perfectly fine with its reassignment. Is it possible that I'm being 'blocked' from using P0.06 because even though it's reassigned, the MCU is still reserving it for UART? How can I work around this?

infocenter.nordicsemi.com/index.jsp

Parents
  • Found a solution that both works for the DK board, and a normal chip.

    As pointed out in my post, some pins have 'defaults', and any re-configuration of these protocols is only adding to, not replacing the original pins.

    For example, if UART0 has a default setting of TX to P0.06, even if you relocate TX to P0.07, TX will be BOTH P0.06 and P0.07, not just P0.07.

    So you need to disable the conflicting protocol (UART0) entirely in the devicetree. For me, this isn't an issue because I don't need UART, and even if I did, I could just use UART1. With UART0 disabled, P0.06 is free to be used for i2c.

Reply
  • Found a solution that both works for the DK board, and a normal chip.

    As pointed out in my post, some pins have 'defaults', and any re-configuration of these protocols is only adding to, not replacing the original pins.

    For example, if UART0 has a default setting of TX to P0.06, even if you relocate TX to P0.07, TX will be BOTH P0.06 and P0.07, not just P0.07.

    So you need to disable the conflicting protocol (UART0) entirely in the devicetree. For me, this isn't an issue because I don't need UART, and even if I did, I could just use UART1. With UART0 disabled, P0.06 is free to be used for i2c.

Children
No Data
Related