Atjaunināt sīkdatņu piekrišanu

Book of I2C [Mīkstie vāki]

  • Formāts: Paperback / softback, 440 pages, height x width: 234x178 mm
  • Izdošanas datums: 11-Oct-2022
  • Izdevniecība: No Starch Press,US
  • ISBN-10: 171850246X
  • ISBN-13: 9781718502468
Citas grāmatas par šo tēmu:
  • Mīkstie vāki
  • Cena: 65,11 €
  • Grāmatu piegādes laiks ir 3-4 nedēļas, ja grāmata ir uz vietas izdevniecības noliktavā. Ja izdevējam nepieciešams publicēt jaunu tirāžu, grāmatas piegāde var aizkavēties.
  • Daudzums:
  • Ielikt grozā
  • Piegādes laiks - 4-6 nedēļas
  • Pievienot vēlmju sarakstam
  • Formāts: Paperback / softback, 440 pages, height x width: 234x178 mm
  • Izdošanas datums: 11-Oct-2022
  • Izdevniecība: No Starch Press,US
  • ISBN-10: 171850246X
  • ISBN-13: 9781718502468
Citas grāmatas par šo tēmu:
"The Book of Ip2(BC, the first comprehensive guide to the Ip2(BC bus, gets you started designing and programming Ip2(BC systems. With over 100 detailed figures, numerous program examples, and annotated source-code listings, this book walks you through the Ip2(BC implementations of systems like Arduino, Teensy, and Raspberry Pi, as well as variants of the Ip2(BC and common Ip2(BC peripheral ICs"--

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.
Acknowledgments xvii
Introduction xix
PART I LOW-LEVEL PROTOCOLS AND HARDWARE
1(90)
1 I2C Low-Level Hardware
3(12)
1.1 I2C Overview
4(1)
1.2 Open-Drain (Open-Collector) Logic and Four-Wire Mode
5(2)
1.3 I2C Signal Levels
7(1)
1.3.1 Level Shifting
7(1)
1.4 Choosing Pullup Resistor Sizes
8(1)
1.5 Bus Capacitance and Pullup Resistor Values
8(1)
1.5.1 What If the Bus Capacitance Is Too High?
9(1)
1.6 I2C Bus Speeds
9(1)
1.7 Multicontroller l2C Bus Clock Synchronization
10(2)
1.8 Multicontroller l2C Bus Arbitration
12(1)
1.9 Clock Stretching
13(1)
1.10 Cross Talk
13(1)
1.11
Chapter Summary
14(1)
2 I2C Protocol
15(16)
2.1 Data on the l2C Bus
16(3)
2.2 I2C Addresses and Read/Write Control
19(1)
2.3 Repeated Start Conditions
19(1)
2.4 Clock Stretching
20(1)
2.5 Special Addresses
21(5)
2.5.1 The General Call Address
21(2)
2.5.2 Hardware General Calls
23(1)
2.5.3 Start Byte
23(1)
2.5.4 CBUS and Reserved Addresses
24(1)
2.5.5 High-Speed Mode Controller Code
24(1)
2.5.6 10-Bit Peripheral Addressing
24(1)
2.5.7 Device ID
25(1)
2.6 Resetting the I2C Bus
26(1)
2.7 Detecting I2C Peripherals on the Bus
26(2)
2.8 Creating Custom Devices
28(1)
2.9
Chapter Summary
28(3)
3 A Software Implementation Of The I2C BUS
31(36)
3.1 A Software I2C Implementation on the Teensy 3.2
32(32)
3.1.1 A Software-Based I2C Controller for the Teensy 3.2
32(20)
3.1.2 A Software-Based I2C Peripheral for the Teensy 3.2
52(12)
3.1.3 Some Final Comments on the Teensy 3.2 Software I2C Code
64(1)
3.2 Basic ATtiny84 and ATtiny85 Hardware
64(2)
3.2.1 Atto84 Software-Based I2C Peripheral
65(1)
3.3
Chapter Summary
66(1)
4 Tools For Analyzing And Debugging I2C Transmissions
67(14)
4.1 Generic Hardware Testing and Debugging Tools
68(2)
4.2 Logic Analyzers
70(2)
4.3 The I2C Driver
72(3)
4.4 The Bus Pirate
75(1)
4.5 The Saleae Logic Analyzers
75(3)
4.6 A Final Comment on I2C Monitors and Logic Analyzers
78(1)
4.7
Chapter Summary
78(3)
5 Invariants
81(10)
5.1 SMBus
82(7)
5.1.1 Differences Between SMBus and Standard I2C
82(1)
5.1.2 SMBus Electrical Specifications
83(1)
5.1.3 SMBus Reserved Addresses
83(1)
5.1.4 SMBus Protocol Commands
84(5)
5.2 VESA DDC and E-DDC
89(1)
5.3 ACCESS.bus
89(1)
5.4 Two-Wire Interface and Two-Wire Serial Interface
89(1)
5.5
Chapter Summary
90(1)
PART II HARDWARE IMPLEMENTATIONS
91(38)
6 I2C On Common Single-Board Computers
93(22)
6.1 The Arduino Family
94(7)
6.1.1 The Arduino Uno Rev3 and Leonardo
95(1)
6.1.2 The Arduino Nano
96(1)
6.1.3 The Arduino Micro
97(1)
6.1.4 The Arduino Nano Every
98(1)
6.1.5 The Arduino Mega 2560 Rev3
98(2)
6.1.6 The Arduino Zero
100(1)
6.1.7 The Arduino Due
100(1)
6.1.8 Other Arduino-Brand Single-Board Computers
101(1)
6.2 Adafruit Single-Board Computers
101(2)
6.3 SparkFun Single-Board Computers
103(1)
6.4 The Teensy Family
104(1)
6.5 Other Arduino-Compatible Single-Board Computers
105(1)
6.6 The Raspberry Pi
105(2)
6.7 The Raspberry Pi Pico
107(1)
6.8 The BeagleBone Black
108(1)
6.9 The PINE A64 and ROCKPro64
109(1)
6.10 The Onion Omega
109(1)
6.11 The STM32 Single-Board Computer Family
110(1)
6.11.1 STM32F767/Nucleo-144
111(1)
6.11.2 STM32F746G-Disco
111(1)
6.1 1.3 STM32 Boards Galore
111(1)
6.12 The NetBurnerMOD54415
111(1)
6.13 I2C on the Personal Computer
112(1)
6.14
Chapter Summary
112(3)
7 I2C On Vendor Buses
115(14)
7.1 The Adafruit Feather Bus
116(6)
7.1.1 Feather Bus Pinouts
118(1)
7.1.2 L2C on the Feather Bus
119(1)
7.1.3 Multicontroller Operation
120(1)
7.1.4 Feathers and FeatherWings
120(2)
7.2 L2C on the SparkFun Qwiic Bus
122(1)
7.3 Qwiic Bus Peripherals
123(2)
7.4 L2C on the Seeed Studio Grove Bus
125(1)
7.5
Chapter Summary
126(3)
PART III PROGRAMMING THE I2C BUS
129(122)
8 Arduino I2C Programming
131(16)
8.1 Basic I2C Programming
133(1)
8.2 Basic Wire Programming
134(3)
8.2.1 Wire Utility Functions
134(1)
8.2.2 Wire Read Operations
135(1)
8.2.3 Wire Write Operations
136(1)
8.2.4 Wire Peripheral Functions
137(1)
8.3 Arduino I2C Write Example
137(3)
8.4 Arduino I2C Read Example
140(2)
8.5 Arduino I2C Peripheral Example
142(2)
8.6 Multiple I2C Port Programming
144(1)
8.7
Chapter Summary
145(2)
9 Raspberry PI (And Linux) I2C Programming
147(28)
9.1 The I2C Bus Pins on the Pi General-Purpose Input/Output Header
148(3)
9.2 Manually Activating the I2C Buses
151(1)
9.3 Changing the I2C Clock Frequency
152(1)
9.4 I2C Clock Stretching Issues and Solutions
153(1)
9.5 Raspberry Pi OS (Linux) I2C Utilities
154(4)
9.6 Reading and Writing I2C Data
158(4)
9.7 Advanced I2C Kernel Calls
162(9)
9.7.1 The I2c-dev Functions
163(1)
9.7.2 The I2c smbus write quick Function
164(1)
9.7.3 The I2c smbus read byte Function
165(1)
9.7.4 The I2c smbus write byte() Function
166(1)
9.7.5 The I2c smbus read byte data() Function
166(2)
9.7.6 The I2c smbus write byte data() Function
168(1)
9.7.7 The I2c smbus read word data() Function
168(1)
9.7.8 The I2c smbus write word data() Function
169(1)
9.7.9 The I2c smbus read block data() Function
169(1)
9.7.10 The I2c smbus write block data() Function
170(1)
9.7.11 Miscellaneous Functions
171(1)
9.8 Reentrancy Issues with I2C Operations
171(1)
9.9 Multicontroller Operation Under Linux
171(1)
9.10 Other Linux Systems
171(1)
9.10.1 PINE A64 and ROCKPro64
172(1)
9.10.2 BeagleBone Black
172(1)
9.10.3 Onion Omega2+
172(1)
9.11 Using the Raspberry Pi as an I2C Peripheral Device
172(1)
9.12
Chapter Summary
173(2)
10 I2C Programming In Real-Time Operating Systems
175(32)
10.1 Real-Time Operating System Basics
176(4)
10.1.1 Processes and Threads
177(1)
10.1.2 Multithreading and Multitasking
177(1)
10.1.3 Reentrancy
178(1)
10.1.4 Synchronization
179(1)
10.1.5 Safety Critical Systems
179(1)
10.2 Real-Time Operating System I2C Programming
180(23)
10.2.1 Uc/OS
180(9)
10.2.2 FreeRTOS I2C Programming
189(5)
10.2.3 Teensy Threads I2C Programming
194(5)
10.2.4 Mbed I2C Programming
199(4)
10.3 Other Real-Time Operating System I2C Programming
203(1)
10.4
Chapter Summary
204(3)
11 Bare-Metal I2C Controller Programming
207(44)
11.1 Teensy 4.x Controller Programming
208(40)
11.1.1 I.MX RT1062 l2C Registers
209(6)
11.1.2 Teensy 4.x Wire Code
215(19)
11.2 A Ttiny Controller Programming
234(2)
11.2.1 The Atto84 Triangle Wave Demonstration Program
236(12)
11.3
Chapter Summary
248(3)
PART IV I2C PERIPHERAL PROGRAMMING EXAMPLES
251(132)
12 The TCA9548A I2C Bus Expander
253(8)
12.1 The TCA9548A I2C Multiplexer
254(4)
12.1.1 Upstream and Downstream Devices
254(1)
12.1.2 The TCA9548A Selection Register
255(1)
12.1.3 TCA9548A Address and Reset Lines
255(1)
12.1.4 The TCA9548A Power Supply, Pullups, and Level Shifting
256(1)
12.1.5 Reducing Bus Loading and Bus Speed
256(1)
12.1.6 Switching Between Buses
257(1)
12.1.7 Cascading TCA9548A Multiplexers
257(1)
12.2 The Adafruit TCA9548A I2C Expander
258(1)
12.3 The SparkFun I2C Mux
259(1)
12.4
Chapter Summary
260(1)
13 THE MCP23017 AND MCP23008 Gpio Expanders
261(38)
13.1 The MCP23017 and MCP23008 Pinouts
262(2)
13.2 MCP230xx Registers
264(11)
13.2.1 Accessing MCP230xx Registers
266(1)
13.2.2 MCP230xx Initialization
266(2)
13.2.3 Programming the Data Direction
268(1)
13.2.4 Programming Input Pullup Resistors
269(1)
13.2.5 Programming the Input Polarity
270(1)
13.2.6 Sequential Register Operations
271(2)
13.2.7 Slew Rate Control
273(1)
13.2.8 Reading General-Purpose Input/Output Pins on the MCP230xx
274(1)
13.3 Writing General-Purpose Input/Output Pins on the MCP230xx
275(1)
13.4 Demonstrating Input/Output on an MCP23017
276(4)
13.5 Interrupts on the MCP230xx
280(6)
13.5.1 Interrupt Actions on the MCP230xx
280(1)
13.5.2 Interrupt Service Routines
281(2)
13.5.3 Mirroring INTx Pins (MCP23017 Only)
283(1)
13.5.4 Open-Drain INTx Output
283(1)
13.5.5 Enabling Interrupts on the MCP230xx
284(1)
13.5.6 Testing and Clearing Interrupts
285(1)
13.6 A Sample Interrupt-Driven MCP230xx
286(9)
13.7 MCP230xx Library Code
295(1)
13.8 I2C Performance
295(1)
13.9 MCP23Sxx Parts
296(1)
13.10
Chapter Summary
296(3)
14 THE ADS1015 AND ADS1115 Analog-To-Digital Converters
299(42)
14.1 Analog-to-Digital Converter Specifications
300(5)
14.1.1 Analog-to-Digital Converter Resolution
301(1)
14.1.2 Analog-to-Digital Converter Channel Count
301(1)
14.1.3 Analog-to-Digital Converter Polarity
302(1)
14.1.4 Analog-to-Digital Converter Range
302(1)
14.1.5 Differential vs. Single-Ended Modes
303(1)
14.1.6 Sample Frequency
304(1)
14.1.7 Miscellaneous ADS1 × 15 Features
305(1)
14.2 Analog Conditioning
305(4)
14.3 ADS1 × 15 Analog-to-Digital Converter Registers
309(7)
14.3.1 The Conversion Register
310(1)
14.3.2 The Configuration Register
310(5)
14.3.3 The Low and High Threshold Registers
315(1)
14.4 The Adafruit ADS1 × 15 Breakout Boards
316(2)
14.5 An ADS1 × 15 Programming Example
318(5)
14.6 Improving Polling Performance
323(4)
14.7 Improving Performance Using Continuous Scanning
327(3)
14.8 Interrupts and the ADS1 &tiems; 15
330(1)
14.9 Filtering Noise
331(7)
14.9.1 Computing Means and Medians
331(7)
14.10
Chapter Summary
338(3)
15 THE MCP4725 DIGITAL-TO-ANALOG CONVERTER
341(8)
15.1 MCP4275 Overview
342(2)
15.2 The Fast Write Command
344(1)
15.3 The Write Command
344(1)
15.4 Power-Down Modes
345(1)
15.5 The Read Command
346(1)
15.6
Chapter Summary
347(2)
16 Bare-Metal Peripheral Programming
349(34)
16.1 The A Ttiny as an I2C Peripheral
350(1)
16.2 Introducing the Memory Peripheral
351(2)
16.3 The Memory Peripheral Software Architecture
353(28)
16.3.1 The Main File
354(5)
16.3.2 The Interrupt Service Routine Library
359(21)
16.3.3 A Sample Controller Application
380(1)
16.4
Chapter Summary
381(2)
Epilogue 383(2)
A The Adafruit I2C Address Compilation 385(8)
B Online
Chapters
393(4)
Glossary 397(6)
Index 403
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.