Table of Contents

1. Introduction to Embedded Systems

1.1 What is an embedded system?
1.2 Basic components
1.3 RIMS
1.4 Timing diagrams
1.5 Testing

2. Embedded programming

2.1 C in embedded systems
2.2 C data types
2.3 RIMS implicitly defined I/O variables
2.4 Hexadecimal
2.5 Bitwise operators
2.6 Shift operators
2.7 Bit access functions
2.8 Rounding and overflow

3. State Machines

3.1 Time-ordered behavior
3.2 State machines
3.3 RIBS
3.4 Implementing an SM in C
3.5 Variables, statements, and conditions in SMs
3.6 Mealy actions
3.7 How to capture behavior as an SM
3.8 Testing an SM
3.9 Capture/convert process

4. Synchronous SMs

4.1 Time-interval behavior
4.2 Synchronous SMs
4.3 SynchSMs and time intervals for inputs
4.4 Choosing a period for different time intervals
4.5 Microcontrollers with timers
4.6 Converting a synchSM to C
4.7 State actions should never wait

5. Concurrent synchSMs

5.1 Concurrent synchSMs
5.2 Shared variables
5.3 Converting multiple synchSMs to C
5.4 Converting synchSM local variables to C
5.5 Keeping distinct behaviors distinct
5.6 Task communication
5.7 Queues

6. Input/Output

6.1 Sampling of inputs
6.2 Latency
6.3 Input conditioning
6.4 Avoiding output glitching
6.5 I/O electrical issues
6.6 Dealing with too few pins

7. Peripherals

7.1 Pulse width modulation
7.2 UARTs
7.3 Analog-digital conversion

8. Task Scheduler

8.1 Converting different-period tasks to C
8.2 Creating a task structure in C
8.3 Code for a simple cooperative task scheduler

9. Programming Issues

9.1 C functions versus lookup tables
9.2 Fixed-point programming
9.3 Lookup tables again

10. Utilization/Scheduling

10.1 Timer overrun
10.2 Utilization
10.3 Computing a task’s worst-case execution time
10.4 Utilization for multiple tasks
10.5 Jitter
10.6 Scheduling
10.7 Preemptive scheduler
10.8 Triggered synchSMs
10.9 Reducing power consumption using a sleep function
10.10 Disciplined programming

11. Control Systems

11.1 Introduction to control systems
11.2 Proportional control
11.3 Proportional-derivative (PD) control
11.4 Proportional-integral-derivative (PID) control
11.5 PID tuning

12. Digital Signal Processing

12.1 Introduction to digital signal processing
12.2 Sensors
12.3 Actuators
12.4 ADC and amplification
12.5 Bias correction
12.6 Sample rate and quantization
12.7 Aliasing
12.8 Low pass filter
12.9 Playback path
12.10 Digital-to-analog converter
12.11 A DSP example
12.12 Digital processing

13. FPGA

13.1 Introduction to synchSMs on FPGAs
13.2 Translating a synchSM to VHDL
13.3 Achieving the proper synchSM tick rate
13.4 Multiple synchSMs

14. Pattern Recognition

14.1 Framework introduction
14.2 Part 1: Feature extraction
14.3 Part 2: Pattern recognition
14.4 Part 3: Actuation

What You’ll Find In This zyBook:

More action with less text.

  • Teaches the discipline of embedded programming, independent of any particular device
  • Emphasizes capturing behavior with a computation model (state machine)
  • Students write their own task scheduler in C (basis of RTOSes)
  • ~400 participation activities: Questions, animations, tools
  • Browser-based tools include SM capture, PID simulator, and more
  • Accompanies the RI Tools suite (Windows): C programming, emulation, state machine capture; good for additional homework
  • Can be used for classes with or without a physical device-specific lab

Instructors: Interested in evaluating this zyBook for your class? Sign up for a Free Trial and check out the first chapter of any zyBook today!

The zyBooks Approach

Less text doesn’t mean less learning.

Teaches a lasting discipline of embedded programming independent of a specific device. The material emphasizes concurrent synchronous state machines for robust real-time programming. Behavior is captured as C-based synchronous state machines, and then converted to structured C code intended for a microcontroller. To teach principles, the material is accompanied by the (Windows-based) RI toolset consisting of a graphical virtual microcontroller with embedded C compiler/debugger, a state machine capture tool, and a timing diagram viewer. The RI Tools enable in-depth mastery of principles without distraction of microcontroller-specific details.

“I have now been asked to teach Discrete Mathematics again … because of my past experience with zyBooks I agreed to teach this topic again only if I could use the zyBook again.”

Timothy StanleyLecturer, Utah Valley University

Authors

Frank Vahid
Professor of Computer Science, University of California, Riverside

Tony Givargis
Professor of Computer Science, University of California, Irvine

Bailey Miller, Ph.D
CSE Ph.D., Univ. of California, Riverside, zyBooks (Former software engineer at SpaceX)