[STM32] AT24C256 hardware I2C reading and writing, based on HAL library

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 […]

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. […]

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 […]