Vous êtes sur la page 1sur 42

12-Aug-19

Lecture 1.2

Embedded System Components


Memory Controllers Interface

Software
(Application Programs)

Coprocessors
Processor

ASIC

Converters

Analog Digital Analog

Vijay Savani
APEC, IT, NU.
vijay.savani@nirmauni.ac.in

Outline
• Typical Embedded System Blocks
• Hardware or Software
• Components of Embedded System
 Processor
 Hardware (Peripheral)
 Software (Programme)
 Operating System (RTOS)
 Case Study: Digital Camera

12-Aug-19 Vijay Savani @ 2019 2

Vijay Savani @ 2019


12-Aug-19
2

Books Referred . .
1. Introduction to Embedded Systems by Shibu K V
(Tata McGraw Hill Education Private Limited).
(Ch2)
2. Embedded System design: A unified
hardware/software introduction by Frank Vahid
and Tony Givargis (Wiley Publishers)
3. Embedded System Architecture, Programming
and Design Raj Kamal (Tata McGraw Hill
Education Private Limited)
4. Computers as Components Principles of
embedded computing system design, by Wayne
Wolf (Morgan Kaufmann Publishers)
5. Internet resources

12-Aug-19 Vijay Savani @ 2019 3

The Typical Embedded System


FPGA/ASIC/DSP/SoC
Microprocessor/controller Embedded
Firmware

Memory

Communication Interface

System
I/p Ports Core O/p Ports
(Sensors)
(Actuators)

Other supporting
Integrated Circuits &
subsystems

Embedded System

Real World
12-Aug-19 Vijay Savani @ 2019 4

Vijay Savani @ 2019


12-Aug-19
3

Embedded System Component

A generic embedded system


12-Aug-19 Vijay Savani @ 2019 5

Hardware/Software Partitioning

12-Aug-19 Vijay Savani @ 2019 7

Vijay Savani @ 2019


12-Aug-19
4

Hardware or Software
• In an embedded system, assigning functions to hardware
and software is a vital consideration. Many tasks can be
performed in hardware or in software – for example: timing
• Hardware implementation has the advantages that the task
execution is faster than in software implementation.
• Hardware adds a “per unit cost” – where as software adds
a “fixed cost”.
• On the flip side, the hardware chip occupies space, cost
money, and consumes power.
• The choice between hardware and software is driven by
considerations of speed, cost, need for flexibility in
modification of underlying algorithms.
• Typically, only those functions are implemented in
hardware whose speed specifications cannot be met by
software solution.

12-Aug-19 Vijay Savani @ 2019 8

Hardware/Software Partitioning

12-Aug-19 Vijay Savani @ 2019 9

Vijay Savani @ 2019


12-Aug-19
5

Components
of
Embedded System

Component of Embedded System


 Processor
 General Purpose Processor (8/16/31..Bits)(GPP)
 Single Purpose Processor (SPP)
 Multi Processor System using GPPs
 Application Specific System/Instruction set Processor (ASSP/ASIP)
 Programmable Logic Devices (PLDs)
 Commercial off-the-shelf devices (COTS)

 Hardware (Peripheral)
 Timers, Interrupt controller, I/O Devices, Memories, Ports, Sensors,
Actuators etc

 Software (Programme)
 Which may perform concurrently the series of tasks or
multiple tasks.
 Operating System (RTOS)
 RTOS defines the way the system work
12-Aug-19 Vijay Savani @ 2019 11

Vijay Savani @ 2019


12-Aug-19
6

Component of Embedded
System
Processor

Processor
• Each design is unique in embedded
system.
• The kind of processors used in them are
quite varied.
• 8-bit, 16-bit, and 32-bit
processors/microcontroller are available
with different processing powers and
memory addressing capabilities.
• Micro Processor / Micro Controller ???

12-Aug-19 Vijay Savani @ 2019 13

Vijay Savani @ 2019


12-Aug-19
7

