Skip to content

Appendix A: Annotated References

The numbers in the appendix and the MicroSims come from these sources.

The Bus Itself

  1. UM10204: I2C-bus specification and user manual, Rev. 7.0 - NXP Semiconductors, 1 October 2021. The official definition of I2C. Revision 7.0 replaced "master/slave" with "controller/target". It lists the reserved addresses (0000 XXX and 1111 XXX). It gives the bit rates: 100 kbit/s standard mode, 400 kbit/s fast mode and 1 Mbit/s fast-mode plus.
  2. I2C (Wikipedia) - a readable overview of the history, the open-drain design and the protocol.
  3. I2C tutorial (SparkFun) - a beginner-friendly walk through START, addresses, ACKs and pull-ups.

Programming the Bus

  1. machine.I2C (MicroPython documentation) - defines I2C(id, scl=, sda=, freq=400000), scan() (all addresses from 0x08 to 0x77; a device responds if it pulls SDA low after its address and write bit), readfrom_mem() and writeto_mem().
  2. Raspberry Pi Pico Python SDK - the Pico's two I2C controllers and which pins they can use.

The Devices

  1. MPU-6000 and MPU-6050 Register Map and Descriptions (document RM-MPU-6000A-00, Rev. 4.2) - InvenSense. The registers used here: PWR_MGMT_1 (0x6B), WHO_AM_I (0x75), ACCEL_XOUT_H (0x3B), GYRO_XOUT_H (0x43) and INT_PIN_CFG (0x37). The maker no longer hosts it at its old address, so search for the document number. A practical summary is on the Arduino Playground MPU-6050 page.
  2. HMC5883L 3-Axis Digital Compass IC datasheet - Honeywell. 7-bit address 0x1E (8-bit 0x3C write and 0x3D read). Data registers 0x03 to 0x08 in X, Z, Y order with the high byte first. Default gain of 1,090 counts per gauss. Default mode is single measurement.
  3. GY-271 module is not the HMC5883L (Arduino Forum) - a user finds out by scanning that a "GY-271" board answers at 0x0D, because it carries a QMC5883L.
  4. Pololu VL53L0X library - open-source driver code. It shows the identification register (0xC0, value 0xEE) and the 16-bit range result read from register 0x14 + 10 = 0x1E. Also see the Adafruit VL53L0X guide.
  5. INA219 datasheet - Texas Instruments. Default address 0x40 (A0 and A1 grounded). Shunt voltage is 10 microvolts per step. Bus voltage is 4 millivolts per step in bits 15 to 3 (shift right by 3 first). The Adafruit INA219 guide covers the breakout board and its address jumpers.
  6. SSD1306 datasheet - Solomon Systech. The OLED controller, including the I2C control byte (0x00 for commands, 0x40 for pixel data) and the page-based memory behind the 1,024-byte picture.

Sensor Fusion

  1. Sensor fusion (Wikipedia) - why and how measurements from several sensors are combined.
  2. Kalman filter (Wikipedia) - the more powerful relative of the complementary filter used in this appendix.