Making embedded systems : design patterns for great software 🔍
Elecia White O'Reilly Media, Incorporated, 2, PS, 2024
英语 [en] · PDF · 10.8MB · 2024 · 📘 非小说类图书 · 🚀/lgli/lgrs/zlib · Save
描述
Interested in developing embedded systems? Since they don't tolerate inefficiency, these systems require a disciplined approach to programming. This easy-to-read guide helps you cultivate good development practices based on classic software design patterns and new patterns unique to embedded programming. You'll learn how to build system architecture for processors, not for operating systems, and you'll discover techniques for dealing with hardware difficulties, changing designs, and manufacturing requirements.
Written by an expert who has created systems ranging from DNA scanners to children's toys, this book is ideal for intermediate and experienced programmers, no matter what platform you use. This expanded second edition includes new chapters on IoT and networked sensors, motors and movement, debugging, data handling strategies, and more.
• Optimize your system to reduce cost and increase performance
• Develop an architecture that makes your software robust in resource-constrained environments
• Explore sensors, displays, motors, and other I/O devices
• Reduce RAM and power consumption, code space, and processor cycles
• Learn how to interpret schematics, datasheets, and power requirements
• Discover how to implement complex mathematics and machine learning on small processors
• Design effective embedded systems for IoT and networked sensors
备用文件名
lgrsnf/Sanet.st_Making Embedded Systems_ 2nd Edition - Elecia White.pdf
备用文件名
zlib/Computers/Information Systems/Elecia White/Making Embedded Systems: Design Patterns for Great Software_28837461.pdf
备用出版商
Oreilly & Associates Inc
备用版本
United States, United States of America
备用版本
Second edition, Sebastopol, CA
备用版本
O'Reilly Media, [S.l.], 2024
备用版本
Second edition, Beijing
元数据中的注释
Publisher's PDF | Published: March 2024 | Revision History for the Second Edition: 2024-03-01: First Release
备用描述
Copyright
Table of Contents
Preface
About This Book
Who This Book Is For
About the Author
Organization of This Book
Terminology
Conventions Used in This Book
Using Code Examples
O’Reilly Online Learning
How to Contact Us
Acknowledgments
Chapter 1. Introduction
Embedded Systems Development
Compilers and Languages
Debugging
Resource Constraints
Principles to Confront Those Challenges
Prototypes and Maker Boards
Further Reading
Chapter 2. Creating a System Architecture
Getting Started
Creating System Diagrams
The Context Diagram
The Block Diagram
Organigram
Layering Diagram
Designing for Change
Encapsulate Modules
Delegation of Tasks
Driver Interface: Open, Close, Read, Write, IOCTL
Adapter Pattern
Creating Interfaces
Example: A Logging Interface
A Sandbox to Play In
Back to the Drawing Board
Further Reading
Chapter 3. Getting Your Hands on the Hardware
Hardware/Software Integration
Ideal Project Flow
Hardware Design
Board Bring-Up
Reading a Datasheet
Datasheet Sections You Need When Things Go Wrong
Datasheet Sections for Software Developers
Evaluating Components Using the Datasheet
Your Processor Is a Language
Reading a Schematic
Practice Reading a Schematic: Arduino!
Keep Your Board Safe
Creating Your Own Debugging Toolbox
Digital Multimeter
Oscilloscopes and Logic Analyzers
Setting Up a Scope
Testing the Hardware (and Software)
Building Tests
Flash Test Example
Command and Response
Command Pattern
Dealing with Errors
Consistent Methodology
Error Checking Flow
Error-Handling Library
Debugging Timing Errors
Further Reading
Chapter 4. Inputs, Outputs, and Timers
Handling Registers
Binary and Hexadecimal Math
Bitwise Operations
Test, Set, Clear, and Toggle
Toggling an Output
Setting the Pin to Be an Output
Turning On the LED
Blinking the LED
Troubleshooting
Separating the Hardware from the Action
Board-Specific Header File
I/O-Handling Code
Main Loop
Facade Pattern
The Input in I/O
Momentary Button Press
Interrupt on a Button Press
Configuring the Interrupt
Debouncing Switches
Runtime Uncertainty
Increasing Code Flexibility
Dependency Injection
Using a Timer
Timer Pieces
Doing the Math
More Math: Difficult Goal Frequency
A Long Wait Between Timer Ticks
Using a Timer
Using Pulse-Width Modulation
Shipping the Product
Further Reading
Chapter 5. Interrupts
A Chicken Presses a Button
An IRQ Happens
Nonmaskable Interrupts
Interrupt Priority
Nested Interrupts
Save the Context
Retrieve the ISR from the Vector Table
Initializing the Vector Table
Looking Up the ISR
Call the ISR
Multiple Sources for One Interrupt
Disabling Interrupts
Critical Sections
Restore the Context
Configuring Interrupts
When and When Not to Use Interrupts
How to Avoid Using Interrupts
Polling
System Tick
Time-Based Events
A Very Small Scheduler
Further Reading
Chapter 6. Managing the Flow of Activity
Scheduling and Operating System Basics
Tasks
Communication Between Tasks
Avoiding Race Conditions
Priority Inversion
State Machines
State Machine Example: Stoplight Controller
State-Centric State Machine
State-Centric State Machine with Hidden Transitions
Event-Centric State Machine
State Pattern
Table-Driven State Machine
Choosing a State Machine Implementation
Watchdog
Main Loops
Polling and Waiting
Timer Interrupt
Interrupts Do Everything
Interrupts Cause Events
Very Small Scheduler
Active Objects
Further Reading
Chapter 7. Communicating with Peripherals
Serial Communication
TTL Serial
RS-232 Serial
SPI
I2C and TWI
1-Wire
Parallel
Dual and Quad SPI
USB
Considering Other Protocols
Communications in Practice
External ADC Example: Data Ready with SPI
Use a FIFO If Available
Direct Memory Access (DMA) Is Faster
External ADC Example: SPI and DMA
Circular Buffers
Further Reading
Chapter 8. Putting Together a System
Key Matrices
Segmented Displays
Pixel Displays
Display Assets
Changeable Data? Flyweight and Factory Patterns
External Flash Memory
Display Assets
Emulated EEPROMs and KV Stores
Little File Systems
Data Storage
Analog Signals
Digital Sensors
Data Handling
Changing Algorithms: Strategy
Algorithm Stages: Pipelines and Filters
Calculating Needs: Speeds and Feeds
Data Bandwidth
Memory Throughput and Buffering
Further Reading
Chapter 9. Getting into Trouble
Fighting with the Compiler Optimizations
Impossible Bugs
Reproduce the Bug
Explain the Bug
Creating Chaos and Hard Faults
Dividing by Zero
Talking to Things That Aren’t There
Running Undefined Instructions
Incorrect Memory Access (Unaligned Access)
Returning a Pointer to Stack Memory
Stack Overflows and Buffer Overflows
Debugging Hard Faults
Processor Registers: What Went Wrong?
Creating a Core Dump
Using the Core Dump
Merely Very Difficult Bugs
Consequences of Being Clever
Further Reading
Chapter 10. Building Connected Devices
Connecting Remotely
Directly: Ethernet and WiFi
Through a Gateway
Via a Mesh
Robust Communication
Version!
Checksums, CRCs, Hashes
Encryption and Authentication
Risk Analysis
Updating Code
Firmware Update Security
Multiple Pieces of Code
Fallback Lifeboat
Staged Rollout
Managing Large Systems
Manufacturing
Further Reading
Chapter 11. Doing More with Less
Need More Code Space
Reading a Map File (Part 1)
Process of Elimination
Libraries
Functions Versus Macros: Which Are Smaller?
Constants and Strings
Need More RAM
Remove malloc
Reading a Map File (Part 2)
Registers and Local Variables
Function Chains
Pros and Cons of Globals: RAM Versus Stack
Clever Memory Overlays
Need More Speed
Profiling
Optimizing for Processor Cycles
Summary
Further Reading
Chapter 12. Math
Identifying Fast and Slow Operations
Taking an Average
Different Averages: Cumulative and Median
Using an Existing Algorithm
Designing and Modifying Algorithms
Factor Polynomials
Taylor Series
Dividing by a Constant
Scaling the Input
Lookup Tables
Fake Floating-Point Numbers
Rational Numbers
Precision
Addition (and Subtraction)
Multiplication (and Division)
Machine Learning
Look Up the Answer!
Further Reading
Chapter 13. Reducing Power Consumption
Understanding Power Consumption
Measuring Power Consumption
Designing for Lower Power Consumption
Turn Off the Light When You Leave the Room
Turn Off Peripherals
Turn Off Unused I/O Devices
Turn Off Processor Subsystems
Slow Down to Conserve Energy
Putting the Processor to Sleep
Interrupt-Based Code Flow Model
A Closer Look at the Main Loop
Processor Watchdog
Avoid Frequent Wake-Ups
Chained Processors
Further Reading
Chapter 14. Motors and Movement
Creating Movement
Position Encoding
Driving a Simple DC Motor with PWM
Motor Control
PID Control
Motion Profiles
Ten Things I Hate About Motors
Further Reading
Index
About the Author
Colophon
备用描述
Interested in developing embedded systems? Since they don't tolerate inefficiency, these systems require a disciplined approach to programming. This easy-to-read guide helps you cultivate good development practices based on classic software design patterns and new patterns unique to embedded programming. You'll learn how to build system architecture for processors, not operating systems, and discover techniques for dealing with hardware difficulties, changing designs, and manufacturing requirements. Written by Elecia White, an expert who's created embedded systems ranging from DNA scanners to children's toys, this book is ideal for intermediate and experienced programmers, no matter what platform you use. This expanded update includes new chapters on IoT and networked sensors, motors and movement, and data handling strategies. Optimize your system to reduce cost and increase performance Develop an architecture that makes your software robust in resource-constrained environments Explore sensors, displays, motors, and other I/O devices Reduce RAM and power consumption, code space, and processor cycles Learn how to interpret schematics, datasheets, and power requirements Discover how to implement complex mathematics and machine learning on small processors Design effective embedded systems for IoT and networked sensors
开源日期
2024-04-14
更多信息……
We strongly recommend that you support the author by buying or donating on their personal website, or borrowing in your local library.

🚀 快速下载

成为会员以支持书籍、论文等的长期保存。为了感谢您对我们的支持,您将获得高速下载权益。❤️

🐢 低速下载

由可信的合作方提供。 更多信息请参见常见问题解答。 (可能需要验证浏览器——无限次下载!)

所有选项下载的文件都相同,应该可以安全使用。即使这样,从互联网下载文件时始终要小心。例如,确保您的设备更新及时。
  • 对于大文件,我们建议使用下载管理器以防止中断。
    推荐的下载管理器:JDownloader
  • 您将需要一个电子书或 PDF 阅读器来打开文件,具体取决于文件格式。
    推荐的电子书阅读器:Anna的档案在线查看器ReadEraCalibre
  • 使用在线工具进行格式转换。
    推荐的转换工具:CloudConvertPrintFriendly
  • 您可以将 PDF 和 EPUB 文件发送到您的 Kindle 或 Kobo 电子阅读器。
    推荐的工具:亚马逊的“发送到 Kindle”djazz 的“发送到 Kobo/Kindle”
  • 支持作者和图书馆
    ✍️ 如果您喜欢这个并且能够负担得起,请考虑购买原版,或直接支持作者。
    📚 如果您当地的图书馆有这本书,请考虑在那里免费借阅。