I2C 总线问题

背景

在通过I2C读SFP 模块的时候发现读到数据不对,现象是感觉丢掉了几个bit。

调查

通过测试波形,发现异常。

原因

有经验的同事指出是I2C 的stretching。
简单说:从设备跟不上主设备的速度,想要跑慢一点。就可以通过拉低住时钟信号来实现。

In an I2C communication, the master device determines the clock speed. Unlike RS232 the I2C bus provides an explicit clock signal which relieves master and slave from synchronizing exactly to a predefined baud rate.
However, there are situations where an I2C slave is not able to co-operate with the clock speed given by the master and needs to slow down a little. This is done by a mechanism referred to as clock stretching.
An I2C slave is allowed to hold down the clock if it needs to reduce the bus speed. The master, on the other hand, is required to read back the clock signal after releasing it to the high state and wait until the line has actually gone high.

搜索相关资料:
I2C Clock Stretch
clock-stretching/

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容