Section 1.2 Embedded Systems Features and Constraints
Designing for embedded systems is very different from writing programs for computer (desktop, laptop, and mobile) applications. This has a lot to do with the resources, especially memory, available on each type of device. These differences are outlined in Table 1.2.1.
| Embedded System | Computer | |
|---|---|---|
| Program data location | ROM | RAM |
| RAM capacity | 2 kB (ATmega328P) | Nearly unlimited |
| ROM capacity | 32 kB (ATmega328P) | Nearly unlimited |
| Use of peripherals | Frequent | Rare |
| Use of assembly | Frequent | Rare |
Because microcontrollers have limited memory capacity, it is important to write code as efficiently as possible. In addition, the data stored in RAM (volatile memory) also needs to be carefully considered in regard to datatype and the number of variables that can be stored without exhausting the capacity.
With embedded systems, a lot of peripheral features are used to interface with and control I/O devices, which is extremely uncommon on a PC. The peripheral features on the ATmega328P are listed in Chapter 4 and will be explained in great detail throughout this textbook. Configuring each of these peripheral functions requires a high level of understanding of each of their individual control parameters.
