Making Embedded Systems. Design Patterns for Great Software - Helion
ISBN: 978-14-493-2058-4
stron: 330, Format: ebook
Data wydania: 2011-10-25
Księgarnia: Helion
Cena książki: 118,15 zł (poprzednio: 137,38 zł)
Oszczędzasz: 14% (-19,23 zł)
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 a host of good development practices, based on classic software design patterns and new patterns unique to embedded programming. Learn how to build system architecture for processors, not operating systems, and discover specific techniques for dealing with hardware difficulties and manufacturing requirements.
Written by an expert who’s created embedded systems ranging from urban surveillance and DNA scanners to children’s toys, this book is ideal for intermediate and experienced programmers, no matter what platform you use.
- Optimize your system to reduce cost and increase performance
- Develop an architecture that makes your software robust in resource-constrained environments
- Explore sensors, motors, and other I/O devices
- Do more with less: reduce RAM consumption, code space, processor cycles, and power consumption
- Learn how to update embedded code directly in the processor
- Discover how to implement complex mathematics on small processors
- Understand what interviewers look for when you apply for an embedded systems job
"Making Embedded Systems is the book for a C programmer who wants to enter the fun (and lucrative) world of embedded systems. It’s very well written—entertaining, even—and filled with clear illustrations."
—Jack Ganssle, author and embedded system expert.
Osoby które kupowały "Making Embedded Systems. Design Patterns for Great Software", wybierały także:
- Wzorce projektowe. Kurs video. Schematy rozwi 119,00 zł, (53,55 zł -55%)
- Wzorce komunikacji. Przewodnik dla programist 69,00 zł, (34,50 zł -50%)
- Uporz 49,90 zł, (24,95 zł -50%)
- Wzorce projektowe dla programist 67,00 zł, (33,50 zł -50%)
- Certyfikowany in 69,00 zł, (34,50 zł -50%)
Spis treści
Making Embedded Systems. Design Patterns for Great Software eBook -- spis treści
- Making Embedded Systems
- SPECIAL OFFER: Upgrade this ebook with OReilly
- Preface
- About This Book
- About the Author
- Acknowledgments
- Organization of This Book
- Conventions Used in This Book
- Typography
- Terminology
- Using Code Examples
- Safari Books Online
- How to Contact Us
- About This Book
- 1. Introduction
- Compilers, Languages, and Object-Oriented Programming
- Embedded System Development
- Debugging
- More Challenges
- Principles to Confront Those Challenges
- Further Reading
- 2. Creating a System Architecture
- Creating System Diagrams
- The Block Diagram
- Hierarchy of Control
- Layered View
- From Diagram to Architecture
- Encapsulate Modules
- Delegation of Tasks
- Driver Interface: Open, Close, Read, Write, IOCTL
- Adapter Pattern
- Getting Started with Other Interfaces
- Example: A Logging Interface
- Typical calls needed for logging
- State of logging
- Pattern: Singleton
- Sharing private globals
- A Sandbox to Play In
- Further Reading
- Creating System Diagrams
- 3. Getting Your Hands on the Hardware
- Hardware/Software Integration
- Ideal Project Flow
- Board Bring-Up
- Reading a Datasheet
- Datasheet Sections You Need When Things Go Wrong
- Important Text for Software Developers
- Evaluating Components Using the Datasheet
- Your Processor Is a Language
- Reading a Schematic
- Having a Debugging Toolbox (and a Fire Extinguisher)
- Keep Your Board Safe
- Toolbox
- Digital Multimeter
- Oscilloscopes and Logic Analyzers
- Setting up a scope
- Testing the Hardware (and Software)
- Building Tests
- Flash Test Example
- Test 1: Read existing data
- Test 2: Byte access
- Test 3: Block access
- Test wrap-up
- Command and Response
- Creating a command
- Invoking a command
- Command Pattern
- Dealing with Errors
- Consistent Methodology
- Error-Handling Library
- Debugging Timing Errors
- Further Reading
- Hardware/Software Integration
- 4. Outputs, Inputs, and Timers
- Toggling an Output
- Starting with Registers
- Set the Pin to Be an Output
- Turn 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
- A Simple Interface to a Button
- Momentary Button Press
- Interrupt on a Button Press
- Configuring the Interrupt
- Debouncing Switches
- Runtime Uncertainty
- Dependency Injection
- Using a Timer
- Timer Pieces
- Doing the Math
- A Long Wait Between Timer Ticks
- Using the Timer
- Using Pulse-Width Modulation
- Shipping the Product
- Further Reading
- Toggling an Output
- 5. 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
- Interrupts
- An IRQ Happens
- Multiple sources for one interrupt
- Interrupt priority
- Nested interrupts
- Nonmaskable interrupts
- Save the Context
- Calculating system latency
- Reentrant functions
- Get the ISR from the Vector Table
- Initializing the vector table
- Looking up the ISR
- Calling the ISR
- Disabling interrupts
- Critical sections
- Restore the Context
- When to Use Interrupts
- An IRQ Happens
- How Not to Use Interrupts
- Polling
- System Tick
- Time-Based Events
- A Very Small Scheduler
- Watchdog
- Further Reading
- Scheduling and Operating System Basics
- 6. Communicating with Peripherals
- The Wide Reach of Peripherals
- External Memory
- Buttons and Key Matrices
- Sensors
- Analog sensors
- Digital sensors
- Actuators
- Motors
- Position encoding
- PID control
- Displays
- Segmented displays
- Pixel displays
- So Many Ways of Communicating
- Serial
- RS-232 and TTL
- SPI
- I2C
- 1-wire
- USB
- Miscellaneous other protocols
- Parallel
- Ethernet and WiFi
- Serial
- Putting Peripherals and Communication Together
- Data Handling
- Circular buffers
- Hardware FIFOs
- Direct memory access
- Comparison of buffering schemes
- Adding Robustness to the Communication
- Version everything and then checksum it
- Authentication and encryption
- Changing Data
- Changing Algorithms
- Data Handling
- Further Reading
- The Wide Reach of Peripherals
- 7. Updating Code
- Onboard Bootloader
- Build Your Own Updater
- Modifying the Resident Updater
- Brick Loader
- Copy Loader to RAM
- Run the Loader
- Copy New Code to Scratch
- Dangerous Time: Erase and Program
- Reset to New Code
- Security
- Linker Scripts
- Summary
- 8. Doing More with Less
- Code Space
- Reading a Map File (Part 1)
- Process of Elimination
- Libraries
- Functions and Macros
- Constants and Strings
- RAM
- Remove malloc
- Reading a Map File (Part 2)
- Registers and Local Variables
- Function parameters
- Minimize scope
- Look at the assembly
- Function Chains
- Pros and Cons of Globals
- Memory Overlays
- Speed
- Profiling
- I/O lines and an O-scope
- Timer profiler 1 (function timer)
- Timer profiler 2 (response timer)
- Sampling profiler
- Optimizing
- Memory timing
- Variable size
- One last look at function chains
- Consider the instructions
- Reduce math in loops
- Loop unrolling
- Lookup tables
- Coding in assembly language
- Profiling
- Summary
- Further Reading
- Code Space
- 9. Math
- Identifying Fast and Slow Operations
- Taking an Average
- Use an Existing Algorithm
- Designing and Modifying Algorithms
- Factor Polynomials
- Taylor Series
- Dividing by a Constant
- Scaling the Input
- Lookup Tables
- Implicit input
- Linear interpolation
- Explicit input in the table
- Fake Floating-Point Numbers
- Rational Numbers
- Precision
- Addition (and Subtraction)
- Multiplication (and Division)
- Determining the Error
- Further Reading
- Identifying Fast and Slow Operations
- 10. Reducing Power Consumption
- Understanding Power Consumption
- Turn Off the Light When You Leave the Room
- Turn Off Peripherals
- Turn Off Unused I/O devices
- Turn Off Processor Subsystems
- Slowing 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
- Index
- About the Author
- Colophon
- SPECIAL OFFER: Upgrade this ebook with OReilly
- Copyright