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.

[参考译文] TM4C1294NCPDT:I2C 模块锁定?

Guru**** 2024750 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/759920/tm4c1294ncpdt-i2c-module-locks-up

器件型号:TM4C1294NCPDT

在 I2C 模块调试期间、有时我会在错误状态下停止 I2C 通信。 当我重新加载项目并重新启动时、程序将挂起

while (I2CMasterBusy (I2C2_base));

即使是以下情况也无法使其摆脱麻烦

SysCtlPeripheralDisable (SYSCTL_Periph_I2C2);
SysCtlPeripheralReset (SYSCTL_Periph_I2C2);
SysCtlPeripheralEnable (SYSCTL_Periph_I2C2);

只有回收电源才能使其摆脱这种混乱。

启动程序时如何复位 I2C 模块?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    当从器件将 SDA 线路保持在低电平时、通常会发生这种情况。 您需要将 SCL 更改为 GPIO、并在从器件释放 SDA (SDA 读取为 GPIO 输入时变为高电平)之前将其置位。