Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 35

Embedded Systems Design- 1

(ICE – NITT)

Introduction

Dr. N. Mathivanan
Outline
• Overview of Embedded Systems
• Embedded System Architecture
• Processors: ARM - ARM7-TDMI, Cortex-M3
• Microcontroller: LPC214x, LPC1768 from NXP Ltd.
• Processor Peripherals: Memory, DMA, Interrupt controllers
• User Peripherals: Timer, PWM, ADC, DAC
• Communication Interfaces: UART, I2C, SPI, USB
• Network Protocols: CAN
• Embedded System Software, OS, RTOS, Scheduling
• Case Studies: 3 (assignment)
Books
• ARM System Developer’s Guide: Designing and Optimizing System
Software, Andrew N. Sloss, Dominic Symes, Chris Wright, Morgan
Kaufman Publication, (2004).
• LPC214x User Manual, UM10139: NXP Ltd. (2012)
• The Insider’s Guide to the Philips ARM7-Based Microcontrollers,
Trevor Martin, Hitex (UK) Ltd., (2005).
• Cortex-M3 Devices Generic User Guide: ARM DUI, 0552A, ID
121610 (2010)
• The Definitive Guide to ARM Cortex-M3, II Ed., Joseph Yiu,
(Elsevier – Newnes)
• PC Based Instrumentation: Concepts and Practice, N. Mathivanan,
PHI, (2007)
• Embedded System (Embedding a computer)
That has built-in small computer (not general-purpose)
Software embedded with it, preprogrammed.
Not programmable by users and not visible to users
It is a part of a larger system
System performing single function, repeatedly.
Starts by itself and runs independently without human intervention.
Responds, monitors, controls external environment
Uses sensors, actuators and has analog interfacing
Generally built around microcontroller
• Examples

Household appliance: Oven, DVD Player, Washing machine, Digi Camera


Automobile: Engine, brake, door, climate, stability controls
Computer peripheral controllers: Keyboard, disk drive, LAN
Computer peripheral: Printer, scanner,
Communication and networking device: Router
Building automation: safety, security, utility management systems
Bio-Medical: ECG recorder, Patient monitoring system
Industrial systems: Robotics, CNC machine controller
Environmental parameters monitoring: Temp., wind speed, RH
Scientific equipments: Spectrum analyzer, Storage oscilloscopes,
Entertainment: TV, Audio/Video equipments
Surveillance systems: Video camera, bio-metric, smart card reader
• Applications
Simple Control: Front panel control of oven, Remote controller, etc.
Image Processing: Decompression, Descrambling in TV set top box
Signal Processing: DVD players
Data Acquisition: data loggers, remote data loggers, transmitters
Network Control: GPIB controller, CAN bus, Ethernet, surveillance

• Camera
Typically 3 microcontrollers are used,
A 32-bit mC provides auto-focus fn.

• Automobile
More than 100 microcontrollers provide ABS, ESC, etc. functions
4-bit mC checks seat belt, 8-bit mC manages dashboard function,
Networked,
Embedded System Classification

• Based on functionality
Stand-alone, Networked, Real-time, Wireless

• Based on performance of microcontroller


Small scale:
Single 8/16-bit, mC/mP, little HW, SW complexity, battery operated
Medium scale:
Single/few 16/32-bit mC/DSP, RISC based, HW, SW complex,
Uses SW development tools – IDE, Simulators, debuggers
Large scale:
Large HW, SW complexity, Networking,
• Embedded System Characteristics:
Low power Consumption*,
High Code Density,
Limited resources (less memory, no hard-disk)
Run time efficiency,
Real-time operation? (not required in all systems),
Sophisticated functionality, Weight, Cost
May have to withstand extreme environmental conditions
(high temperature and humidity)
Choosing right hardware and software platforms a complex task
(based on user application)

• Designer objective:
To find cheapest solution that meets requirements
Typical Embedded System
• Differential drive mobile robot

