当前位置:网站首页>I2C protocol

I2C protocol

2022-06-26 01:15:00 Oh, Yu è

About I2C

I2C Philips was the first company in 1982 A two-way two-wire serial bus protocol developed in . It only needs two signal lines to complete the information exchange , So far, there have been 100kHz、400kHz、1MHz、3.4MHz、5MHz Five communication rates . The final communication rate depends on the peripheral rather than the host chip .

I2C The signal line

SCL Clock line

SCL The clock line determines the communication rate , The higher the frequency is. , The faster the transmission rate , Its presence High voltage usually ,SDA Line data valid .

SDA cable

SDA The data line determines what data to transmit , High level means 1, Low level means 0. stay SCL During high level ,SDA Must be stable .

I2C sequential

  • Start flag

    SCL High voltage usually ,SDA Switch from high level to low level

  • End mark

    SCL High voltage usually ,SDA Switch from low level to high level
    I2CSTART&STOP

  • Answer flag

    SCL At high power level ,SDA keep Low level

  • Non response flag

    SCL At high power level ,SDA keep High level
    I2CACK

  • Waiting for an answer

    And answer / Same as non response , It's just a SCL Set high , Release SDA See the level of the slave

about I2C The temporal , Something to watch out for :

  1. GPIO initialization ( Hardware I2C The reuse open drain mode should be strictly used , Prevent large current backflow , The software can use the ordinary push-pull output mode , But when switching between output and input modes , Do not operate the high and low levels of the pins , In order to avoid unnecessary level )
  2. I2C The calculation of reading and writing speed should be determined MCU Clock speed 、 The maximum rate that the slave device can accept
原网站

版权声明
本文为[Oh, Yu è]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202180601035314.html