
Recover a Stuck I2C Bus by Clocking Out Nine SCL Pulses at Startup
Free an I2C slave holding SDA low after a reset by clocking SCL up to nine times and sending a stop, with a tested C routine and the reason for nine.
Everything you need to level up your coding skills.

Free an I2C slave holding SDA low after a reset by clocking SCL up to nine times and sending a stop, with a tested C routine and the reason for nine.

Use HAL_I2C_Mem_Read and HAL_I2C_Mem_Write on STM32 for sensor and EEPROM registers: shifted address, memory address size, timeouts and errors.

Create an I2C bus with i2c_new_master_bus, attach a device with i2c_master_bus_add_device, and read registers with i2c_master_transmit_receive in ESP-IDF 5.3.

Read a TMP102 sensor on a Raspberry Pi Pico with i2c_init, i2c_write_blocking and i2c_read_blocking, using nostop for the repeated start.

Write an Arduino I2C scanner with Wire.beginTransmission and endTransmission, read the error codes and fix the usual reasons a device does not appear.

Replace hand-written register accessors with regmap: one config for I2C or SPI, read and write, update_bits, caching and a debugfs register dump on Linux 6.12.

A superloop is fine until timing, blocking calls and feature count collide. See the signs that bare-metal firmware needs an RTOS and when it still does not.

See how an I2C address byte is built, what ACK and NACK mean at each byte, why a slave holds SCL low, and how to avoid the 7-bit versus 8-bit mix-up.

Build a complete I2C client driver for a TMP102-style sensor on Linux 6.12: id tables, probe, SMBus reads, a sysfs attribute, device tree node and test output.

Make a microcontroller a class-compliant USB MIDI device with TinyUSB: the 4-byte event packet, note and control change messages, and receiving from the host.

Run a USB CDC serial port on the ESP32-S3 native USB pins with esp_tinyusb in ESP-IDF 5, and know what happens to the built-in USB serial and JTAG.

Expose an SPI device as /dev/spidevB.C, set mode, speed and word size with ioctl, and run full-duplex transfers with SPI_IOC_MESSAGE in a small C program.
We send one email when a new post is published. No spam.