Embedded Systems Concepts
Embedded Systems
Embedded Systems, by my definition, are computer systems generally without standard keyboard / mouse / video interfaces, that do actual things in the real world. This could be anything from computers that control a rocket, to a little Arduino blinking an LED. As such, embedded systems typically consist of some combination of sensors, displays and actuators.
Processors
Embedded systems can broadly be split into two classes - microcontroller based, and microprocessor based. A microcontroller is a small processor that usually has real-time responsiveness. A microprocessor is closer to a desktop computer - it usually has an operating system to handle much higher level concerns, but doesn't always respond in real-time (think seconds instead of milliseconds).
Sensors
Sensors are devices that provide input to an embedded systems based on physical surroundings. They include temperature sensors, accelerometers, gyroscopes, switches, light sensors, color sensors, humidity sensors and many others. Fancier sensors include position encoders, time-of-flight distance sensors, and LIDAR.
Displays
These can be simple LEDs, multi-color LEDs, LED arrays, or fancier stuff. They can be controlled by General Purpose I/O pins (GPIO), or over a device bus, or via a communications bus. Those multi-color LED strings you can buy now pretty cheap are controlled by a one-wire bus and there is code for Arduino to handle them easily.
Actuators
Traditionally, actuators are electro-magnetic push/pull devices, but I include all devices that take embedded systems signals and affect the real world. A lot of these are motors, but there are also heaters and devices to control water flow and the like.
Software
Software for embedded systems is varied. A lot of microcontroller systems are built on "bare metal" software, meaning there's not a real operating system. Higher end ones are usually built on Linux. In the middle are FreeRTOS, AzureRTOS, and the like.
Device Control
The first (lowest) layer of software is device control - how do you access the registers of your sensors and actuators, how do you output display data, and so on. This includes bus access and device register settings.
Operation Control
The higher layer of software is operational control - after you read your sensors, how do you decide what happens next. What should you display? How should the actuators update?
Other Topics
Device Control Buses
There are a number of buses used in embedded systems to access devices. That number is 3 - asynchronous serial, SPI and I2C. Okay, there are others, but those 3 are the main ones. SPI, or serial peripheral interconnect, has a data out, data in, and a clock pin, and it normally has one or more chip select pins. To access a device, you enable the chip select for that device and drive data on one pin while listening to a response on the other pin.
I2C, or inter-integrated-circuit, has a shared data line and a clock line. Each device on an I2C bus should have a unique 7-bit address. The bus, controller by the processor, goes in cycles where each cycle starts with the address of the device requested, then either the processor writes data to the device, or it reads data from the device.
An asynchronous serial interface is commonly known as a serial port. These can be RS-232 signaling, or RS-485 or RS-422. There is normally a transmit line and a receive line, which have to be flipped between the processor and the device.
Device Registers
Most devices that you connect to will have register settings that allow you to control their operation. These are documented in a data sheet for the device. Registers can identify the device, provide device status, or allow you to change the function or set parameters. Registers usually have an address, and the data sheet often provides a list of registers known as a "register map".
Communication Buses
For larger embedded systems, you might need a communications bus to talk with other systems. This could be Ethernet (or WiFi), Bluetooth, or a CAN bus. The bus could be contained within your system, or it could be a means to access the outside world.
Comments
Post a Comment