1 year ago.

nrf52 and I2C class --not supported?

It seems the nrf52dk does not support the I2C class. Is this correct? My first attempt compiled but I didn't get so much as a wiggle on the SCL or SDA lines when I checked with my Saleae.

I thought all the mbed enabled boards were supposed to support all the classes, but my first attempt failed and the example I saw from Red Bear Lab https://os.mbed.com/teams/RedBearLab/code/I2C_Demo/ uses the native nrf I2C two wire functions.

Isn't that against the rules to be mbed enabled and not support classes like I2C? Or is that an optional class? Or is Red Bear labs just using the Nordic I2C drivers because they want to?

My rnf52dk based project controls I2C devices . Maybe, you forgot pullup resistors?

posted by Kentaro Okuda 19 Oct 2018

That is good news. You are using the mbed I2C class? I must have the wrong firmware or soft device or something. I'll try reloading the requisite bootloaders and soft devices. I always include pullups on my sensor board so thankfully that isn't the issue. Can you share a link to your project?

posted by Dan Allen 19 Oct 2018
Comment on this question

1 Answer

11 months, 2 weeks ago.

Hi Dan,

Just to follow-up on what Kentaro said... Mbed does support the I2C on the nRF52 targets and the underlying HAL is here:

If you consult the Nordic documentation they reference the I2C as a two-wire interface (TWI). If you have the pull-ups implemented please double-check the pins you are using. On the nRF52_DK, I2C_SDA0 and I2C_SCL0 are mapped to pins 26 and 27 (p26, p27):

Regards,

Ralph, Team Mbed


You need to log in to post a question