annqian 发表于 2018-12-11 14:52:03

STM32F407 I2C 模块BTF位的问题?

If the RxNE bit is set and the data in the DR register is not read before the end of the last
data reception, the BTF bit is set by hardware and the interface waits until BTF is cleared by
a read in the DR register, stretching SCL low.

这个BTF位在主接收模式下,为什么在判断RXNE 等于1后,读DR的数,然后判断BTF是否为1,为1 的话再读一次DR。WHY?

MrJiu 发表于 2018-12-11 17:15:24

ST的I2C硬件从来没用过,自从STM8上面调通I2C后发现,使用起来真的是生不如死,后面就一直在ST芯片上面用模拟的。。。至于读DR,一般是为了清除标志位,你可以看看参考手册上面的介绍

annqian 发表于 2018-12-12 08:46:50

谢谢。

stm1024 发表于 2018-12-12 08:51:41

STM的很多外设,如USART等,都要通过读DR清除相应的标志位。
页: [1]
查看完整版本: STM32F407 I2C 模块BTF位的问题?