你好,
如果您可以将序列更改为litte位,则可以解决此问题。
在主Rx操作期间,当您收到2个字节时,请按照以下顺序进行操作。
1.开始条件
2.从地址LSB 0(主Tx模式)
3.从要读取的数据发送EEPROM地址。
4.发送开始条件
5. LSB 1的从机地址(主Rx模式)
6.接收第一个字节
7.在读取第1个字节之前禁用ACK
8.读取并存储第1个字节
9.接收第二个字节
10.在读取第2个字节之前启用STOP
11.读取并存储第二个字节
在你的情况下,我看到你已经交换了第8步和第7步。
这在我的计划中有效。
问候,
哈日
以上来自于谷歌翻译
以下为原文
Hello,
If you could change the sequence a litte bit, this problem can be solved.
During Master Rx operation, when you are receiving 2 bytes, please follow the below sequence.
1. Start condition
2. Slave address with LSB 0 (master Tx mode)
3. Send EEPROM address from where data to be read.
4. Send start condition
5. Slave address with LSB 1 (master Rx mode)
6. Receive 1st Byte
7. Disable ACK before reading 1st Byte
8. Read and store 1st byte
9. Receive 2nd Byte
10. Enable STOP, before reading 2nd Byte
11. Read and store 2nd byte
In you case, I see that you have swapped step 8 and 7.
This is working in my program.
Regards,
Hari
你好,
如果您可以将序列更改为litte位,则可以解决此问题。
在主Rx操作期间,当您收到2个字节时,请按照以下顺序进行操作。
1.开始条件
2.从地址LSB 0(主Tx模式)
3.从要读取的数据发送EEPROM地址。
4.发送开始条件
5. LSB 1的从机地址(主Rx模式)
6.接收第一个字节
7.在读取第1个字节之前禁用ACK
8.读取并存储第1个字节
9.接收第二个字节
10.在读取第2个字节之前启用STOP
11.读取并存储第二个字节
在你的情况下,我看到你已经交换了第8步和第7步。
这在我的计划中有效。
问候,
哈日
以上来自于谷歌翻译
以下为原文
Hello,
If you could change the sequence a litte bit, this problem can be solved.
During Master Rx operation, when you are receiving 2 bytes, please follow the below sequence.
1. Start condition
2. Slave address with LSB 0 (master Tx mode)
3. Send EEPROM address from where data to be read.
4. Send start condition
5. Slave address with LSB 1 (master Rx mode)
6. Receive 1st Byte
7. Disable ACK before reading 1st Byte
8. Read and store 1st byte
9. Receive 2nd Byte
10. Enable STOP, before reading 2nd Byte
11. Read and store 2nd byte
In you case, I see that you have swapped step 8 and 7.
This is working in my program.
Regards,
Hari
举报