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

does nRF51 has optional internal pullup resistors on some pins?

I'm working with nrf51 board, I'm using I2C to communicate with an accelerometer (see the scheme), the communications are successful but I dont see any pull up resistors in the lines SDA and SCL.

could I2C work without pull-up resistors or is the scheme wrong or does the accelerometer has internal pull up on lines SDA and SCL

this answer is saying that the pull-ups are probably in the microcontroller, is this right?

check better scheme on attachementSCH B115C2_AL_VC1_38L_DSN_20150804.pdf

image descriptionas

  • Hi, in the SDK 9.x in the section GPIO abstraction you will find some information about enabling/disabling the internal pullup resistors:

    enum nrf_gpio_pin_pull_t
    // Enumerator used for selecting the pin to be pulled down or up at the time of pin configuration.
    
    NRF_GPIO_PIN_NOPULL -> Pin pullup resistor disabled.
    NRF_GPIO_PIN_PULLDOWN -> Pin pulldown resistor enabled.
    NRF_GPIO_PIN_PULLUP -> Pin pullup resistor enabled.
    

    A Ohm-value about the internal resistors, I could not find.

    HTH Johannes

  • Hi

    The nRF51 has 13 kOhm internal pull-ups available on all GPIO pins (see Chapter 8.23 in the Product spec V3.1). These pull-ups are enabled by default in the TWI drivers found in the SDKs. So, in other words, if you use the drivers you will at least have 13 kOhm pull-ups on your TWI lines. However, 13 kOhm is in the higher end of what is common pull-up values used on TWI lines and, dependent on your desired transmission frequency, I might recommend using external pull-ups as well. Here is a screenshot of two tests I did:

    image description

    In the first test I used the internal 13 kOhm pull-ups only and in the second test I used 2.2 kOhm external pull-ups as well. Hence, the effective total pull-up resistor value is ~1.8 kOhm. The transmission frequency is 400 kHz and the code and other TWI parameters are exactly the same in both tests. As you can see, using only the internal pull-ups has a major effect on the transmission speed. The high resistance actually cuts the speed in half as the rise time becomes so long. Using external resistors as well works flawlessly. What values you should use depends on your application, desired transmission speed, capacitance between your TWI lines and GND, etc. Here is a link to the I2C specification. You will find a link to a PDF on the bottom of the page where you can find the relevant formulas. i2c.info/i2c-bus-specification

Related