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

TWIM not achieving 400 kbps

I am using an nRF52832 to talk to a Melexis MLX90393 (which supports 400kpbs Fast Mode) via the TWIM interface. I am using the TWI Manager library to schedule transactions.

When I choose 400kbps for the TWIM frequency, the SCL line does not clock at 400 kHz (period of 2.5 us) as can be seen in the image below. Instead it is clocking at 200 kHz (period of 5 us).

You can see in the image as well that I am indeed setting the correct value for frequency in the configuration struct passed to nrf_twi_mngr_init(). I have also verified that the FREQUENCY register for the TWIM peripheral (located at 0x40003524) does in fact contain the value 0x06400000.

When I choose 250K or 100K for the TWIM frequency, I indeed see the SCL line run at 250 kHz and 100 kHz respectively.

What can I do to get the 400kbps rate.

Parents Reply
  • That did the trick! Thank you!

    I have just one follow-up question. I plan to put the nRF52832 and two I2C sensors (one of which is the MLX90393 mentioned above) on a custom PCB. Since I now know I need to put external pull-up resistors on the PCB, is 4.7kOhm still a good choice, or would it be a good idea to account for the resistance already there from the internal pull-up resistors that are configured to be active by the driver?

Children
Related