Chapter 12. Software and Coding
This chapter investigates software- and code-related issues within the context of embedded systems. Topics include:
What programming languages are used
When an operating system (OS) is needed
Understanding the difference between real-time and general-purpose operating systems
Which real-time operating systems are suitable for use
Configuring the ports of a microcontroller (MCU)
Creating device driver code
Defensive coding for systems functioning under adverse conditions
With coverage of these topics, a designer with coding skills should have the knowledge required to configure and program embedded systems.
Remember, this book focuses on embedded system electronics, not the coding for embedded systems. There are many books on embedded system coding out there, and several good coding references and study textbooks are suggested in “Further Reading”.
Consequently a tutorial for writing a “Hello World!” program for an embedded system isn’t included here.
Coding Languages
The approach to programming an embedded system will usually take one of three paths:
- Define a state machine
For field-programmable gate array (FPGA) and complex programmable logic device (CPLD) programming, the logic structure usually defines a state machine. The state machine applies conditionals to define state changes. For this, the programming uses a hardware description language (HDL), typically Verilog or VHDL.
- Use Assembly language
Simple MCUs (peripheral interface controllers, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access