51 MCU Series Serial 12 - Serial Bus

Publisher:龙腾少年Latest update time:2015-09-10 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
Today we will introduce the I2C serial bus. Compared with some of the previous content, this one is relatively difficult to understand. There are many commonly used serial buses, and now we will only briefly talk about the I2C bus.

 

The I2C bus is a serial bus launched by PHLIPS. It is a high-performance serial bus with bus arbitration and high- and low-speed device synchronization functions required by multi-host systems. 


    The I2C bus has only two bidirectional signal lines, one is the data line SDA, and the other is the clock line SCL.

 

51 MCU Series Serial 12 - Serial Bus

   

The I2C bus is connected to the positive power supply through a pull-up resistor. When the bus is idle, both lines are high. A low level output by any device connected to the bus will make the bus signal low, that is, the SDA and SCL of each device are in a line "AND" relationship.

 

51 MCU Series Serial 12 - Serial Bus

   When the I2C bus is transmitting data, the data on the data line must remain stable while the clock signal is at a high level. The high or low level state of the data line is allowed to change only when the signal on the clock line is at a low level.

 

51 MCU Series Serial 12 - Serial Bus

 

When the SCL line is at a high level, the change of the SDA line from a high level to a low level indicates a start signal; when the SCL line is at a high level, the change of the SDA line from a low level to a high level indicates a stop signal.

 

51 MCU Series Serial 12 - Serial Bus

    The start and stop signals are both sent by the host. After the start signal is generated, the bus is in an occupied state; after the stop signal is generated, the bus is in an idle state. If the device connected to the I2C bus has a hardware interface for the I2C bus, it is easy to detect the start and stop signals.


    After receiving a complete data byte, the receiving device may need to complete some other work, such as processing internal interrupt services, and may not be able to receive the next byte immediately. At this time, the receiving device can pull the SCL line to a low level, so that the host is in a waiting state. When the receiving device is ready to receive the next byte, the SCL line is released to a high level, so that data transmission can continue. 

That’s basically it, the most important thing is practice.

Reference address:51 MCU Series Serial 12 - Serial Bus

Previous article:51 single chip ultrasonic distance measurement C program
Next article:51 MCU Series Serial 11—LCD

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号