M IC R O C O N TR O L L E R

M S lo t S e n s o r
EXT
PW M
D RIVER IN T
M S lo t S e n s o r

Z ig B e e
G P IO UA RT
T r a n s ie v e r

(L P C 2 1 2 9 )
Embedded System Organization
• Embedded System Hardware
CPU: Processor/Microcontroller/Embedded Processor
Memory: EEPROM, SRAM,
Controllers: Memory, Bus, interrupt & DMA controllers
Peripherals: ADC, DAC, Timer/Counter, PWM, RTC
Communication interfaces: UART, I2C, SPI, USB
Network interfaces: CAN, Ethernet,
Power Control

I/O Mapping: Memory mapped I/O, I/O mapped I/O


Sensors with associated signal conditioners
Actuators with associated drivers
Storage devices:
User interfaces -
Inputs: switches, touch pad, etc.
Outputs: Display devices, indicators
Reset (WDT),
Power supply,
Clock (crystal oscillator),
• Embedded System Software
Operating system:
Provides interface between user and hardware
Manages system resources
Memory, CPU, Device, File management
Controls execution of all kinds of programs
Provides security
Real-Time Operating System
Ensures to finish operations by deadline
Hard Real-Time
missing deadline results in system failure (safety critical)
Soft real-time:
missing deadline results in degraded performance
(playing video)
• Embedded System Software Continued…..
Software Development Tools
IDE, Cross Compilers, Emulators, Simulators
Debug tools
Debugger

Application software
Flash Memory Reprogramming
• In-System Programming (ISP)
Requires running program to be stopped
System set to programming mode
Restarted after reprogramming is completed

• In-Application Programming (IAP)


Target board can be reprogrammed while application is running
System Development Process
Hardware Software
Analyze requirements Develop program codes using tools

Define specifications Download to target system

Design block level architecture Test and Debug

Design component level hardware Repeat the above cycle till test O.K.

Assemble the target system


Microprocessor based system
• Microprocessor, ROM, RAM, I/O ports, shared bus

• Data transfer – between CPU and ROM / RAM / IO ports

• No memory to memory or between memory and I/O transfers

• The above transfer only with DMA controller


Microcontroller Internal Architecture

• Wide range of microcontrollers each targeted for particular appln.

• Computers are designed to have RISC / CISC architecture and

Von Neumann / Harvard architecture.


Reduced Instruction Set Computer - RISC
Type of processor architecture that utilizes highly optimized small set of

instructions.

Characteristics:

• Executes every instruction in one cycle (one cycle/instruction).

• All instructions have fixed length.

• Allows pipelining technology in which instruction fetch, decode and execute

stages to take place simultaneously.

• Generally incorporates large number of registers to reduce number of

memory accesses.

• Uses Load/Store instructions to access memory

• Uses less silicon, pin count, and runs at high clock speed

• Programs are lengthier (occupies more memory)

• Real-time applications
• Emphasis on software

• Examples: Atmel AVR, PIC, ARM microcontrollers


Complex Instruction Set Computer - CISC

Primary objective of CISC architecture is to allow the use of less amount

of memory space for a program

Characteristics:

• Emphasis on hardware

• Programs are shorter (high code density) and hence execution

faster

• Very large instruction set, instructions variable length

• Instruction pipelining cannot be implemented easily, (complicated)

• More specialized addressing modes are implemented

• Normally used in PCs, Workstations, Servers

• Examples: Intel x86 variants


Von Neumann Architecture
Computer architecture that shares single common bus system
for program and data. (single storage place for storing program,
data)
Characteristics
• Have shared signals and memory for program and data
• Fetches first instruction from program memory and then data from
data memory – slows down the program execution
• Bus width same for code and data
• Design of control unit is simple
• Used in PCs, Workstations, high performance computers
Harvard Architecture
Computer architecture that uses separate signals and
storage for program and data memory
Characteristics
• Allows simultaneous access of program and data
• Usually program memory is read-only and data memory is read-
write
• Width of program and data memory may be different
• Allows pipelining
• Used in embedded computers, digital signal processors
• Design of control unit is complex
• Free data memory cannot be used for instruction and vice-versa
Von Neumann vs. Harvard

