1.2. Embedded Systems#

Most mechatronic devices are controlled by specialised computers called “embedded systems”. Unlike a laptop or phone, which run many unrelated programs, an embedded system is usually designed around one main purpose, and every component hardware, firmware, sensors, and actuators is chosen to serve that purpose economically and reliably.

1.2.1. Components of an Embedded System#

Microprocessor#

../../_images/Intel_C8086_1.jpg

Intel C8086 by Christian Bassow, CC BY-SA 4.0#

Every embedded system has a processor, called a “microprocessor”, which contains circuitry to perform normal processor functions such as arithmetic and logic computations. A microprocessor is packaged in a single integrated circuit (IC) which is placed onto a circuit board.

Microprocessors are distinguished from CPUs found in consumer computers by their smaller size and reduced capabilities such as processing speed and memory. However they operate in a similar way and are programmable.

Memory#

Microprocessors require memory to store their programs and any program state. There are two types of memory you will encounter on an embedded system:

  • Non-volatile memory, which holds data such as program code while the device is powered off. Historically this is some form of read-only memory (ROM), which is programmed during assembly and can only be read from.

  • Volatile memory, which holds program state while the device is in operation and is usually some form of random-access memory (RAM).

However the presence of ROM in embedded systems is declining in favor of other forms of non-volatile memory that allows random access. In the past ROM was substantially cheaper to produce and more power efficient than alternatives such as flash memory. In recent years, this gap has closed and Flash memory is now commonly used for non-volatile memory.

Peripherals#

Peripherals refer to other integrated circuits that add expand the capabilities of the microprocessor so that it can interact with other devices or the physical world. Examples of peripherals include:

  • General Purpose Input/Output (GPIO) expanders that add pins that can be used as either inputs or outputs by the microprocessor and are programmatically controlled.

  • Analog to Digital Converters (ADC) and Digital to Analog Converters (DAC) that add pins that can measure analog signals and convert them to digital data or vice versa that can be read or controlled by the microprocessor.

  • Communication interfaces such as serial (e.g. RS-485), I2C, SPI, USB or CAN bus that allow communication to other integrated circuits or microprocessors on the device or even between devices.

  • Network interfaces such as Ethernet or Wi-Fi to enable network communication.

  • Storage interfaces or devices such as flash memory or SD cards.