The Book of I²C

A Guide for Adventurers

Look inside
Paperback
$49.99 US
On sale Oct 11, 2022 | 440 Pages | 9781718502468

See Additional Formats
An extensive practical guide to connecting real-world devices to microcontrollers with the popular I2C bus.

If you work with embedded systems, you’re bound to encounter the ubiquitous Inter-Integrated Circuit bus (IIC or I2C) – a serial protocol for connecting integrated circuits in a computer system. In The Book of I2C, the first comprehensive guide to this bus, bestselling author Randall Hyde draws on 40 years of industry experience to get you started designing and programming I2C systems. 

Aided by over 100 detailed figures and annotated source-code listings, you’ll learn the I2C implementations of systems like Arduino, Teensy, and Raspberry Pi, as well as variants of the I2C and common I2C peripheral ICs complete with programming examples. For hardware hackers, electronics hobbyists, and software engineers of every skill level, the extensive coverage in this book will make it a go-to reference when it comes to connecting real-world devices to I2C microcontrollers.
Introduction
Chapter 1: I2C Low-Level Hardware
Chapter 2: I2C Protocol
Chapter 3: A Software Implementation of the I2C Bus
Chapter 4: Analyzing and Debugging I2C Transmissions
Chapter 5: I2C Variants
Chapter 6: I2C on Common Single-Board Computers
Chapter 7: I2C on Vendor Buses
Chapter 8: Arduino I2C Programming
Chapter 9: Raspberry Pi (and Linux) I2C Programming
Chapter 10: I2C Programming in Real-Time Operating Systems
Chapter 11: Bare-Metal I2C Controller Programming
Chapter 12: The TCA9548A I2C Bus Expander
Chapter 13: The MCP23017 and MCP23008 GPIO Expanders
Chapter 14: The ADS1015/ADS1115 Analog-to-Digital Converters
Chapter 15: The MCP4725 Digital-to-Analog Converter
Chapter 16: Bare-Metal Peripheral Programming
Appendix A: Glossary
Appendix B: The Adafruit I2C Address Compilation
Appendix C: Online Chapters
Randall Hyde is the author of The Art of Assembly Language and Write Great Code, Volumes 1, 2, and 3 (all from No Starch Press), as well as Using 6502 Assembly Language and P-Source (Datamost). He is also the coauthor of Microsoft Macro Assembler 6.0 Bible (The Waite Group). Over the past 40 years, Hyde has worked as an embedded software/hardware engineer developing instrumentation for nuclear reactors, traffic control systems, and other consumer electronics devices. He has also taught computer science at California State Polytechnic University, Pomona, and at the University of California, Riverside. His website is http://www.randallhyde.com.

About

An extensive practical guide to connecting real-world devices to microcontrollers with the popular I2C bus.

If you work with embedded systems, you’re bound to encounter the ubiquitous Inter-Integrated Circuit bus (IIC or I2C) – a serial protocol for connecting integrated circuits in a computer system. In The Book of I2C, the first comprehensive guide to this bus, bestselling author Randall Hyde draws on 40 years of industry experience to get you started designing and programming I2C systems. 

Aided by over 100 detailed figures and annotated source-code listings, you’ll learn the I2C implementations of systems like Arduino, Teensy, and Raspberry Pi, as well as variants of the I2C and common I2C peripheral ICs complete with programming examples. For hardware hackers, electronics hobbyists, and software engineers of every skill level, the extensive coverage in this book will make it a go-to reference when it comes to connecting real-world devices to I2C microcontrollers.

Table of Contents

Introduction
Chapter 1: I2C Low-Level Hardware
Chapter 2: I2C Protocol
Chapter 3: A Software Implementation of the I2C Bus
Chapter 4: Analyzing and Debugging I2C Transmissions
Chapter 5: I2C Variants
Chapter 6: I2C on Common Single-Board Computers
Chapter 7: I2C on Vendor Buses
Chapter 8: Arduino I2C Programming
Chapter 9: Raspberry Pi (and Linux) I2C Programming
Chapter 10: I2C Programming in Real-Time Operating Systems
Chapter 11: Bare-Metal I2C Controller Programming
Chapter 12: The TCA9548A I2C Bus Expander
Chapter 13: The MCP23017 and MCP23008 GPIO Expanders
Chapter 14: The ADS1015/ADS1115 Analog-to-Digital Converters
Chapter 15: The MCP4725 Digital-to-Analog Converter
Chapter 16: Bare-Metal Peripheral Programming
Appendix A: Glossary
Appendix B: The Adafruit I2C Address Compilation
Appendix C: Online Chapters

Author

Randall Hyde is the author of The Art of Assembly Language and Write Great Code, Volumes 1, 2, and 3 (all from No Starch Press), as well as Using 6502 Assembly Language and P-Source (Datamost). He is also the coauthor of Microsoft Macro Assembler 6.0 Bible (The Waite Group). Over the past 40 years, Hyde has worked as an embedded software/hardware engineer developing instrumentation for nuclear reactors, traffic control systems, and other consumer electronics devices. He has also taught computer science at California State Polytechnic University, Pomona, and at the University of California, Riverside. His website is http://www.randallhyde.com.

Three Penguin Random House Authors Win Pulitzer Prizes

On Monday, May 5, three Penguin Random House authors were honored with a Pulitzer Prize. Established in 1917, the Pulitzer Prizes are the most prestigious awards in American letters. To date, PRH has 143 Pulitzer Prize winners, including William Faulkner, Eudora Welty, Josh Steinbeck, Ron Chernow, Anne Applebaum, Colson Whitehead, and many more. Take a look at our 2025 Pulitzer Prize

Read more

Books for LGBTQIA+ Pride Month

In June we celebrate Lesbian, Gay, Bisexual, Transgender, Queer, Intersex, and Asexual + (LGBTQIA+) Pride Month, which honors the 1969 Stonewall riots in Manhattan. Pride Month is a time to both celebrate the accomplishments of those in the LGBTQ+ community and recognize the ongoing struggles faced by many across the world who wish to live

Read more