Program In s t r u c ti o n In s t r u c ti o n
D e co d e r D e co d e r
M e m ory

R e g is t e r s R e g is t e r s

Control C o n tro l C on trol


D ata D ata P ro gram
D ata CPU M e m ory D ata CPU D ata M e m ory
M e m ory
Addr Addr Addr

V o n N e u m a n A r c h it e c t u r e H a r v a r d A r c h it e c t u r e
Microprocessor vs. Microcontroller
Microprocessor Microcontroller
Basic components Basic Components
ALU, Accumulator, Registers, Control CPU, ROM, RAM, Peripherals, I/O ports,
Unit, Instruction Decoder, Bus Serial interfaces, Controllers, Bus
Microcontrollers

PIC16F84A ARM7-TDMI Based LPC2148


Comparing Microcontrollers
ARM7- ARM
AT Atmega PIC PIC
8051 68HC11 TDMI-S Cortex-M3
89S52 328 16F84A 18F452
LPC2148 LPC1768
16-bit/ 16-bit/
CPU 8-bit 8-bit 8-bit 8-bit 8-bit 8-bit
32-bit 32-bit

Data Bus / 8-bit / 8-bit / 32-bit / 32-bit /


8-bit 8-bit 8-bit 8-bit
Instr bus 14-bit 16-bit 32-bit 32-bit

Address bus 16-bit 16-bit 16-bit  16-bit 14-bit 16-bit 32-bit 32-bit

Clock Speed 12 MHz 0–33 MHz 0–4 MHz 20 MHz 20 MHz 0–40 MHz 10–25 MHz 0-100 MHz

Memory                

Program Int - 4 KB 8 KB 14-bits


8 KB 32 KB 32 KB 512 kB 512 kB
Memory Extl - 64 KB (flash) 1 KB
Data 128 B RAM - 68B RAM-1536 B 32 KB + Up to
256 B 256 B 2 KB
Memory (64 KB ext) EEPROM-64B EEPROM-256B 8 KB 64 KB

Interrupts 5 8 18 2 4 18 22  

DMA One 8 Channel


No No No No No No
Channels (for USB) Gen purpose
4 x 8-bit 4 x 8-bit 40 I/O 4 x 8-bit
I/O ports 23/28/32 13 45 pins 70 / 52
32 I/O lines 32 I/O lines 1 x 3-bit
Peripherals
ARM7- ARM
AT Atmega PIC PIC
8051 68HC11 TDMI-S Cortex-M3
89S52 328 16F84A 18F452
LPC2148 LPC1768

One One One Two One


ADC No No 8 channel 8/6 Ch No 8 Channel 6+8 Chs, 8 Chs,
8-bit 10-bit 10-bit 10-bit 12-bit

One One
DAC No No No No No No
10-bit 10-bit

16-bit 2x8-bit, 4 2 x 32-bit each


One
Timers 2 x 16-bit 3x16-bit 3 Cap 1x16-bit,
8-bit
8-bit / 16- with 4 Cap/Mat 4
5 Comp comp, cap bit Chs

PWM 8-bit–4 Ch, Cap/comp


No No 6 No 6 1+6
Channels 16-bit–2Ch PWM – 2

RTC No No No Yes No No Yes Yes

WDT No Yes Yes Yes Yes Yes Yes Yes


Serial Interfaces
ARM7- ARM
AT Atmega PIC PIC
8051 68HC11 TDMI-S Cortex-M3
89S52 328 16F84A 18F452
LPC2148 LPC1768
Yes
I2C No No No One No
(MSSP)
Two Three

I2S No No No No No No No One

Yes
SPI No No One Yes No
(MSSP)
One One

