임베디드시스템
Lecture #1 : 임베디드시스템 개요
강의 목차
1. 임베디드시스템 개요
2. 임베디드시스템 구성
3. 마이크로컨트롤러 개요
4. 마이크로컨트롤러 종류
5. ARM Cortext-M4 MCU 개요
2
임베디드시스템 개요 (1)
“임베디드시스템” ?
VS.
3
임베디드시스템 개요 (1)
“임베디드시스템” ?
VS.
4
임베디드시스템 개요 (2)
“임베디드시스템”?
“a computer system designed for specific control functions withi
n a larger system, often with real-time computing constraints. It i
s embedded as part of a complete device often including hardwar
e and mechanical parts.”
“시스템을 동작시키는 소프트웨어를 하드웨어에 내장하여특수한 기능만을 수행하게 되는 컴퓨터 시스템” (by Wikipedia)
상반 개념: 범용 컴퓨터시스템(General-Purpose Computer
System)
5
임베디드시스템 개요 (3)
“임베디드시스템”?
모바일 컴퓨팅, 유비쿼터스 컴퓨팅 그리고 IoT 시스템 구축을 위한 근간 기술
6
임베디드시스템 개요 (4)
임베디드시스템 응용 정보 가전 – 디지털TV, 인터넷 냉장고, 세탁기, 가정용 오디
오 시스템
정보 단말기 – 휴대폰, PDA, 영산 전화기
통신 장비 – 전화 교환기, 라우터(router), 공유기, 홈 게이트웨어(home gateway)
게임 기기 – 소형 게임기, 지능형 장난감
항공 우주 – 비행기, 우주선, 미사일
물류, 금융, 사무기기 – POS 단말기, ATM, 프린터
차량, 교통 – 자동차, 지능형 교통 제어 시스템
7
임베디드시스템 개요 (5)
임베디드시스템 응용
휴대폰 휴대용 게임기
디지털 TV 인터넷 냉장고 세탁기
전자사전 애완용 강아지 로봇
MP3 player
8
임베디드시스템 개요 (5)
임베디드시스템 응용
9
임베디드시스템 개요 (6)
임베디드시스템 분류
시스템 규모 및 OS 탑재 여부 등에 의한 분류
시스템 구성 및 개발방법론이 달라짐.
고수준임베디드시스템
지능형 임베디드 시스템
비교적 높은 성능의 CPU와 많은 용량의 메모리를 탑재
임베디드 리눅스 등의 임베디드 운영체제를 탑재하고 다양한 응용프로그램을 실행
예: 스마트폰, 스마트TV, 의료장비 등
단순임베디드시스템
저성능의 CPU와 저용량의 메모리를 탑재
별도의 운영체제가 없이 제어 프로그램이 탑재
예: mp3 player, 도어록, 가전장비 제어장치 등
10
임베디드시스템 개요 (7)
단순 임베디드시스템 제약 요건
범용 컴퓨터 시스템 대비
1. Single-functioned
– Executes a single program, repeatedly
2. Tightly-constrained
– Low cost, low power, small, fast, etc.
3. Reactive and real-time processing
– Continually reacts to changes in the system’s environment
– Must compute certain results in real-time without delay
11
임베디드시스템 구성 (1)
범용 컴퓨터 시스템 관점에서의 구성
기본 구성:
12
임베디드시스템 구성 (2)
범용 컴퓨터 시스템 관점에서의 구성
구성 요소 중심:
13
임베디드시스템 구성 (3)
범용 컴퓨터 시스템 관점에서의 구성
외형 및 크기 중심:
14
임베디드시스템 구성 (4)
범용 컴퓨터 시스템 관점에서의 구성 – 문제점
크기가 크다(size)
비용이 비싸다(cost)
성능이 고성능이다(performance)
주변 장치가 다르다(external interface)
사람과의 인터페이스와 데이터 저장을 목적
15
집적화(Integration)
임베디드시스템 구성 (5)
임베디드시스템 구성
마이크로컨트롤러 기반의 시스템 구성
16
MicroController
(MCU)
Comm.
I/F
Sensors
Actuators
임베디드시스템 구성 (6)
임베디드시스템 구성
예: 자동 판매기
17
키패드
마이크로컨트롤러동전제어
모듈
게이트
위치 센서
액정표시
장치
모바일
통신 모듈
입력 출력
게이트
작동기
Microcontroller (1)
Microprocessor
보통 CPU(Central Processing Unit)라고 부름
명령어 실행을 수행
18
Microcontroller (2)
Microcontroller
마이크로프로세서 코어, 메모리, 주변장치 및 통신 인터페이스를 하나의 칩에 집적화
DSP(Digital Signal Processing) 기능을 내장하기도 함
19
프로그램
메모리
데이터
메모리
마이크로 프로세서
코어
내부 데이터 /
어드레스 버스
주변장치
주변장치
디지털I/O
아날로그I/O
카운터 /
타이머
클럭
리셋
인터럽트
전원
Microcontroller 종류 (1)
8-bit Microcontrollers
Microchip Technology Atmel AVR
Freescale 68HC11 - based on the Motorola 6800 family
Microchip Technology PIC
Intel 8051
STMicroelectronics STM8
20
Microcontroller 종류 (2)
16-bit Microcontrollers
Microchip Technology dsPIC33 / PIC24
Infineon XE166
STMicroelectronics ST10
Texas InstrumentsTI MSP430
21
Microcontroller 종류 (3)
32-bit Microcontrollers
ARM Cortex-M
Freescale ColdFire
Microchip Technology Atmel AVR32
Microchip Technology PIC32
NXP Semiconductors LPC1000~LPC4000
STMicroelectronics STM32
Texas Instruments TI MSP432
22
ARM Ltd
ARM founded in November 1990
Advanced RISC Machines
Company headquarters in Cambridge, UK
Processor design centers in Cambridge, Austin, Sophia Antipolis and Hsinchu
Sales, support, and engineering offices all over the world
Best known for its range of RISC processor cores designs
Other products – fabric IP, software tools, models, cell libraries - to help partner
s develop and ship ARM-based SoCs
ARM does not manufacture silicon
More information about ARM and our offices on our web site:
http://www.arm.com/aboutarm/
ARM Offices Worldwide
More information on the website - http://www.arm.com/community/index.html
ARM Connected Community – 1000+
ARM Classic Processor Portfolio
Classic, market-proven processor technology
Instruction set architecture
Processor designs
300+ partners
800+ licenses
30Bu+ shippedARM968E-S™
ARM946E-S™
SC100™
ARM922T™
ARM1176JZ(F)-S™
ARM1156T2(F)-S™
ARM1136J(F)-S™
x1-4
ARM11™ MPCore™
ARM926EJ-S™
ARM7EJ-S™
ARMv6
ARMv4
ARMv5
ARM920T™
ARM966E-S™
ARM7TDMI(S)™
ARM1022E™
ARM1026EJ-S™
ARM1020E™
SC200™
ARM720T™
ARM Cortex Advanced Processors
Architectural compatibility across a wide application range
ARM Cortex™-A family:
Applications processors for feature-
rich OS and 3rd party applications
ARM Cortex-R family:
Embedded processors for real-time
signal processing, control applications
ARM Cortex-M family:
Microcontroller-oriented processors
for MCU, ASSP, and SoC applications
ARM SecurCore™ - Tamper-resistant security<12k gates...
Cortex-M0+
Cortex-M4
Cortex-M3
Cortex-A7
...2.5GHz
Cortex-A8
Cortex-A9
Cortex-A57
Cortex-A15
Cortex-A53
Cortex-A12
Cortex-A17
Cortex-M7
Cortex-A5
Cortex-R5
Cortex-R7
Cortex-R4
Cortex-M1
SC000
SC300
Cortex-M0
The Cortex FamilyCortex-A
Cortex-R
Cortex-M
disk drives digital cameras
appliances motors audio
servers netbooks mobile applicationsset top boxes
mobile baseband
Human interfaces
EPOS terminals
Image processing
Audio interfaces
Power management
UPS
Lighting systems
AC/DC converters
Microcontrollers address broad markets
Automotive
ABS systems
Chassis control
Airbag systems
Industrial Applications
Appliances
Lighting
Motion control
Medical instrumentation
Blood pressure meters
Glucose meters
Defibrillators
Connectivity
Bluetooth
Zigbee
Ethernet
Smart Metering
Gas and water
Electricity
Connectivity
Motor control
Field oriented control
Stepper motors
BLDC motors etc
Audio
MP3 players
Wireless headsets
Virtual surround
Embedded market drivers/trends
Connectivity Connectivity becoming ubiquitous
Smart technology Observe/react to the environment
Energy efficiency Green technology trends
Ease of use
Keep programming simple
Healthy software
ecosystem required
Real-time signal
processing essential
More capability, but
not higher MHz or mW!
Excellent tools
required
Driving the Migration to 32-BitImproving Code Reuse
Automatic code from meta-languages
eg. Simulink, LabVIEW, UML
Ease of use improvements
Accelerating Time To Market
Biggest single cost in product development
System abstraction demands extra resources
Savings from portable code offset device cost
Device Aggregation
Increasing System Connectivity
Application Complexity
Continual feature growth in existing applications
Complex algorithms require advanced math
Increasing analysis at the “node”
Aggregation of DSP and MCU devices
Multiple 8-Bit devices replaced with single 32-Bit
Substantially reduced BOM & tool chains costs
MCUs increasingly connected
USB, CAN, ENET, ZigBee, etc
Potentially multiple comms channels per device
Increasing complexity of stacks
32-Bit ARM devices now available for $1
Extensive open source community
Evaluation kits available for under $50
Reduced Development Barriers
ARM Cortex-M Processors
ARM Cortex-A Series:Applications processors for
feature-rich OS and user applications
ARM Cortex-R Series:Embedded processors for
real-time signal processing
and control applications
ARM Cortex-M Series:Deeply embedded processors
optimized for microcontroller
and low-power applications
Cortex-M family optimised for deeply embedded Microcontroller and low-power applications
Why another Cortex-M processor?
Address new markets requiring digital signal control Digital Signal(Processor + Micro)Controller
An intelligent blend of MCU and DSP features demanded Upper limits of bandwidth challenged in general purpose MCUs
Hard to learn/program technology in many general purpose DSPs
Extend the Cortex-M portfolio to cover new markets Cortex-M0 for mixed signal devices and state machine replacements
Cortex-M3 for mainstream 32-bit microcontrollers
Opportunity - high end MCUs and DSC market
Introduce ARM strengths to digital signal control market Very high energy efficiency – more processing in less mW
Strong software ecosystem – easy to program and use
Cortex-M4 for digital signal control
Cortex-M4
MCU
Ease of use
C Programming
Interrupt handling
Ultra low power
DSP
Harvard architecture
Single cycle MAC
Floating Point
Barrel shifter
Cortex-M processors
Forget traditional 8/16/32-bit classifications
Seamless architecture across all applications
Every product optimised for ultra low power and ease of use
Cortex-M0 Cortex-M3 Cortex-M4
“8/16-bit” applications “16/32-bit” applications “32-bit/DSC” applications
Binary and tool compatible
Cortex-M processors binary compatible
Cortex-M4 - What’s unique about it?
Most energy efficient 32-bit
embedded processor for
digital signal controllers
Brings high performance signal
processing within the reach of the
typical MCU programmer
Highest in-class efficiency
0
0.2
0.4
0.6
0.8
1
IIR FFT
0
0.2
0.4
0.6
0.8
1
IIR FIR FFT
Cycle counts on DSP tasks compared, smaller is better
16-bit MCU 32-bit MCU 32-bit Cortex-M4
The Cortex-M4 is ~2X more efficient on most DSP tasks than
leading 16 and 32 bit MCU devices with DSP extensions
Cortex-M3 – MP4 playback in <10MHz
0 5 10 15 20 25 30
Specialised Audio DSPs
Cortex-M4(estimated)
Discrete DSPs
General Purpose MCUs
MHz required for MP3 decode, smaller is better
Cortex-M3-M4 – very easy to use Complex hardware needs to be easy to program
On most DSPs assembly optimization is a must
Cortex-M processor can be fully programmed in C
Quicker learning curve for faster application development
Easy to maintain, reuse and port
Reusing code extremely important for faster delivery
Cortex-M0 and Cortex-M3 code fully upwards compatible
CMSIS support for Cortex-M4 already available
Programming Cortex-M fully in C leads to high optimization
Full compiler support already available through ARM software tools
Instruction Set Architecture
Thumb
32-bit operations in 16-bit instructions
Introduced in ARM7TDMI® processor (‘T’ stands for Thumb)
Subsequently supported in every ARM processor developed since
Thumb-2
Enables a performance optimized blend of 16/32-bit instructions
All processor operations can all be handled in ‘Thumb’ state
Supported across the Cortex-M processor range
Thumb®
ARM7 ARM9 Cortex-A9Cortex-R4Cortex-M3Cortex-M0
Thumb instruction set upwards compatibility
Cortex-M4
Thumb-2 advantage
All Cortex-M processors are binary upward compatible
Cortex-M3 includes a rich set of additional Thumb-2 instructions
64-bit multiply support
Hardware division
UDIV and SDIV (Unsigned or Signed divide)
Instructions take between 2 & 12
cycles depending on dividend and
devisor
Instruction is interruptible
(abandoned/restarted)
Bit field manipulation
0
0.2
0.4
0.6
0.8
1
1.2
1.4
ARM7 (Thumb) Cortex-M0 Cortex-M3
Performance efficiency (DMIPS/MHz)
Assembler example
Time: 1 clock cycle
Code size: 2 bytes
Time: 8 clock cycles
Code size: 8 bytes
Time: 48 clock cycles*
Code size: 48 bytes
MULS r0,r1,r0 MOV R1,&MulOp1
MOV R2,&MulOp2
MOV SumLo,R3
MOV SumHi,R4
(Memory mapped mu
ltiply unit)
MOV A, XL ; 2 bytes
MOV B, YL ; 3 bytes
MUL AB; 1 byte
MOV R0, A; 1 byte
MOV R1, B; 3 bytes
MOV A, XL ; 2 bytes
MOV B, YH ; 3 bytes
MUL AB; 1 byte
ADD A, R1; 1 byte
MOV R1, A; 1 byte
MOV A, B ; 2 bytes
ADDC A, #0 ; 2 bytes
MOV R2, A; 1 byte
MOV A, XH ; 2 bytes
MOV B, YL ; 3 bytes
ARM Cortex-M16-bit example8-bit example (8051)
MUL AB; 1 byte
ADD A, R1; 1 byte
MOV R1, A; 1 byte
MOV A, B ; 2 bytes
ADDC A, R2 ; 1 bytes
MOV R2, A; 1 byte
MOV A, XH ; 2 bytes
MOV B, YH ; 3 bytes
MUL AB; 1 byte
ADD A, R2; 1 byte
MOV R2, A; 1 byte
MOV A, B ; 2 bytes
ADDC A, #0 ; 2 bytes
MOV R3, A; 1 byte
Consider a 16-bit multiply operation
Required for 10-bit ADC data filtering, encryption algorithms, audio
16-bit multiply operation is compared below
* 8051 needs at least one cycle per instruction byte fetch as they only have an 8-bit interface
Cortex-M3 Processor Feature Summary
Configurable Interrupt Controller:
1:240 Interrupts
1:255 Priority Levels
NMI & SysTick
Central Core:
1.25 DMIPS/MHz
Thumb-2 / Thumb ISA
Hardware Divide
1cycle Multiply
ETM (Optional)
MPU (Optional)
8-Region Memory Pro
tection Unit
Debug Access Port: J
TAG or Serial Wire
DWT (Optional)
4x Data Watchpoints
& Event Monitors
ITM (Optional)
Low-cost trace via sin
gle wire output
FPB (Optional)
8x Hardware Breakpo
ints w. program patch
ing
2x AHB-Lite Buses
I_CODE (Instruction Code Bus)
D_CODE (Data / Coefficients Code Bus)
1x AHB-Lite Buses
SYSTEM (SRAM & Fast Peripherals)
1x APB Bus
ARM Peripheral Bus (Internal & Slow Peripherals)
Wake-Up Interrupt Controller:
Low gate count
Configurable Number
of Interrupts
Suitable for separate
power domain
ARM Cortex-M4 processor