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

TWI clock pull up

The data sheet recommends that both the TWI clock and data lines use pull ups and the GPIOs should be set to S0D1, essentially open collector drive. I can see the need for this on the data line, but if my I2C device does not do any clock stretching, is it safe to omit the pullup on the clock line and set the GPIO to S0S1?

I have tried this on my board and have seen no ill effects.

Parents
  • You need to have some pull-up resistors on the lines. The lines on TWI (or i2c) are "open drain", meaning that they can only be driven low. If you omit the pull-up resistors, the line will float when it is not driven low.

    Since the lines can only be driven low you should use S0D1.

    The internal pull-up on nRF51 is about 13KOhm. This is a bit too high for TWI and will give problems when running at 400KHz (the clock will be skewed due to the RC circuit the lines create). Recommended pull-up is about 4.7KOhm.

    EDIT 2016.09.12:

    You should not use S0S1. Then you will have a short when the slave pulls the line low for ACK. The configuration should be as defined in the Reference Manual:

    image description

Reply
  • You need to have some pull-up resistors on the lines. The lines on TWI (or i2c) are "open drain", meaning that they can only be driven low. If you omit the pull-up resistors, the line will float when it is not driven low.

    Since the lines can only be driven low you should use S0D1.

    The internal pull-up on nRF51 is about 13KOhm. This is a bit too high for TWI and will give problems when running at 400KHz (the clock will be skewed due to the RC circuit the lines create). Recommended pull-up is about 4.7KOhm.

    EDIT 2016.09.12:

    You should not use S0S1. Then you will have a short when the slave pulls the line low for ACK. The configuration should be as defined in the Reference Manual:

    image description

Children
No Data
Related