SSP No No No No No Master SSP One 2

One Yes Yes 2 (one with 4 (one with


UART (Full Duplex) One (SCI)
No No No
modem cont) modem cont)

USART No No No Yes No Yes No  No

One, (Device One (device/


USB No No No No No No
compliant) host/ OTG)

Ethernet Ethernet
No No No No No No No
Port MAC

CAN No No No No No No 2 Chs 2 Chs


Other Features
ARM7- ARM
AT Atmega PIC PIC
8051 68HC11 TDMI-S Cortex-M3
89S52 328 16F84A 18F452
LPC2148 LPC1768
Power
2 modes, Yes Yes
Saving No 2 modes
Wait & stop
6 modes Yes Yes
Two Two
Modes
No. of 40/44/44 40/44/44 28/32/32p 18/18/20 40/44/44 100 LQFP
48/52
Pins, DIP/PLCC/ DIP/PLCC/
DIP/PLCC
DIP/MLF/ PDIP/SOIC/ PDIP/TQFP/ 64 LQFP 100 TFBGA
QFP TQFP TQFP SSOP PLCC 100WLCSP
Package
No. of
255 ? 109 131 35 75 ? ?
Instr.
CISC /
CISC CISC CISC RISC RISC RISC RISC RISC
RISC
Von Von Von Harvard Harvard Von
Architecture ---- Harvard
Neumann Neumann Neumann (modified) (modified) Neumann

Pipelining ----- ---- ---- ---- 2 stage 2 stage 3 stage 3 stage


Ethernet,
Multiplier,
Special Hardware Memory
----- ---- ---- Analog ---- Multiplier
Features Multiplier Management,
Compar
QEI
Review Questions
1. What is an embedded system?

2. Distinguish computer in embedded system from general purpose computer.

3. List the characteristics of embedded system.

4. Brief any four major fields where embedded systems are used.

5. Compare the characteristics of SRAM and DRAM.

6. What is the function of cache memory?

7. What is interrupt?

8. What is the function of interrupt controller?

9. What is DMA? Explain basic DMA operation.

10. Draw the functional block diagram of a mP based system. Explain

11. Name any four sensors used in embedded applications.

12. What are the basic elements providing analog I/O functions?
13. List various hardware components used in implementing embedded system

14. Brief the different types of Software used in embedded applications /

embedded system development

15. Outline the hardware design of any typical embedded system (may be a

mobile robot).

16. What are referred as uni-tasking and muti-tasking?

17. List a few synchronous and asynchronous serial communication interfaces.

18. Discuss: RISC vs. CISC

19. Discuss: Von Neumann vs. Harvard architectures

20. Distinguish PLC and embedded system

21. Name any one microcontroller for low end, mid range and high end

embedded applications.
Cycle Test - Question Paper Pattern
I. 1. Objective Type – three questions 3x1=3

a. -----------

b. -----------

c. -----------

2. Short Answer/Program/Design – one question 1 x 3 = 3

3. Descriptive type – one question 1x4=4

II. 1. Objective Type – three questions 3x1=3

a. -----------

b. -----------

c. -----------

2. Short Answer/Program/Design – one question 1 x 3 = 3

3. Descriptive type – one question 1x4=4

----

Total 20
Embedded System Implementation
• Hardware
Processing element:
Microcontroller – Processor, Memory (Flash, RAM, Cache)
Peripherals:
Input & Output devices
Interfacing sensors and actuators
Communication interfaces:
Interfacing protocols
Bus system
• Software
System software:
Operating system, RTOS,
Development tools: Cross compilers, emulators, simulators
Debug tools:
Application software

• Multi-tasking and concurrency


Embedded systems need to deal with several inputs and outputs and
multiple events occurring independently. Separate tasks handle the
situation
Multitasking – OS to allow switching back and forth between tasks.
Concurrency – Appearance of simultaneous execution of tasks.

You might also like