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.

[参考译文] CCS/TMS570LS1224:I2C 接收问题

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

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/923057/ccs-tms570ls1224-i2c-receive-issues

器件型号:TMS570LS1224
主题中讨论的其他器件:TMS5701224HALCOGEN

工具/软件:Code Composer Studio

大家好

我正在使用 tms5701224 Launch Pad 并尝试与 as5600传感器通信。

我编写了以下代码。

请帮我纠正。

i2cREG1->SAR =(0x36);
i2cREG1->MDR |=(1<<10);
i2cREG1->CNT = 1;
i2cREG1->DXR =(0x0B);
i2cREG1->MDR |=(1<<9)|(1<<13);
while (i2cREG1->STR &(1<<12));

i2cREG1->CNT = 2;
i2cREG1->MDR &=~(1<<9);

i2cREG1->MDR |=(1<<11)|(1<10)|(1<<13);
while (i2cREG1->STR & 8));
角度= i2cREG1->DRR;

while (i2cREG1->STR & 8));
angle|=(i2cREG1->DRR<<8);
while (i2cREG1->STR &(1<<12));
while (i2cREG1->MDR &(1<<10));

我还想知道如何提供重复的 START 命令。

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

    您好、Yash、

    HALCoGen 帮助下提供了几个 I2C 示例:与 I2C EEPROM、TX 和 RX 作为 I2C 主设备、TX 和 RX 作为 I2C 从设备进行通信。

    您的代码是否出现任何错误?