Raspberry Pi Hardware Reference - Warren Gay.pdf

(4348 KB) Pobierz
TECHNOLOGY IN ACTION™
Raspberry Pi
COMPLETE COVERAGE OF THE
RASPBERRY PI’S HARDWARE
Hardware Reference
Warren Gay
For your convenience Apress has placed some of the front
matter material after the index. Please use the Bookmarks
and Contents at a Glance links to access them.
Contents at a Glance
About the Author ............................................................................
xix
About the Technical Reviewer ........................................................
xxi
Acknowledgments ........................................................................
xxiii
Introduction ....................................................................................xxv
Chapter 1: The Raspberry Pi ...........................................................
1
Chapter 2: Power ............................................................................
5
Chapter 3: Header Strips, LEDs, and Reset ...................................
19
Chapter 4: SDRAM ........................................................................
27
Chapter 5: CPU..............................................................................
45
Chapter 6: USB..............................................................................
65
Chapter 7: Ethernet.......................................................................
71
Chapter 8: SD Card Storage ..........................................................
81
Chapter 9: UART ............................................................................
89
Chapter 10: GPIO ........................................................................
121
Chapter 11: 1-Wire Driver...........................................................
165
Chapter 12: I2C Bus ....................................................................
175
Chapter 13: SPI Bus ....................................................................
187
v
CONTENTS AT A GLANCE
Appendix A: Glossary..................................................................
203
Appendix B: Power Standards ....................................................
209
Appendix C: Electronics Reference .............................................
211
Index ..............................................................................................
213
vi
Introduction
After receiving your
first
Raspberry Pi, the
first
question in your mind is probably “What
can this hardware do?” What are its capabilities and limitations? Hardware is the more
urgent question because software is so easily altered or replaced.
The
one perplexing problem I immediately ran up against when I started out with the
Pi was that the hardware information seemed to be scattered.
The
basic information was
accessible and well known, but other important parameters such as GPIO source or sink
current limits required research. After researching these questions, I often discovered that
the answer was “It depends.” It was the answering of these classes of questions that led to
the writing of
Mastering the Raspberry Pi.
Content of This Book
This
book is focused mainly on the Raspberry Pi’s hardware.
The
content is extracted from
the complete work,
Mastering the Raspberry Pi.
As such, it will serve you as an owner’s
manual of sorts, saving time as a ready reference about the hardware you purchased.
While this is a volume focused on hardware, some software coverage must coexist.
For example, it is through the physical memory management that software gains access
to the hardware peripheral registers. Another example is the discussion about the CPU,
where the pthread API is covered for reference purposes.
Through
the application of this
API, you further utilize that ARM CPU.
This
book begins by introducing the Pi in general terms in Chapter 1.
Then
attention
immediately turns to the important topic of power in Chapter 2. Many people suffer
needless problems because of neglect in this area.
The
chapter ends with some notes
about running from battery or solar power.
Chapter 3 documents the header strips, LEDs, and Reset inputs.
This
is information
that should be bookmarked. Next is Chapter 4 on memory, which documents the various
Raspbian Linux measures and controls for memory allocation.
The
CPU and its API are
described in Chapter 5.
The
focus of Chapter 6 is USB. USB-specific power issues and its API are explained.
Wired and wireless Ethernet networking is discussed in Chapter 7. SD card technology
is examined in Chapter 8, describing the interface and the specifics of the Raspberry Pi
interface.
The
topic of wear leveling is also included.
Serial communication, RS-232 converters, serial consoles, and dedicated serial ports
are covered in Chapter 9.
The
serial interface, some historical influences, and
flow
control
are discussed. Included is an organized description of the Linux API for utilizing the serial
interface.
xxv
Zgłoś jeśli naruszono regulamin