Microprocessor Vs Microcontroller
Microprocessor Microcontroller
A silicon chip with heart A silicon chip with hand, leg along
CPU Only with heart
CPU + RAM + GP Register + ROM +
Timer + I/O etc..
It is a dependent unit. It is a self contained unit and it
Requires other chips like doesn’t require external Interrupt
Timers, Program and data Controller, Timer, UART etc for its
memory chips, etc.. functioning
Most of the time general Mostly application oriented or
purpose in design and domain specific
operation
Doesn’t contain a built in I/O Most of the processors contain
port. multiple built-in I/O ports (8 or 16
or 32 bit Port or as individual port
pins)
Targeted for high end market Targeted for embedded market where
where performance is important performance is not so critical
(At present this demarcation is invalid)
Limited power saving options Includes lot of power saving features
compared12-Aug-19
to microcontrollers Vijay Savani @ 2019 14

The Top Architectures

12-Aug-19 Vijay Savani @ 2019 15

Vijay Savani @ 2019


12-Aug-19
8

Harvard V/s Von-Neumann


CISC Vs. RISC

Harvard V/s Von-Neumann


Harvard Architecture Von-Neumann Architecture
Separate buses for Instruction and Single shared bus for
Data fetching Instruction and Data fetching

Easier to Pipeline, so high Low performance Compared to


performance can be achieved Harvard Architecture
Comparatively high cost Cheaper
No memory alignment problems Allows self modifying codes†

Since data memory and program Since data memory and


memory are stored physically in program memory are stored
different locations, no chances for physically in same chip,
accidental corruption of program chances for accidental
memory corruption of program memory

12-Aug-19 Vijay Savani @ 2019 17

Vijay Savani @ 2019


12-Aug-19
9

CISC - Complex Instruction Set Computer - 1


• Idea was to reduce no of instruction in
compiled code
• Memory was costly and Slower than
processor
• To simplify the compiler construction
• Complex data path
• Micro programmed control unit
• Each word in memory represents on control
word
• Fewer, more powerful instructions
• Smaller programs & More space for data
12-Aug-19 Vijay Savani @ 2019 18

CISC - Complex Instruction Set Computer - 2


• Large Number of instructions each carrying
out a different permutation of the same
operation (INC,ADD)
• Instructions provided for complex
operations
• Different instructions of different format
(operands)
• Different instructions of different length
(bytes)
• Many addressing modes
• Requires multiple cycles for a execution
• Complex Hardware Simplify compiler’s task
12-Aug-19 Vijay Savani @ 2019 19

Vijay Savani @ 2019


12-Aug-19
10

RISC – Reduced Instruction Set Computer - 1


• Mostly simple instruction are executed
in CISC
• RISC
– Smaller Clock cycle
– Smaller no of Clock cycle per instruction
– Efficient pipelining
– Hard wired control logic
– Larger Register File
– LOAD/STORE Architecture
– Require more sophisticated COMPILER

12-Aug-19 Vijay Savani @ 2019 20

RISC – Reduced Instruction Set Computer - 2


• Inclusion of mechanisms to interpret all the possible
combinations of opcodes and operands might slow down
even very simple operations.
• “make the common case faster”
• Instruction for simple operation that can be executed in a
single cycle.
• Each instruction of fixed length –Facilities pipelining.
• Large GPRs
• Load store Architecture No memory access
• Few addressing modes (reg-reg)
• Fixed instruction format (ease of decoding)
• Simpler Hardware runs faster! (with compiler help)

RISC : Risk Intelligently Shifted to Compilers



12-Aug-19 Vijay Savani @ 2019 21

Vijay Savani @ 2019


12-Aug-19
11

GENERAL PURPOSE PROCESSOR (GPP)


• The designer of a general-purpose processor builds a
device suitable for a variety of applications, to
maximize the number of devices sold.
• One feature of such a processor is a program
memory – the designer does not know what program
will run on the processor, so cannot build the
program into the digital circuit.
• Another feature is a general datapath
• An embedded system designer, however, need not be
concerned about the design of a general-purpose
processor. An embedded system designer simply uses
a general-purpose processor.
• Using a general-purpose processor in an embedded
system may result in several design-metric benefits
12-Aug-19 Vijay Savani @ 2019 22

8-bit Processors
• Application involving minimal processing and
I/O functions such as digital watches,
refrigerators, air-conditioners and VCRs use
an 8-bit micro controller.
• The hardware cost is minimal since an 8-bit
micro controller has on-chip memory and
serial interface and so on.
• The system becomes portable interns of size.
• Usually popular for consumer electronics.
• Like A digital watch incorporating an 8-bit
controller uses a set of buttons for input and
an LCD for output.
12-Aug-19 Vijay Savani @ 2019 23

Vijay Savani @ 2019


