原理图如下:(可以帮忙核对下原理图是否有问题?)
1) 依据原理图器件IDX引脚确定I2C器件地址为:0x32
2) 初始化STM32(使用IO口虚拟I2C协议)
3) 依据器件读时序读寄存器数据
读Device ID Register(0x00),器件返回0x00
读Device status register(0x04),器件返回0x01
问题:整个读取按照时序操作,返回值不对,问题不知道出在哪里?帮忙分析一下。
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
您好,上电时序是按照datasheet 9.2 Power-Up Sequencing的时序吗? 建议用示波器测量下上电时序。
0x32是7bit从机地址,即7bit为0110010,但实际上是左移一位,第八位为读写位,0=write,1=read。
所以地址不要写0x32, 应该为0x64. 您写0x32,应该是收不到ACK信号的?可以用示波器测量下时序。
主机发出寻址命令之后,从机是否有应答信号,有应答信号才可以继续往下配置寄存器或者进行读写。
再试试。