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.
您好!
在 InitI2C 中的许多代码中设置时钟分频器寄存 器:
I2caRegs.I2CCLKL = 10;
I2caRegs.I2CCLKH=5;
为什么是10和5? 如何计算并选择适当的设置?
2.我已准备好与 i2c 通信,例如,在 main()中
I2C_Write (0x70、Register_2D、0x0E);
I2C_READ (0x70、Register_2D);
I2C_READ (0x13、Register_X0);
当我使用具有断点的调试模式和逐步执行程序 时、一切正常、但如果程序在没有断点的情况下工作、i2c 在 步骤上停止
while (I2cRegs.I2CMDR.bit.STP = 1);或 while (I2cRegs.I2CSTR.bit.BB = 1);
我认为 这种情况是这样的、因为程序工作得太快、但我不知道如何解决它。 哪一个参数负责该操作? 我想在 I2C_Write 和 I2C_Read 之间使用计时器设置中断、但这不是一个好解决方案、
感谢你的帮助