Embedded System
Intro
An embedded system is a microprocessor-based computer hardware system with software that is designed to perform a dedicated function, either as an independent system or as a part of a large system. At the core is an integrated circuit designed to carry out computation for real-time operations.
Basic structure of an embedded system
Sensor
The sensor measures and converts the physical quantity to an electrical signal, which can then be read by an embedded systems engineer or any electronic instrument. A sensor stores the measured quantity to the memory.
A-D Converter/D-A Converter
An analog-to-digital converter converts the analog signal sent by the sensor into a digital signal.
A digital-to-analog converter changes the digital data fed by the processor to analog data
Actuator
An actuator compares the output given by the D-A Converter to the actual output stored and stores the approved output.
Processor (MCU)
Processors assess the data to measure the output and store it to the memory.
- Clock - keeps everything synchronised - 80 MHzfor our mbed
- CPU – the heart of the microcontroller – the ARM Cortex-M4is core in the mbed
- Instruction decoder – controlsthe chip, carries out actions for
- Input/output ports – serial, parallel, digital, analogue, Pulse Width Modulation (PWM) etc
- Memory – program and data
不同种类的处理器
CPU(Central Processing Unit)
中央处理器,内部分成了控制器CU和运算器ALU (Arithmetic logic unit),数据来了,会先放到内存,控制器会从内存拿相应数据给到运算器进行运算,并会将结果返回到内存。当然,这只是简化的解释,实际会有取指令阶段、指令译码阶段、执行指令阶段、访存取数和结果写回等步骤
GPU (Graphics Processing Unit)
图形处理,主要擅长做类似图像处理这样的,计算密度大,数据间相关性小的并行计算。这是因为GPU在设计时,不像CPU将大部分区域用于数据存储和控制,而是给计算单元分配了更多区域。这样可以为并行计算的每个数据单元执行相同程序,不需要繁琐的流程控制而提高计算能力。
MCU (Moderate)
An MCU is an intelligent semiconductor IC that consists of a processor unit, memory modules, communication interfaces and peripherals.
ASIC(专用集成电路)(Specific)
An application-specific integrated circuit, or ASIC for short, is a chip created for a particular use or application, rather than for general-purpose use. They are usually made using silicon technology. Because of their uniqueness, they come in a many flavors and types.
FPGA (现场可编程门阵列)(General)
field programmable gate arrays
是作为专用集成电路(ASIC)领域中的一种半定制电路而出现的,既解决了定制电路的不足,又克服了原有可编程器件门电路数有限的缺点。
The instruction set
Type
CSIC (复杂指令集)
– Complex all encompassing instruction set
– Many microprocessors
– Some instructions are single clock cycle, more complex ones are several cycles (power vs. speed)
RISC(精简指令集)
– Reduced instruction set of more simple commands
– Many microcontrollers
– Most commands operate in fewer clock cycles
– Pipelined architecture common
The instructions for the CPU
Machine language
– Fundamental basic instructions (instruction code)
– 10000000 : Or 0x80 : Add register B to accumulator
– Very easy to make mistakes, can be made optimum
Assembly language(汇编语言)
– Mnenomics : ADD B
– Machine specific instructions
Programming language
– + : but this also contains a fetch from memory, load into register
B, fetch from memory and load into accumulator, add and then
output accumulator to memory instructions
– General, ‘easy’ to write, inefficient
Microcontroller: Everything (CPU, RAM, ROM, I/O, and clock) on one chip. The memory (RAM/ROM) is fixed and mounted on the chip
Microprocessor: CPU is stand-alone and RAM, ROM, I/O, Clock are separate. Flexible in the amount of RAM/ROM amount