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

NRF52832 TWI at 50 KHz (SMBus Compatibility)

I am running the NRF52832 (BMD-300 module) and I'm trying to talk to battery over SMBus. SMBus is compatible with devices up to 100 KHz.

I was wondering if there was a way to talk to an I2C device on the NRF52832 with a lower clock rate than the 100 KHz rate given in the TWI library.

I see here that the frequency is not configurable beyond 3 predefined clock rates, 100K, 250K, and 400K. infocenter.nordicsemi.com/index.jsp

What I'm experiencing is inconsistent readings between my battery and board. I have about a 60% success rate when reading. The battery manufacturer stressed that I need to be SMBus compliant, not just I2C. They suggested that I use a slower clock rate than 100 KHz.

I was wondering if anyone out there knew if it was possible to use a slower clock rate for I2C communication using the NRF52832?

Thanks,

Greg

Parents
  • Hi,

    The formula for calculating the frequency vs the register values is more complicated than one might think. This is partly due to how the algorithm handles rounding errors, and partly because it relies on how you configure the TWI. In other words, it is not as simple as just dividing a fixed master clock frequency with a register value. Furthermore, if you read the TWIM's electrical specifications you will see that it is specced between 100k and 400kHz. However, this doesn't mean that it wont work at all outside these boundaries, but Nordic has not tested it and therefore gives no guarantees. That being said, halving the register values as RK suggest will probably get you close to 50kHz (I haven't tried), but if you do this you are doing so at your own discretion.

Reply
  • Hi,

    The formula for calculating the frequency vs the register values is more complicated than one might think. This is partly due to how the algorithm handles rounding errors, and partly because it relies on how you configure the TWI. In other words, it is not as simple as just dividing a fixed master clock frequency with a register value. Furthermore, if you read the TWIM's electrical specifications you will see that it is specced between 100k and 400kHz. However, this doesn't mean that it wont work at all outside these boundaries, but Nordic has not tested it and therefore gives no guarantees. That being said, halving the register values as RK suggest will probably get you close to 50kHz (I haven't tried), but if you do this you are doing so at your own discretion.

Children
Related