I2C (Inter-Integrated Circuit) bus is a two-wire serial bus developed by PHILIPS, which is used to connect microcontrollers and their peripheral devices. It is a serial bus composed of data line SDA and clock SCL, which can send and receive data.
Each device connected to the I2C bus has a unique address. Data transmission between the host and other devices can be done by the host sending data to other devices. In this case, the host is the transmitter, and the device receiving data on the bus is the receiver.
Bidirectional transmission is carried out between the CPU and the controlled IC, and between ICs. The high-speed IIC bus can generally reach more than 400kbps. There are three types of signals in the I2C bus during data transmission, namely: start signal, end signal and response signal.
Start signal: When SCL is high, SDA jumps from high level to low level to start data transmission.
End signal: When SCL is high, SDA jumps from low level to high level to end data transmission.
Response signal: After receiving 8-bit data, the IC receiving data sends a specific low-level pulse to the IC sending data, indicating that the data has been received. After the CPU sends a signal to the controlled unit, it waits for the controlled unit to send a response signal. After receiving the response signal, the CPU makes a judgment on whether to continue to transmit the signal based on the actual situation. If the response signal is not received, it is judged that the controlled unit has a fault. Among these signals, the start signal is required, while the end signal and the response signal are optional.
Code:
(1) Start signal
Void I2CStart(void)
{
SomeNop() ;
SCL = 1;
SomeNop() ;
SDA = 0;
SomeNop() ;
SCL = 0;
SomeNop() ;
}
(2) Termination signal
void I2cStop(void)
{
SDA = 0;
SomeNop() ;
SCL = 1;
SomeNop() ;
SDA = 1;
SomeNop() ;
SCL = 0;
}
Previous article:I2C bus learning (Part 2) -- data transmission format
Next article:Several important block diagrams of Cortex-M3
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- MSP432 MCU takes advantage of real-time operating systems
- M12 Gigabit Ethernet Pinout
- The Impact of IoT on Energy Efficiency
- [ESK32-360 Review] + A/D Conversion and Application
- Last three days! Free evaluation of Nanxin SC8905! Intimately match I2C tools, power supply to play ~
- [Project source code] Design and implementation of traffic lights based on FPGA
- Detailed explanation of comprehensive knowledge of PCB design and wiring using Bluetooth speakers as an example
- [National Technology N32G457 Review] MP3 voice module based on serial communication and serial screen control
- ON Semiconductor RSL10 Bluetooth Development Board Experience
- 【GD32L233C-START Review】7. PWM LED Driver