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

Does setting a pin to be TWI SCL or SDA enable its pullup?

I have the nRF52 dev kit, and I hooked up pin 13 to SDA and pin 18 to SCL on an I2C device. There are no external pullups on the SDA or SCL lines.

However, the TWIM module appears to happily communicating with the slave. So does setting an IO to be a TWI line through the NRF_TWIM0->SCL/SDA registers automatically enable that IOs pullup? I couldn't find any information either way in the datasheet, and that seems like an important detail to know.

I'm bare-metal programming. No softdevice. No driver.

Parents
  • In the product specification (version 3.0), you can find in section 28.2 for master mode configuration and also table 258, that you need to configure the pull-up resistors for SDA and SCL in the GPIO peripheral manually. The TWI unit will not do this automatically.

    You need to configure the pins, before enabling the TWI, so that there can no glitches occur on these pins, which might confuse the connected TWI slaves.

    Perhaps one of your slaves has a tendency to float its pins high, so acting as a weak pullup (BTST...). But this is no reliable communication. Perhaps even attaching a scope disturbs the line levels enough to make communication fail.

Reply
  • In the product specification (version 3.0), you can find in section 28.2 for master mode configuration and also table 258, that you need to configure the pull-up resistors for SDA and SCL in the GPIO peripheral manually. The TWI unit will not do this automatically.

    You need to configure the pins, before enabling the TWI, so that there can no glitches occur on these pins, which might confuse the connected TWI slaves.

    Perhaps one of your slaves has a tendency to float its pins high, so acting as a weak pullup (BTST...). But this is no reliable communication. Perhaps even attaching a scope disturbs the line levels enough to make communication fail.

Children
No Data
Related