12-Aug-19
12

Embedded Controller Market Players


• 8 – bit:
– 8051 + derivatives
– Microchip
– Motorola
– Rabbit
semiconductors
– Atmel AVR

12-Aug-19 Vijay Savani @ 2019 24

16-/32-/64-bit Processors
• Application involving more processing and I/O
functions such as process control systems,
telecom switches, routers and protocol
converters use 16-/32- bit processor with
more computing and communication
capabilities.

• Industrial and single-board computers


incorporated in industrial automation
processes, video game players and graphic
accelerators need 64-bit processor.

12-Aug-19 Vijay Savani @ 2019 25

Vijay Savani @ 2019


12-Aug-19
13

Embedded Controller Market Players


• 16 – bit:
 80196 – INTEL
 dsPIC – MICROCHIP
 MSP 430 – TI
 32 – bit:
 FPGA soft core from
Xilinx/Altera
 ARM family Cortex-M3,
 Atmel AT91 series, ST10
series, Philips LPC 2000
series, Texas Instrument
C16x and
TMS470R1B1M, Samsung
S3C44B0X

12-Aug-19 Vijay Savani @ 2019 26

SRAM Some Port line


Timer UART We Can solve this problem by External device !!…
Flash

8/16 bit Micro controller

External One more question ?…


Bus

Usb Cntrl CAN


Cntrl
Can we interface all control
in to one
Ethernet
Cntrl
Lag of I/O interface & Speed !..
Makes us Head Ache
For USB : - Cypress Semiconductor
For Ethernet :- RT80192
For CAN :- MSP853

Vijay Savani @ 2019


12-Aug-19
14

Why we required all peripherals in Single chip ?..Its compulsory ?

No.. Only one communication media is enough (eg: UART)

But, real world application demands good


Transfer speed and Processing speed

What would be the solution


then….
Low Speed with 8 bit data

USB will Work’s ,But Unexpected


data speed

transfer at the speed of 480Mbps

Solution

We need processor, which incorporates all interface and feature ….

Solutions is 32 bit Microcontroller…!!


Which one I should choose……

12-Aug-19 Vijay Savani @ 2019 29

Vijay Savani @ 2019


12-Aug-19
15

Available 32bit Micro controller


• ARM
• AVR32
• PIC32
• Power PC Soft-core/Hard-core
• MicroBlaze Soft-core/Hard-core
• NIOS soft-core
• Intel etc. . .

12-Aug-19 Vijay Savani @ 2019 30

DIP, SIP, pin grid array, quad flat


Power saving modes???

ISP

Eg. AVR Studio is free

12-Aug-19 Vijay Savani @ 2019 31

Vijay Savani @ 2019


12-Aug-19
16

SINGLE PURPOSE PROCESSOR (SPP)

• A single-purpose processor is a digital circuit


designed to execute exactly one
program.(Camera)
• The JPEG codec, for example, executes a
single program that compresses and
decompresses video frames.
• An embedded system designer creates a
single-purpose processor by designing a
custom digital circuit
• Using a single-purpose processor in an embedded
system results in several design metric benefits and
drawbacks, which are essentially the inverse of those
for general purpose processors
12-Aug-19 Vijay Savani @ 2019 32

APPLICATION SPECIFIC SYSTEM PROCESSOR (ASSP)

• An application-specific instruction-set
processor (or ASIP) can serve as a
compromise between the above processor
options.
• An ASIP is designed for a particular class of
applications with common characteristics,
such as digital-signal processing,
telecommunications, embedded control, etc.
• Using an ASIP in an embedded system can
provide the benefit of flexibility while still
achieving good performance, power and size.

12-Aug-19 Vijay Savani @ 2019 33

Vijay Savani @ 2019


12-Aug-19
17

APPLICATION SPECIFIC SYSTEM PROCESSOR (ASSP)

• ASSP is dedicated to specific


tasks(domain) and provides a faster
solution.
• An ASSP is used as an additional
processing unit for running the
application in place of using embedded
software.
– Media processor
– IO processor
– Network processor
– A domain specific processor
12-Aug-19 Vijay Savani @ 2019 34

e. g. DIGITAL SIGNAL PROCESSOR (DSP)

• DSP is a single chip VLSI unit.


