Book description
If you work with embedded systems, youâ??re bound to encounter the ubiquitous Inter-Integrated Circuit bus (IIC, I2C, or I²C)â??a serial protocol for connecting integrated circuits in a computer system. In The Book of I²C, 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 I²C systems.
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â??whether you need an overview of I²C signal protocols, an introduction to variants of the I²C, like the SMBus and VESA E-DCC, or programming examples for common I²C peripheral ICs. Youâ??ll also learn the I²C implementations of the Arduino, Teensy, and Raspberry Pi systems among others, as well as how to:
�Analyze and debug I²C bus transactions
�Program devices on the I²C
�Implement an I²C with bare-metal programming
�Work with I²C bus expanders
The Book of I²C includes over 100 figures and many annotated source code listings, along with online chapters that will be updated to include new controllers and peripherals.
Table of contents
- Title Page
- Copyright
- Dedication
- About the Author
- Acknowledgments
- Introduction
-
Part I: Low-Level Protocols and Hardware
-
Chapter 1: I2C Low-Level Hardware
- 1.1 I2C Overview
- 1.2 Open-Drain (Open-Collector) Logic and Four-Wire Mode
- 1.3 I2C Signal Levels
- 1.4 Choosing Pullup Resistor Sizes
- 1.5 Bus Capacitance and Pullup Resistor Values
- 1.6 I2C Bus Speeds
- 1.7 Multicontroller I2C Bus Clock Synchronization
- 1.8 Multicontroller I2C Bus Arbitration
- 1.9 Clock Stretching
- 1.10 Cross Talk
- 1.11 Chapter Summary
- Chapter 2: I2C Protocol
- Chapter 3: A Software Implementation of the I2C Bus
- Chapter 4: Tools for Analyzing and Debugging I2C Transmissions
- Chapter 5: I2C Variants
-
Chapter 1: I2C Low-Level Hardware
-
Part II: Hardware Implementations
-
Chapter 6: I2C On Common Single-Board Computers
- 6.1 The Arduino Family
- 6.2 Adafruit Single-Board Computers
- 6.3 SparkFun Single-Board Computers
- 6.4 The Teensy Family
- 6.5 Other Arduino-Compatible Single-Board Computers
- 6.6 The Raspberry Pi
- 6.7 The Raspberry Pi Pico
- 6.8 The BeagleBone Black
- 6.9 The PINE A64 and ROCKPro64
- 6.10 The Onion Omega
- 6.11 The STM32 Single-Board Computer Family
- 6.12 The NetBurner MOD54415
- 6.13 I2C on the Personal Computer
- 6.14 Chapter Summary
- Chapter 7: I2C On Vendor Buses
-
Chapter 6: I2C On Common Single-Board Computers
-
Part III: Programming the I2c Bus
- Chapter 8: Arduino I2C Programming
-
Chapter 9: Raspberry Pi (and Linux) I2C Programming
- 9.1 The I2C Bus Pins on the Pi General-Purpose Input/Output Header
- 9.2 Manually Activating the I2C Buses
- 9.3 Changing the I2C Clock Frequency
- 9.4 I2C Clock Stretching Issues and Solutions
- 9.5 Raspberry Pi OS (Linux) I2C Utilities
- 9.6 Reading and Writing I2C Data
-
9.7 Advanced I2C Kernel Calls
- 9.7.1 The i2c-dev Functions
- 9.7.2 The i2c_smbus_write_quick Function
- 9.7.3 The i2c_smbus_read_byte Function
- 9.7.4 The i2c_smbus_write_byte() Function
- 9.7.5 The i2c_smbus_read_byte_data() Function
- 9.7.6 The i2c_smbus_write_byte_data() Function
- 9.7.7 The i2c_smbus_read_word_data() Function
- 9.7.8 The i2c_smbus_write_word_data() Function
- 9.7.9 The i2c_smbus_read_block_data() Function
- 9.7.10 The i2c_smbus_write_block_data() Function
- 9.7.11 Miscellaneous Functions
- 9.8 Reentrancy Issues with I2C Operations
- 9.9 Multicontroller Operation Under Linux
- 9.10 Other Linux Systems
- 9.11 Using the Raspberry Pi as an I2C Peripheral Device
- 9.12 Chapter Summary
- Chapter 10: I2C Programming in Real-Time Operating Systems
- Chapter 11: Bare-Metal I2C Controller Programming
-
Part IV: I2c Peripheral Programming Examples
- Chapter 12: The TCA9548A I2C Bus Expander
-
Chapter 13: The MCP23017 and MCP23008 GPIO Expanders
- 13.1 The MCP23017 and MCP23008 Pinouts
-
13.2 MCP230xx Registers
- 13.2.1 Accessing MCP230xx Registers
- 13.2.2 MCP230xx Initialization
- 13.2.3 Programming the Data Direction
- 13.2.4 Programming Input Pullup Resistors
- 13.2.5 Programming the Input Polarity
- 13.2.6 Sequential Register Operations
- 13.2.7 Slew Rate Control
- 13.2.8 Reading General-Purpose Input/Output Pins on the MCP230xx
- 13.3 Writing General-Purpose Input/Output Pins on the MCP230xx
- 13.4 Demonstrating Input/Output on an MCP23017
- 13.5 Interrupts on the MCP230xx
- 13.6 A Sample Interrupt-Driven MCP230xx
- 13.7 MCP230xx Library Code
- 13.8 I2C Performance
- 13.9 MCP23Sxx Parts
- 13.10 Chapter Summary
-
Chapter 14: The ADS1015 and ADS1115 Analog-to-Digital Converters
- 14.1 Analog-to-Digital Converter Specifications
- 14.2 Analog Conditioning
- 14.3 ADS1x15 Analog-to-Digital Converter Registers
- 14.4 The Adafruit ADS1x15 Breakout Boards
- 14.5 An ADS1x15 Programming Example
- 14.6 Improving Polling Performance
- 14.7 Improving Performance Using Continuous Scanning
- 14.8 Interrupts and the ADS1x15
- 14.9 Filtering Noise
- 14.10 Chapter Summary
- Chapter 15: The MCP4725 Digital-to-Analog Converter
- Chapter 16: Bare-Metal Peripheral Programming
- Epilogue
- Appendix A: The Adafruit I2C Address Compilation
- Appendix B: Online Chapters
- Glossary
- Index
Product information
- Title: The Book of I2C
- Author(s):
- Release date: October 2022
- Publisher(s): No Starch Press
- ISBN: 9781718502468
You might also like
book
Architecting High-Performance Embedded Systems
Explore the complete process of developing systems based on field-programmable gate arrays (FPGAs), including the design …
book
Making Embedded Systems, 2nd Edition
Interested in developing embedded systems? Since they don't tolerate inefficiency, these systems require a disciplined approach …
book
Arduino Cookbook, 3rd Edition
Want to create devices that interact with the physical world? This cookbook is perfect for anyone …
book
Embedded Systems Architecture - Second Edition
Design safe and reliable software for embedded systems and explore the internals of device drivers, RTOS, …