Table of Contents 1. Brief introduction 2. Configuration project Open CubeMX, configure clock, debugging interface, project name, directory, etc. Configure iic Configure the serial port to display information 3. Hardware connection 4. Code writing 1. Write a byte randomly test code The waveform is as follows Code writing 2. Continuous writing code show as below […]
Tag: i2c
STM32F103C8T6+I2C+DMA read gyroscope module JY901S (hardware I2C
1.Background The author once used the 6-axis gyroscope module mpu6050 module and found that there was a serious zero drift problem. I also checked many methods on the Internet, such as delay, etc., but they could not solve the problem, so I attributed the problem to the fact that the module only has 6 axes. […]
STM32F4X I2C LM75
STM32F4X I2C LM75 I2C protocol explanation I2C wiring I2C protocol waveform I2C start signal I2C stop signal I2C response signal I2C addressing I2C address format I2C data transfer LM75A LM75A Introduction LM75A pin description LM75A address LM75A register LM75A I2C protocol Write configuration register Read configuration register Write Tos and Thyst registers Read Tos Thyst […]
i2c driver scan registration
https://blog.csdn.net/uunubt/article/details/127959575 i2c driver scan registration As mentioned in the “i2c device and driver matching process”, the i2c driver will use two matching methods to find the i2c device when registering. The code is as follows: struct bus_type i2c_bus_type = { .name = “i2c”, .match = i2c_device_match, .probe = i2c_device_probe, .remove = i2c_device_remove, .shutdown = i2c_device_shutdown, […]
51 microcontroller–I2C–eeprom
/**************** I2C communication EEPROM (AT24C02) (not lost when power is lost) ************************ **/ /* 1. EEPROM and its background knowledge 1.1 ROM (read-only memory – hard disk), RAM (random access memory – computer memory), PROM (reprogrammable rom), EPROM (erasable rom), EEPROM (electrically erasable rom) 1.2 Why eeprom is needed—- The ROM inside the microcontroller can […]
[Communication Protocol] Concept, composition and code implementation of I2C communication
One concept What is it? Two synchronous serial buses (data line SDA and clock line SCL) What’s the use? Transmit data, control signals, etc. serially How to use it? Using these two lines, the corresponding communication protocol is applied so that data can be transmitted between the two devices. In practical applications, the implementation of […]
STM32 I2C (4) hardware reading and writing MPU6050
STM32 I2C (4) hardware reading and writing MPU6050 Programming ideas The first step is to configure the I2C2 peripherals and initialize the I2C2 peripherals. Turn on the clock of the I2C peripheral and the corresponding GPIO port Initialize the GPIO port corresponding to the I2C peripheral to the multiplexed open-drain mode Use structures to configure […]
[MCU] 14-I2C communication EEPROM
1.EEPROM concept 1.EEPROM 1.1 Some concepts (1) Some concepts: ROM [read-only memory—hard disk], RAM [random access memory–memory], PROM [programmable ROM], EPROM [erasable ROM],EEPROM [electrically removable Erase ROM] 1.2 Why EEPROM is needed The ROM inside the microcontroller can only be erased and rewritten when the program is downloaded, but the program itself cannot be rewritten. […]
CH34X-MPHSI high-speed Master expansion application-I2C device debugging
1. Foreword This article introduces how to expand the I2C bus for the system based on the USB2.0 high-speed USB adapter chip CH347 and the USB to MPHSI (Multi Protocol High-Speed Serial Interface) Master bus driver (CH34X-MPHSI-Master) provided by the manufacturer. In addition, In addition, resources such as SPI bus and GPIO can also be […]
STM32 I2C (2) software I2C reading and writing MPU6050
STM32 I2C (2) software I2C reading and writing MPU6050 Overall program structure Since this code uses software I2C, which is a protocol implemented using ordinary GPIO ports and manual level flipping, it does not require support from peripheral resources within STM32, so the SCL and SDA ports can actually be specified arbitrarily and connected to […]