• It includes the computational capabilities of
microprocessor and multiply &
accumulate units (MAC).
• DSP has large number of applications such as
image processing, audio, video &
telecommunication processing systems.
• It is used when signal processing functions
are to be processed fast.

• Examples:
– Texas Instruments- C28x Series, C54xx or C64xx
– Analog Devices SHARC or Tiger SHARC
– Motorola 5600xx
12-Aug-19 Vijay Savani @ 2019 35

Vijay Savani @ 2019


12-Aug-19
18

APPLICATION SPECIFIC SYSTEM PROCESSOR (ASSP)

Examples:
• TI DSP TMS320DM310
• Trimedia Phillips Media Processor 1x00
series for Processing Streaming and
Data Networks
• Image, Video and Speech: PNX 1300,
PNX 1500 (2002)

12-Aug-19 Vijay Savani @ 2019 36

MULTI PROCESSOR SYSTEM USING GPPs

• Multiple processors are used when


a single processor does not meet
the needs of different task.

• The operations of all the


processors are synchronized to
obtain an optimum performance.

12-Aug-19 Vijay Savani @ 2019 37

Vijay Savani @ 2019


12-Aug-19
19

Others . . .
• Programmable Logic Devices (PLDs)
• Programmable Logic Devices (PLDs) – CPLDs
and FPGA
• Application Specific Integrated Circuit (ASIC)
• Commercial off-the-shelf devices (COTS)

12-Aug-19 Vijay Savani @ 2019 38

Advantages of PLDs – FPGA & CPLD


 Offers more flexibility during design cycle
 Smaller time to prototype
 Less NRE Cost
 Offer features such as built-in hardwired
processors, substantial amounts of memory, clock
management systems, and support for many of the
latest, very fast device-to-device signaling
technologies
 Re-programmability
 As an when required
 Highest amount of logic density (FPGA)
12-Aug-19 Vijay Savani @ 2019 39

Vijay Savani @ 2019


12-Aug-19
20

Commercial off-the-shelf devices (COTS)

• Which is used ‘as-is’


• Designed to be easily installed and to
interoperate with existing system
components HW/SW
• EX- RF Remote, TCP/IP Plug-in
Module(WIZnet),
• Advantages:
 Readily available
 Mass produced - Cheaper
 Cut down development time

12-Aug-19 Vijay Savani @ 2019 40

Comparison between alternatives

12-Aug-19 Vijay Savani @ 2019 41

Vijay Savani @ 2019


12-Aug-19
21

Component
of Embedded System
Hardware
(Peripherals – Interfacing)

• Memory
• Peripherals
• Sensors & Actuators
• Communication Interface
• Firmware & Software
• Other System Components

Memory
• An embedded system also needs memory for two purposes –
1) To store its program
2) To store its data
• Unlike normal desktops, in which programs and data are stored at
same place, embedded systems store data and programs in different
memories.
• This is simply because the embedded system doesn't have a hard
drive and the program must be stored in memory, even when the
power is turned off.

FLASH Code Memory NVRAM Read/Write


(ROM) Memory (RAM)

PROM Masked ROM


EPROM EEPROM SRAM DRAM NVRAM
(OTP) (MROM)

12-Aug-19 Vijay Savani @ 2019 43

Vijay Savani @ 2019


12-Aug-19
22

Memory
 Memory – Program Storage Memory
 Masked ROM (MROM)
 Programmable Read Only Memory (PROM) /
(OTP)
 Erasable Programmable Read Only Memory
(EPROM)
 FLASH

 Memory – Random Access Memory (RAM)


 Static RAM (SRAM)
 Dynamic RAM (DRAM)
 Non Volatile RAM (NVRAM)

12-Aug-19 Vijay Savani @ 2019 44

Peripherals
• Any additional requirement in an
embedded system is dependent on the
equipment it is controlling.

• Very often these systems have a


standard serial port, network
interfaces, input/output (I/O) interface
or hardware to interact with sensors
and activators on the equipment.

12-Aug-19 Vijay Savani @ 2019 45

Vijay Savani @ 2019


12-Aug-19
23

Interfacing
• Plays important role in connecting
processor to peripherals
• Interfacing requirements of devices vary
a lot
• It is necessary to make the device and
processor compatible to each other
• Wide range of interfacing standards
available

12-Aug-19 Vijay Savani @ 2019 46

Sensors & Actuators


