最后更新:2022-05-23 14:36:21 手机定位技术交流文章
目录
前言
IIC子函数
IIC_Start
IIC_Stop
IIC_Wait_Ack
IIC_ACK
IIC_NACK
IIC_Send_Byte
IIC_Read_Byte
AT24C02 分功能
WriteOneByte
ReadOneByte
AT24C02_Check
在数据传输期间,I2C总线产生三种信号:启动信号、终端信号和响应信号。
启动信号:SCL高,SDA从高向低,数据正在发送。
终端信号:SCL高空,自失能系统从低到高到终端数据传输
反应信号:收到8比特数据后,接收者IC将特定低高度脉冲传送到发送IC,信号接收。
当SSCL是免费和高, 数据传输开始。
SDA有一个低ACK(启动)和一个高NACK(停止)。

START CONDITION: A high-to-low transition of SDA with SCL high is a start conditionwhich must precede any other commandSSL高空和自失能装置高到低转换是一个起始条件,必须先有任何其他命令。
STOP CONDITION: A low-to-high transition of SDA with SCL high is a stop condition.After a read sequence, the stop command will place the EEPROM in a standby powermode。停止条件:在 SCL 将自失能装置从低到高转换为高是一个停止条件。停止指令,并在读取序列后将EEPROM置于备用动力模式中。
ACKNOWLEDGE: All addresses and data words are serially transmitted to and fromthe EEPROM in 8-bit words. The EEPROM sends a “0” to acknowledge that it hasreceived each word. This happens during the ninth clock cycle.ACKNODLATION: 将所有地址和数据单词传送到 EEPROM 时共使用了8个字串。 EEPROM 在第九钟周期内传送0个字,以表明它收到每个单词。

ACK 和 NACK 信号
ACKNOWLEDGE: All addresses and data words are serially transmitted to and fromthe EEPROM in 8-bit words. The EEPROM sends a “0” to acknowledge that it hasreceived each word. This happens during the ninth clock cycle.ACKNODLATION: 将所有地址和数据单词传送到 EEPROM 时共使用了8个字串。 EEPROM 在第九钟周期内传送0个字,以表明它收到每个单词。因此,短链氯化石蜡从低升到高,自失能装置降低到ACK,自失能装置增加到NACK。




写入指定长度的数据

读取指定长度的数据
在程序开始时,请检查硬件上是否有 AT24C02, 或它能否读写 。
本文由 在线网速测试 整理编辑,转载请注明出处。