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/RM46L852:I2C 及其工作原理

Guru**** 2478765 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/691951/ccs-rm46l852-i2c-and-how-it-works

器件型号:RM46L852
主题中讨论的其他器件:HALCOGEN

工具/软件:Code Composer Studio

您好! :-)

我不熟悉 I2C、想为我的项目实施 RTC。 我的问题与 I2C 总线的输出有关。

DS3231希望我发送一个包含从器件地址的字节、一个包含寄存器地址和数据字节的字节。

当我使用 sciSend 函数(HalCoGen 为我创建的函数)时、它是否会自动发送从地址并将 R/W 位写入其中? 那么、我是否只需要发送寄存器地址和数据?

感谢您的帮助、

大家好

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

    如果只将数据写入 RTC,SEND()就可以了。 如果您想从 RTC 读回数据、则需要遵循 RTC 数据表中定义的协议。

    您可以使用 i2cSendByte (..) 为此目的:

    1。 /*配置要与*/通话的从机地址
    i2cSetSlaveAdd (i2cREG1、Slave_Add);
    2./*发送读取地址*/
    i2cSendByte (i2cREG1、Read_Add);