Sensor:
A transducer device which converts energy from
one form to another for any measurement or
control purpose. Sensors acts as input device
Eg. Hall Effect Sensor which measures the distance between the cushion
and magnet in the Smart Running shoes from adidas

Actuator:
A form of transducer device (mechanical or
electrical) which converts signals to corresponding
physical action (motion). Actuator acts as an
output device

Eg. Micro motor actuator which adjusts the position of the cushioning
element in the Smart Running shoes from adidas
12-Aug-19 Vijay Savani @ 2019 47

Vijay Savani @ 2019


12-Aug-19
24

I/O Subsystem
• Light Emitting Diode (LED)
• 7-Segment LED Display
• Optocoupler
• Stepper Motor
• Relay
• Push button switch
• Keyboard
• Programmable Peripheral Interface
(PPI)
12-Aug-19 Vijay Savani @ 2019 48

Communication Interfaces
• Wide range of interfacing standards
available
• Example:
– SPI, I2C, UART,
– 1-Wire Interface, Parallel Interface
– USB, Fire Wire
– CAN, LIN, TIN
– IrDA, Bluetooth
– Wi-Fi, ZigBee, GPRS, etc.

12-Aug-19 Vijay Savani @ 2019 49

Vijay Savani @ 2019


12-Aug-19
25

Embedded Firmware
 The control algorithm (Program instructions)
 The configuration settings
 The embedded firmware can be developed in
various methods like
 high level languages like Embedded C/C++ using
an Integrated Development Environment
 The IDE will contain an editor, compiler, linker,
debugger, simulator etc. IDEs are different for
different family of processors/controllers.
 Write the program in Assembly Language using
the Instructions Supported by your application’s
target processor/controller
12-Aug-19 Vijay Savani @ 2019 50

Other System Components


 Reset Circuit
 Brown-out Protection Circuit
 Oscillator Unit
 Real Time Clock (RTC)
 Watch Dog Timer (WDT)

12-Aug-19 Vijay Savani @ 2019 51

Vijay Savani @ 2019


12-Aug-19
26

Reset Circuit
 Essential to ensure that the
device is operating at correct
voltage
 It brings internal registers and
the different hardware systems
of the processor/controller to a
known state
 Starts the firmware execution
from the reset vector
 The reset vector can be
relocated to an address for
processors/controllers
supporting bootloader
 The reset signal can be either
active high or active low
12-Aug-19 Vijay Savani @ 2019 52

Brown-out Protection Circuit


 Prevents the processor/controller from
unexpected program execution
behavior when the supply voltage to Vcc

the processor/controller falls below a R1


specified voltage V BE
 The processor behavior may not be R2
Q
predictable if the supply voltage falls Reset Pulse
below the recommended operating DZ Active Low
Vz

voltage. It may lead to situations like R3

data corruption GND


 A brown-out protection circuit holds
the processor/controller in reset state,
when the operating voltage falls below
the threshold, until it rises above the
threshold voltage
12-Aug-19 Vijay Savani @ 2019 53

Vijay Savani @ 2019


12-Aug-19
27

Oscillator Unit
• The instruction execution of a microprocessor/controller occurs in sync with a
clock signal
• The oscillator unit of the embedded system is responsible for generating the
precise clock for the processor

Microcontroller Microprocessor
C : Capacitor
Y : Resonator

Crystal Oscillator
Oscillator
Unit
Quartz Crystal Clock Input Pin
Resonator C C
Y Oscillator
Unit

12-Aug-19 Vijay Savani @ 2019 54

Real Time Clock (RTC)


• The system component responsible for keeping track
of time.
• Holds information like current time in 12 hour /24
hour format, date, month, year, day of the week etc
and supplies timing reference to the system
• RTC is intended to function even in the absence of
power.
• RTCs are available in the form of Integrated Circuits
from different semiconductor manufacturers like
Maxim/Dallas, ST Microelectronics etc
• A timing reference is essential for synchronizing the
operations of the OS kernel.

12-Aug-19 Vijay Savani @ 2019 55

Vijay Savani @ 2019


12-Aug-19
28

Watch Dog Timer (WDT)


• A timer unit for monitoring the firmware execution
• Watchdog timer increments or decrements a free running
counter with each clock pulse
• Generates a reset signal to reset the processor if the count
reaches zero for a down counting watchdog, or the highest
count value for an up counting watchdog
• If the watchdog counter is in the enabled state, the
firmware can write a zero to it before starting the execution
of a piece of code and the watchdog will start counting.
• Firmware execution doesn’t complete due to
malfunctioning, within the time required by the watchdog
to reach the maximum count, the counter will generate a
reset pulse and this will reset the processor
• If the firmware execution completes before the expiration of
the watchdog timer the WDT can be stopped from action
12-Aug-19 Vijay Savani @ 2019 56

Watch Dog Timer (WDT)

Microoprocessor/
Controller
Watchdog
Free Running
Reset Pin
Counter

Watchdog Reset

System Clock

External Watch Dog Timer Unit Interfacing with Processor

12-Aug-19 Vijay Savani @ 2019 57

Vijay Savani @ 2019


12-Aug-19
29

Case Study

Case Study: Digital Camera


Memory Controllers Interface

Software
(Application Programs)

Processor
Coprocessors

ASIC

Converters

Analog Digital Analog

12-Aug-19 Vijay Savani @ 2019 59

Vijay Savani @ 2019


12-Aug-19
30

Case Study: Digital Camera

12-Aug-19 Vijay Savani @ 2019 60

Case Study: Mobile Phone

12-Aug-19 Vijay Savani @ 2019 61

Vijay Savani @ 2019


12-Aug-19
31

Case Study: Mobile Phone

12-Aug-19 Vijay Savani @ 2019 62

Case Study: Assignment


• Embedded Navigation System in a Car

12-Aug-19 Vijay Savani @ 2019 63

Vijay Savani @ 2019


12-Aug-19
32

Case Study: Assignment


• Automotive Infotainment

12-Aug-19 Vijay Savani @ 2019 64

Component of Embedded
System
Software & Operating System
also Software Testing

Vijay Savani @ 2019


12-Aug-19
33

Embedded Software

12-Aug-19 Vijay Savani @ 2019 66

Links for Further Reading


• Best Practices for Debugging Embedded
Software - Part 1
http://www.youtube.com/watch?v=Qb6K9ctZ
mxA
• Best Practices for Debugging Embedded
Software - Part 2
http://www.youtube.com/watch?v=7Rd_HlFs
Lt4
• GoogleTechTalk Becoming a Software
Testing Expert
http://www.youtube.com/watch?v=3FTwaojN
kXw
12-Aug-19 Vijay Savani @ 2019 67

Vijay Savani @ 2019


12-Aug-19
34

Embedded Software
• The embedded software interacts with the
hardware circuitry to generate the desire
functionality.
• This interaction is use for efficient
management of I/O operations, memory and
specific tasks to be carried out in accordance
with the stipulated response time.
• Fundamentally, embedded software is.
– Resource-constrained.
– Footprint constrained.
– Time restricted.
How smart things think
12-Aug-19 Vijay Savani @ 2019 68

Development Environment
• The embedded system may not
have a keyboard, a screen, a disk
drive and other peripheral devices
required for programming and
development tasks.
• Therefore most of the programming
for embedded systems is done on a
host, which we commonly refer as
personal computer systems with all
the required programming tools.
• Only after the program has been
written, compiled, assembled and
linked it is moved to the target or
the system that is shipped to the
customers.
12-Aug-19 Vijay Savani @ 2019 69

Vijay Savani @ 2019


12-Aug-19
35

Structure of Development Tool

Embedded Workbench IDE

Text Debugger
editor

Project Simulator

Custom plug-ins
manager
output
(editors, source code
control systems, etc.)
compilers
assembler

RTOS plug-ins

Linker,
libraries

12-Aug-19 Vijay Savani @ 2019 70

Cross Platform Development

assemblers

compilers

emulators

simulators

linkers

debuggers
12-Aug-19 Vijay Savani @ 2019 71

Vijay Savani @ 2019


12-Aug-19
36

Terminologies

• Editor
• Assembler
• Compiler
• Linker
• Debugger
• Simulator
• Emulator

12-Aug-19 Vijay Savani @ 2019 72

Editor
 Software code for a micro controller is written in a
programming language of choice (often assembler
or C).
 This source code is written with a standard ASCII
text editor and saved as an ASCII text file.
 Programming in assembler involves learning a
micro controller's specific instruction set
(assembler mnemonics). But, results in the most
compact and fastest code.
 A higher level language like C is for the most part
independent of a micro controller's specific
architecture, but still requires some controller
specific extensions of the standard language to be
able to control all of a chip's peripherals and
functionality.
12-Aug-19 Vijay Savani @ 2019 73

Vijay Savani @ 2019


12-Aug-19
37

Assembler & Compiler & Linker


• Assembler
• To translate humane readable instruction code into hex-
code that represent the machine instruction(opcode).
• To develop modular programming today most assembler
comes with linker.
• Compiler
• This will convert high level language program into linker
readable format
• Linker
• Link code modules saved in different files together into
a single final program.
• At the same time they take care of a chip's memory
allocation by assigning each instruction to a micro
controller memory addresses in such a way that different
modules do not overlap.
12-Aug-19 Vijay Savani @ 2019 74

Debugger
• A debugger is a piece of software running on the PC.
• A debugger allows you to download your code to the
emulator's memory and then control all of the
functions of the emulator from a PC.
• Common debugging features include the capability to
examine and modify the micro controller's .
– On-chip registers.
– Data- and program-memory.
– Pausing or stopping program executing at defined
program locations by setting breakpoints.
– Single-stepping.
– Looking at a history of executed code (trace).

12-Aug-19 Vijay Savani @ 2019 75

Vijay Savani @ 2019


12-Aug-19
38

Simulator
• Simulators try to model the behavior of the
complete micro controller in software.
• No matter how fast your PC, there is no
simulator in the market that can actually
simulate a micro controller's behavior in real-time.
• A simulator can also not talk to your target
system, so functions that rely on external
components are difficult to verify.
• For that reason simulators are best suited to test
algorithms that run completely within the
microcontroller (like a math routine for
example).

12-Aug-19 Vijay Savani @ 2019 76

Few Available Tools . . .


• Keil – Core-51/ARM
• IAR – AVR Microcontroller
• Mplab IDE – PIC Microcontroller
• Real View – To develop interactive
environment for Smartphone.
• Green hills – Compiler/Debugger
• Open source etc.,

12-Aug-19 Vijay Savani @ 2019 77

Vijay Savani @ 2019


12-Aug-19
39

Supporting Programming Languages

• Assembly
•C
• C++
• Embedded C
• Embedded C++
• Extended Embedded C++
• Python

12-Aug-19 Vijay Savani @ 2019 78

C/C++ Compilers
• C/C++ compilers generally having
following C++ features:
 Classes
 Polymorphism
 Overloading of operators and
function names
 C++ templates and the standard
template library (STL)
 Namespaces
 Mutable specifier

12-Aug-19 Vijay Savani @ 2019 79

Vijay Savani @ 2019


12-Aug-19
40

Embedded C++
• Embedded C++ is a subset of the C++
programming language
• Embedded C++ lacks the following
features of C++
– Templates
– Multiple inheritance
– Exception handling
– Runtime type information
– New cast syntax (operators dynamic_cast, static_cast,
reinterpret_cast, and const_cast)
– Namespaces

12-Aug-19 Vijay Savani @ 2019 80

Hardware Debugging
• IAR support following hardware debugger
• Angel
• GDB server
• J-link/j-trace
• IAR ROM
• LMI FTDI
• Macraigor
• RDI
• And third party
• Using J-LINK/J-TRACE we can download program
into flash memory
• These two debugger provide support for access CPU
on-chip RAM
12-Aug-19 Vijay Savani @ 2019 81

Vijay Savani @ 2019


12-Aug-19
41

Operating System
• Multitasking (multiprocessing or
multithreaded) software
• Scheduling multiple tasks
• Management of
– Processes
– Memory
– Device & ports
– Network
– File system
– Timers
– Event functions, inter-processor communication, shared
memory, security, GUIs, ...

12-Aug-19 Vijay Savani @ 2019 82

Real Time Operating System


• Embedded software is most often
designed for deterministic performance,
task and ISR latencies in addition to
the OS functions
• Performing multiple actions and
controlling multiple devices and their
ISRs with defined real time constraints
and with deadlines for these
• Task and ISRs priority allocations, their
preemptive scheduling, ..
12-Aug-19 Vijay Savani @ 2019 83

Vijay Savani @ 2019


12-Aug-19
42

Learn by Doing
Excel Thru Experimentation
Lead by Example

All The Best

Vijay Savani @ 2019 84

Vijay Savani @ 2019

Vous aimerez peut-être aussi