Professional Documents
Culture Documents
Dipl.-Ing. B. Kommey
050 770 3286
Overview
Embedded
Systems
Embedded Applications
Systems
Reference
Books
Course
Outline
Course Info
Course Information
COE 358 Embedded Systems Requirements
Course Grading
Class Work
Final Exams 5%
70%
Mid-
Attendance
Semester
5%
Exams (20%)
Course Outline
Introduction to Embedded Systems – lecture 1
Memories – lecture 3
Peripherals – lecture 4
Course Outline
Converters – lecture 5
Software – lecture 6
Course Outline
Buses – lecture 9
References Books
References Books
References Books
References Books
References Books
References Books
References Books
Application
Definition
Areas
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 17
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Hardware Software
Introduction
and here.
to Embedded Systems
Introduction
and even
to Embedded Systems
here...
Almost everywhere
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 23
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Embedded System
Components
Hardware Software
Digital Analog
Converters
Components Components
Application Exception
Programs Handlers
Analog
Components
Controllers
Sensors Actuators
( IO Ports)
Converters
Analog-Digital Digital-Analog
ADC DAC
Thank You
Dipl.-Ing. B. Kommey
bkommey.coe@knust.edu.gh
nii_kommey@msn.com
Overview
Processor CPU
Classifications Types
Overview
Processor Classifications
Application
Application
General Single Specific Int.
Specific IC,
Purpose (GP) Purpose (SP) Processor,
(ASIC)
(ASIP)
Overview
Processor Types
Digital Signal
Microprocessor Microcontroller
Processor
(uP) (uC)
(DSP)
Processors
The Central Processing Unit CPU is the most important
component in embedded system.
The CPU exists in integrated form along with memory
and other peripherals
A processor is an artifact that computes or run
algorithms.
It has a controller and data path
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 35
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Processors
Processors classifications
Benefits
- Fast
- Low power
- Small size
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 40
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
GP vrs. ASIC
GP: ASIC:
• Programmable controller • Hardwired controller
• Control logic is stored in memory • No need for program memory
• Fetch / decode overhead and cache
• General data-path • No fetch / decode overhead
• Typical bit-width (8, 16, 32, 64) • Highly tuned data-path
• Complete set of ALU • Custom bit-width
• Large set of registers • Custom ALU
• Custom set of registers
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 42
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
ASIP
DSP Characterization
Microprocessors specialized for signal processing applications
Harvard architecture
Two to Four memory accesses per cycle
Dedicated hardware performs all key arithmetic operations in 1 cycle
DSP Characterization
Specialized addressing
Hardware looping.
Interrupts disabled during certain operations
Limited or no register Shadowing
Rarely have dynamic features
Relatively narrow range of DSP oriented on-chip
peripherals and I/O interfaces
Synchronous serial port
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 47
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Microprocessor
A microprocessor is a general purpose digital computer central processing unit
It contains:
Arithmetic Logic Unit ALU
Program Counter PC
Stack Pointer SP
Working Registers
Clock Timing Circuit and
Interrupt Circuit
Microcontroller (uC)
A microcontroller is a true computer on a chip.
Microcontroller (uC)
uC vary in data size 8 bit uC
4 bit uC Examples
Examples Intel 8051
Hitachi HMCS40 Motorola 68HC11
Toshiba TLCS47 TI TMS7500
National COP420 Atmel ATmega128
TI TMS1000
Microcontroller (uC)
16 bit uC 32 bit uC
Examples Examples
Hitachi H8/532 Intel 80960
Intel 8096 Freescale/Motorola
National HPC16164 PowerPC
ARM Cortex
The CPU
The CPU
Converts data into information
Control center
Set of electronic circuitry that executes stored program
instructions
Two parts
Control Unit (CU)
Arithmetic Logic Unit (ALU)
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 55
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Control Unit CU
Part of the hardware that is in-charge
Arithmetic Operations
Addition
Subtraction
Multiplication
Division
Logical Operations
Evaluates conditions
Makes comparisons
Can compare
Numbers
Letters
Special characters
Registers
Special-purpose
High-speed
Temporary storage
Located inside CPU
Instruction register
Holds instruction Data register
currently being Holds data waiting to be processed
executed
Holds results from processing
Secondary
Types of Storage
Data that will eventually be used
Long-term
Memory
Data that will be used in the near future
Temporary
Faster access than storage
Registers
Data immediately related to the operation being executed
Faster access than memory
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 61
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Executing Programs
CU gets an instruction and places it in memory
CU decodes the instruction
CU notifies the appropriate part of hardware to
take action
Machine Cycle
I-time
Machine Cycle
E-time
Execution
CU moves the data from memory to registers in the
ALU
ALU is given control and executes the instruction
Control returns to the CU
System Clock
System clock produces pulses at a fixed rate
Each pulse is one Machine Cycle
Coding Schemes
ASCII
Uses one 8 bit byte
28 = 256 possible combinations or characters
Coding Schemes
EBCDIC
Uses one 8 bit byte
28 =256 possible combinations or characters
Used primarily on IBM-compatible mainframes
Coding Schemes
Unicode
Uses two 8 bit bytes (16 bits)
216 = 65,536 possible combinations or characters
Supports characters for all the world’s languages
Downward-compatible with ASCII
Microprocessor Components
Control Unit – CU
Arithmetic / Logic Unit – ALU
Registers
System clock
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 72
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Bus Line
Paths that transport electrical signals
System bus
Transports data between the CPU and memory
Bus width
Number of bits of data that can be carried at a time
Normally the same as the CPUs word size
Microprocessor speed
Bus line size
Availability of cache
Flash memory
RISC computers
Parallel processing
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 74
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Microprocessor Speed
Clock speed
Megahertz (MHz)
Gigahertz (GHz)
Number of instructions per second
Millions of Instructions Per Second (MIPS)
Performance of complex mathematical operations
One million floating-point operations per second (Megaflop )
Instruction Sets
CISC Technology
Complex Instruction Set Computing
Conventional computers
Instruction Sets
RISC Technology
Reduced Instruction Set Computing
Small subset of instructions
Increases speed
Programs with few complex instructions
Graphics
Engineering
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 78
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Types of Processing
Serial processing
Execute one instruction at a time
Fetch, decode, execute, store
Types of Processing
Parallel Processing
Multiple processors used at the same time
Can perform trillions of floating-point
instructions per second (teraflops)
Ex: network servers, supercomputers
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 80
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Types of Processing
Pipelining
Instruction’s action need not be complete before the next begins
Fetch instruction 1, begin to decode and fetch instruction 2
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 81
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Thank You
Dipl.-Ing. B. Kommey
bkommey.coe@knust.edu.gh
nii_kommey@msn.com
Overview
Memory
Overview
Memory
Definition
Storage-
Writeability
permanance
Overview
Memory
Types
ROM RAM
OTP
ROM EPROM EEPROM
ROM
SRAM/
Flash NVRAM
DRAM
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 86
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Memories
What is a memory?
-Artifact that stores bits
-Storage fabric and access logic
Write-ability
-Manner and speed a memory can be written
Storage-permanence
-ability of memory to hold stored bits after they are written
Different types of memories
-Flash, SRAM, DRAM, etc.
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 87
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Storage Write-ability
High End
• Processor writes to memory simply and quickly e.g. RAM
Middle Range
• Processor writes to memory, but slower e.g. FLASH, EEPROM
Lower range
• Special equipment, “programmer”, must be used to write to memory e.g. EPROM, OTP ROM
Low end
• Bits stored only during fabrication e.g. Mask-programmed ROM
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 88
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Storage Permanance
High End
• Essentially never loses bits e.g. mask-programmed ROM
Middle Range
• Holds bits days/months/years after memory’s power source turned off e.g. NVRAM
Lower Range
• Holds bits as long as power supplied to memory e.g. SRAM
Low End
• Begins to lose bits almost immediately after written e.g. DRAM
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 89
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Memory chips are organized into a number of locations within the IC.
Each location can hold 1 bit, 4 bits, 8 bits, or even 16 bits, depending on how it is
designed internally.
Memory Speed
Speed
The speed of the memory chip is commonly
referred to as its access time.
Memory Types
ROM (read-only memory)
ROM is a type of memory that does not lose its contents when the
power is turned off.
For this reason, ROM is also called nonvolatile memory.
Memory Types
EPROM (erasable programmable ROM) and UV-EPROM
Memory Types
EEPROM (electrically erasable programmable ROM)
Memory Types
Flash memory EPROM
Memory Types
Mask ROM
Memory Types
RAM (random access memory)
RAM memory is called volatile memory since cutting off the power to the IC
results in the loss of data.
SRAM (static RAM)
Storage cells in static RAM memory are
made of flip-flops and therefore do not
require refreshing in order to keep their
data.
Memory Types
NV-RAM (nonvolatile RAM)
New type of nonvolatile RAM called
NV-RAM.
Memory Types
Checksum byte ROM
checksum will detect any corruption of the contents of ROM
Memory Types
DRAM organization
74LS138 as Decoder
74LS138 Decoder
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 103
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
74LS373 D Latch
Address/Data Multiplexing
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 105
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Data, Address, and Control Buses for the 8031 8031 Connection to External Program ROM
PSEN
On-chip and Off-chip Program Code Access
On-chip and off-chip code ROM
In such a system we still have EA = Vcc, meaning that upon reset the 8051
executes the on-chip program first; then, when it reaches the end of the on-
chip ROM it switches to external ROM for the rest of the program code.
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 107
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
MOVX instruction
8031 Connection to External Program ROM, Data RAM, and Data ROM
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 112
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Memory Management
We have two kinds of memory management: (static and
dynamic)
Static
provides tasks with temporary data space.
The system’s free memory is divided into a pool of fixed sized
memory blocks.
When a task finishes using a memory block it must return it to
the pool.
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 115
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Memory Management
Memory Management
Dynamic
employs memory swapping, overlays, multiprogramming with
a fixed number of tasks (MFT), multiprogramming with a
variable number of tasks (MVT) and demand paging.
Memory Management
MFT: a fixed number of equalized code parts are in
memory at the same time.
MVT: is like MFT except that the size of the partition
depends on the needs of the program.
Memory Allocation
is the process of assigning blocks of memory on request
Memory Allocation
Static Memory Allocation
Memory Allocation
Dynamic Memory Allocation
How to satisfy a request of size n from a list of free holes. This
means that during runtime, a process is asking the system for a
memory block of a certain size to hold a certain data structure.
Memory Allocation
Best-fit:
Allocate the smallest hole that is big enough; must search entire list,
unless ordered by size.
Buddy:
it divides memory into partitions to try to satisfy a memory request as
suitably as possible.
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 123
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Thank You
Dipl.-Ing. B. Kommey
bkommey.coe@knust.edu.gh
nii_kommey@msn.com
Overview
Peripherals
Stepper
Timers Counters Watchdog UART PWM LCD Keypad
Motor
Peripherals
Perform specific computation task
Timers
Timer is a very common and useful peripheral.
It is used to generate events at specific times or
measures duration of specific events which are external
to the processor
Timer is a programmable device i.e. the time period can
be adjusted by writing specific bit patterns to some
registers called timer control register
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 128
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Timers
Basic timer
Top
Reset
Timers
In short, timers are used
measure time intervals
To generate timed output events
To measure input events
Top: max count reached
Timer has range and resolution eg. 8MHz 16 bit Timer
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 130
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Counter
Counter is like a timer, but counts pulses on a general
input signal rather than clock
Example
count cars passing over a sensor
can often configure device as either a timer or
counter
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 131
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Counter
Timer/counter
Clk
2x1 mux 16-bit up counter Cnt
16
Cnt_in Top
Reset
Mode
Watchdog Timer
UART
UART: Universal Asynchronous Receiver Transmitter
-Takes parallel data and transmits serially
-Receives serial data and converts to parallel
Parity:
extra bit for simple error checking
Start bit, stop bit
Baud rate
-Signal changes per second
-Bit rate, sometimes different
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 134
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Common use:
control average voltage to electric device ( Simpler than DC-DC
converter or digital-analog converter), dc motor speed, dimmer
lights
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 135
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
LCD
Keypad
N1
N2
N3 k_pressed
N4
M1
M2
M3
M4 4
key_code key_code
keypad controller
N=4, M=4
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 137
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Analog Components
Analog Components
Example of sensors:
Analog Components
Example of actuators:
BUSes
BUS
• An artifact that transfers bits. It could be wires, air, or fiber and interface
logic
BUSes
BUS
Protocols
• Ports
• Timing Diagrams
• Read and write cycles
Others
• Arbitration scheme, error detection/correction, DMA, etc.
Wireless Communication
Infrared (IR)
Electronic wave frequencies just below visible light spectrum
Diode emits infrared light to generate signal
Infrared transistor detects signal, conducts when exposed to infrared
light
Cheap to build
Need line of sight, limited range
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 145
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Wireless Communication
Radio frequency (RF)
Electromagnetic wave frequencies in radio spectrum
Analog circuitry and antenna needed on both
sides of transmission
Serial Communication
A single wire used for data transfer
One or more additional wires used for control
(but, some protocols may not use additional control
wires)
Higher throughput for long distance communication,
often across processing node
Lower cost in terms of wires (cable)
Examples: USB, Ethernet, RS232, I2C, etc.
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 147
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Parallel Communication
Multiple buses used for data transfer
One or more additional wires used for control
Higher throughput for short distance communication
• Data misalignment problem
• Often used within a processing node
Higher cost in terms of wires (cable)
16-bit up
Top1
Prescaler 16-bit up
Clk
counter
Clock period
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 149
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Prescaler 16 Cnt2
counter
Reset Top2
Divides clock =
Top Time with prescaler
Increases range, Clk Prescaler 16-bit up
decreases resolution
counter
Terminal count
Mode
Watchdog Timer
osc clk overflow overflow
to system reset
prescaler scalereg timereg or
interrupt
checkreg
Must reset timer every X time unit, else timer generates a signal
Common use: detect failure, self-reset
Another use: timeouts
e.g., ATM machine
16-bit timer, 2 microsec. resolution
timereg value = 2*(216-1)–X = 131070–X ; For 2 min., X = 120,000 microsec.
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 153
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Watchdog Timer
/* main.c */ watchdog_reset_routine(){
/* checkreg is set so we can load
main(){ value into timereg. Zero is loaded
wait until card inserted into scalereg and 11070 is loaded into
call watchdog_reset_routine timereg */
1 0 0 1 1 0 1 1 1 0 0 1 1 0 1 1
1 0 0 1 1 0 1 1
/* controls period */
PWMP = 0xff;
From
/* controls duty cycle */ processor DC
MOTOR
PWM1 = 0x7f;
while(1){};
} 5V
The PWM alone cannot drive the DC motor,
a possible way to implement a driver is
using an MJE3055T NPN transistor. A
B
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 156
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
LCD Controller
E communications bus
R/W
RS
DB7–DB0
8
microcontroller LCD controller
LCD Controller
CODES
I/D = 1 cursor moves left DL = 1 8-bit
I/D = 0 cursor moves right DL = 0 4-bit
S = 1 with display shift N = 1 2 rows
S/C =1 display shift N = 0 1 row
S/C = 0 cursor movement F = 1 5x10 dots
R/L = 1 shift to right F = 0 5x7 dots
R/L = 0 shift to left
LCD Controller
RS R/W DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0 Description
Thank You
Dipl.-Ing. B. Kommey
bkommey.coe@knust.edu.gh
nii_kommey@msn.com
Converters
Converters
Analog-Digital Digital-Analog
Converters ADC Converters DAC
Converters
Analog-Digital
Converters ADC
Successive Integrating
Tracking Sigma-
Flash ADC Approximation (Dual-
ADC Delta ADC
ADC Slope) ADC
Converters
Digital-Analog
Converters DAC
AD7801 ADV7120
ADC – Resolution
ADC Types
Types of ADC
- Tracking ADC
- Flash ADC
- Successive Approximation ADC
- Integrating (Dual-Slope) ADC
- Sigma-Delta ADC
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 169
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Tracking ADC
Tracking ADC
The tracking ADC has a comparator, a counter and a DAC
The comparator compares the input voltage to the DAC output
voltage
If input is higher than the DAC voltage, the counter counts up
If input is lower than the DAC voltage, the counter counts
down
The drawback of a tracking ADC is speed
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 171
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Flash ADC
Flash ADC
A 4-bit ADC will have 16 comparators, an 8-bit ADC will have 256
comparators.
One input of all the comparators is connected to the input to be
measured.
The other input of each comparator is connected to one point in a
string of resistors.
As you move up the resistor string, each comparator trips at a higher
voltage.
Flash ADC
All of the comparator outputs connect to a block of logic that
determines the output based on which comparators are low
and which are high.
Flash ADCs are very fast, but take enormous amounts of IC real
estate to implement.
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 174
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Sigma-Delta ADC
Sigma-Delta ADC
Sigma-Delta ADC
The output of the DAC drives the other side of the differential amp, so
the output of the differential amp is the difference between the input
voltage and the DAC output.
Thank You
Dipl.-Ing. B. Kommey
bkommey.coe@knust.edu.gh
nii_kommey@msn.com
050 770 32 86
Whatsup: 0507703286
Skype_id: calculus.affairs
Overview
Embedded
Software
Machine
Assembly C
Code
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 188
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Software
Several languages used for programming microcontrollers
- Machine language
- Assembly language
- C
- C++
- Basic
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 189
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Machine Code
Machine code is a binary data that the microcontroller itself
understands
Each instruction has a binary value called opcode
Example: light LED
40B2 5A80 0120
42F2 0029
40F2 0018 002A
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 190
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Assembly
Instructions are written in words called mnemonics
A program called assembler translates the mnemonics into
machine code
Example: light LED
ORG 0xF000 ; Start of 4KB flash memory
Reset: ; Execution starts here
mov.w #WDTPW|WDTHOLD ,& WDTCTL ; Stop watchdog timer
mov.b #00001000b,& P2OUT ; LED2 (P2.4) on , LED1 (P2.3) off (active low!)
mov.b #00011000b,& P2DIR ; Set pins with LEDs to output
InfLoop: ; Loop forever ...
jmp InfLoop ; ... doing nothing
;-----------------------------------------------------------------------
ORG 0xFFFE ; Address of MSP430 RESET Vector
DW Reset ; Address to start execution
END
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 191
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Embedded C Programming
Embedded C Programming
8051 Microcontroller
Intel introduced 8051, referred as MCS-51, in 1981
8051 Microcontroller
One serial port
Four I/O ports, each 8 bits wide
6 interrupt sources
8051 Microcontroller
8051 Programming in C
Compilers produce hex files that is downloaded to ROM
of microcontroller
The size of hex file is the main concern
Microcontrollers have limited on-chip ROM
Code space for 8051 is limited to 64K bytes
8051 Programming in C
The reasons for writing programs in C
It is easier and less time consuming to write in C than
Assembly
C is easier to modify and update
You can use code available in function libraries
C code is portable to other microcontroller with little of no
modification
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 204
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Data Types
A good understanding of C data types for 8051 can help
programmers to create smaller hex files
Unsigned char
Signed char
Unsigned int
Signed int
Sbit (single bit)
Bit and sfr
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 205
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Question
Data Type Examples
Write an 8051 C program to send hex values for ASCII characters of 0, 1, 2, 3,
4, 5, A, B, C, and D to port P1.
Solution:
#include <reg51.h>
void main(void)
{
unsigned char mynum[] = “012345ABCD”;
unsigned char z;
for ( z = 0; z <= 10; z++)
P1 = mynum[z];}
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 208
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Time Delay
There are two ways to create a time delay in 8051 C
Time Delay
The 8051 design
– The number of machine cycle
– The number of clock periods per machine cycle
Compiler choice
– C compiler converts the C statements and functions to Assembly
language instructions
– Different compilers produce different code
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 215
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Solution:
#include <reg51.h>
#define LCDData P1 //LCDData declaration
sbit En=P2^0; //the enable pin
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 219
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Logic Operations
Logical operators
AND (&&), OR (||), and NOT (!)
Bit-wise operators
AND (&), OR (|), EX-OR (^), Inverter (~),
Shift Right (>>), and Shift Left (<<)
These operators are widely used in software
engineering for embedded systems and control
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 221
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Logic Operations
Solution:
#include <reg51.h>
void MSDelay(unsigned int);
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 223
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Data Serialization
Serializing data is a way of sending a byte of data one bit at a time
through a single pin of microcontroller
Transfer data one bit a time and control the sequence of data and
spaces in between them
In many new generations of devices such as LCD, ADC, and ROM the
serial versions are becoming popular since they take less space on a
PCB
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 230
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Thank You
Dipl.-Ing. B. Kommey
bkommey.coe@knust.edu.gh
nii_kommey@msn.com
050 770 32 86
Whatsup: 0507703286
Skype_id: calculus.affairs
Embedded System
Development Demo
nanoLOC Embedded
Development PCB Layout
Development Development
Workflow Design
Kit Cycle
Designer Workflow
Evaluation/Revision
/Release
Implementation
Lab Test
Develop prototype
Study requirements
demo
goal content
application
Electronic Components
Power supply socket – 2.1mm barrel connector for max 3.0V
power supply
Battery connector pin for 3.0V battery pack
Power On/Off switch
Power on LED to indicate power supply is on
Voltage regulator – dc-dc converter used to boost and supply
constant 3.3 output voltage
nanoLOC transceiver chip – slave -operates between 2.4V-3.6V
Antenna (SMA, SMD)
TX/RX LED to indicate transmission and reception activity
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 242
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Electronic Components
ATmega128L microcontroller
– master -drives nanoLOC via SPI interface – operates between 2.7V-5.5V
PC connect-DE-9 D-sub connector for serial interface using RS232
Light sensor – light to digital converter TSL2561T
Temperature sensor (AD7814)
IEEE 1149.1 standard JTAG connector for flashing and debugging
purposes
In-System Programming (ISP) connector for on-chip in-system
programming
Six IO ports – ATmega128L provides portA to portF
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 243
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Electronic Components
8 programmable activity LEDs – Anodes and cathodes
are connected to port via resistors to the ground
Reset button to reset microcontroller and additional
three user programmable buttons
A 32.768kHz quartz for timer or counter oscillator
A 7.3728MHz crystal quartz as an external oscillator
Pin access points for testing and measurements
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 244
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Schematics – RS232/UART
Schematics – ATmega128L
Schematics – Sensors
Development Cycle
Thank You
Dipl.-Ing. B. Kommey
bkommey.coe@knust.edu.gh
nii_kommey@msn.com
050 770 32 86
Whatsup: 0507703286
Skype_id: calculus.affairs
Overview
Communications
Parallel Communication
Multiple data, control, and possibly power wires
One bit per wire
Parallel Communication
Bus must be kept short
long parallel wires result in high capacitance values
which requires more time to charge/discharge
Data misalignment between wires increases as
length increases
Higher cost, bulky
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 270
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Wireless Communication
Infrared (IR)
Electronic wave frequencies just below visible light spectrum
Diode emits infrared light to generate signal
Infrared transistor detects signal, conducts when exposed
to infrared light
Cheap to build
Need line of sight, limited range
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 271
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Wireless Communication
Radio frequency (RF)
Electromagnetic wave frequencies in radio spectrum
Protocol Overview
Polling
Simple and deterministic
Needs a master node
Master periodically polls slave
nodes
Consumes bandwidth
Token Ring
Token Ring
Node can hold token, send message all the way round the ring,
and pass token on
Deterministic under heavy load
Some token overhead
Can add priority by having extra field in token
More complexity in detecting token lost
Cable break disrupts network (needs dual ring)
E.g. many Wide Area Networks (WANs)
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 281
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
CSMA/CD
Easy to add or take off new nodes without initialization
and configuration
Low overhead at light traffic
Unbound overhead at heavy traffic (messages keeps
colliding) hence low determinacy and efficiency.
Requires detection circuit
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 283
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
CSMA/CA
CSMA/CA
Rotate time slot for fairness
Network return to normal state when all slots are
unused.
Variations
Reservation CSMA – no. of slots equal to no. of nodes
Not practical if networks has many nodes.
No. of slots less than no. of nodes – randomly allocate slots
to nodes.
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 286
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Automotive Standards
Controller Area Network (CAN)
Event triggered, Arbitration
Time Triggered Protocol (TTP)
Time triggered, TDMA
Local Interconnect Network (LIN)
Time triggered, master-slave
Media Oriented System Transport (MOST)
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 287
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Military Standards
MIL-STD 1553
The current 1553 data bus is widely used in military applications, with a
nominal throughput of 1 Mb/s.
MIL-STD 1773
Mil-Std-1773 defines a fiber optic bus. This system is widely used for on-
board command and telemetry transfer between military spacecraft
components, subsystems and instruments, and within complex
components themselves. 1773 AS, has a dual rate of 1 Mb/s or 20 Mb/s.
ARINC 429
A commercial aircraft data bus. It is widely implemented in the
commercial aircraft avionics industry. Performance is 100Kb/s or 12.5Kb/s.
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 289
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Serial Communication
Computers transfer data in two ways:
Parallel
Often 8 or more lines (wire conductors) are used to transfer
data to a device that is only a few feet away
Serial
To transfer to a device located many meters away, the serial
method is used
The data is sent one bit at a time
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 290
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Serial Communication
This gives 25% overhead, i.e. each 8-bit character with an extra 2 bits
UART chips allow programming of the parity bit for odd-, even-, and
no-parity options
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 301
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
As far as the conductor wire is concerned, the baud rate and bps are
the same, and we use the terms interchangeably
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 302
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
IBM PC/XT could transfer data at the rate of 100 to 9600 bps
Pentium-based PCs transfer data at rates as high as 56K bps
In asynchronous serial data communication, the baud rate is limited
to 100K bps
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 303
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
RS232 Standard
An interfacing standard RS232 was set by the Electronics
Industries Association (EIA) in 1960
The standard was set long before the advent of the TTL logic family,
its input and output voltage levels are not TTL compatible
RS232 Standard
RS232 Standard
Since not all pins are used in PC cables, IBM introduced the DB-9
version of the serial I/O standard
RS232 Pins
DTR (data terminal ready)
When terminal is turned on, it sends out signal DTR to indicate that it is ready for
communication
DSR (data set ready)
When DCE is turned on and has gone through the self-test, it assert DSR to indicate that it is
ready to communicate
RTS (request to send)
When the DTE device has byte to transmit, it assert RTS to signal the modem that it has a byte
of data to transmit
CTS (clear to send)
When the modem has room for storing the data it is to receive, it sends out signal CTS to DTE
to indicate that it can receive the data now
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 308
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
RS232 Pins
DCD (data carrier detect)
The modem asserts signal DCD to inform the DTE that a valid carrier
has been detected and that contact between it and the other modem
is established
RI (ring indicator)
An output from the modem and an input to a PC indicates that the
telephone is ringing
It goes on and off in synchronous with the ringing sound
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 309
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
These two pins are called TxD and RxD and are part of the port 3 group (P3.0 and
P3.1)
These pins are TTL compatible; therefore, they require a line driver to make
them RS232 compatible
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 310
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Max232
We need a line driver (voltage converter) to convert the R232’s signals to TTL voltage levels
that will be acceptable to 8051’s TxD and RxD pins
Max233
To save board space, some designers use MAX233 chip from Maxim
MAX233 performs the same job as MAX232 but eliminates the need for
capacitors
Notice that MAX233 and MAX232 are not pin compatible
Solution:
The machine cycle frequency of 8051 = 11.0592 / 12 = 921.6 kHz, and
921.6 kHz / 32 = 28,800 Hz is frequency by UART to timer 1 to set baud
rate.
SBUF Register
SBUF is an 8-bit register used solely for serial communication
SBUF Register
When the bits are received serially via RxD, the 8051 deframes
it by eliminating the stop and start bits,
making a byte out of the data received, and then placing it in
SBUF
SCON Register
SCON is an 8-bit register used to program the start bit, stop bit, and
data bits of data framing, among other things
SM2
This enables the multiprocessing capability of the 8051
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 320
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
SCON Register
REN (receive enable)
It is a bit-adressable register
When it is high, it allows 8051 to receive data on RxD pin
If low, the receiver is disable
TI (transmit interrupt)
When 8051 finishes the transfer of 8-bit character
It raises TI flag to indicate that it is ready to transfer another byte
TI bit is raised at the beginning of the stop bit
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 321
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
SCON Register
RI (receive interrupt)
When 8051 receives data serially via RxD, it gets rid of
the start and stop bits and places the byte in SBUF
register
It raises the RI flag bit to indicate that a byte has been
received and should be picked up before it is lost
RI is raised halfway through the stop bit
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 322
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
1. TMOD register is loaded with the value 20H, indicating the use of
timer 1 in mode 2 (8-bit auto-reload) to set baud rate
2. The TH1 is loaded with one of the values to set baud rate for serial
data transfer
3. The SCON register is loaded with the value 50H, indicating serial
mode 1, where an 8-bit data is framed with start and stop bits
4. TR1 is set to 1 to start timer 1
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 323
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Importance of TI Flag
The steps that 8051 goes through in transmitting a character via TxD
1. The byte character to be transmitted is written into the SBUF
register
2. The start bit is transferred
3. The 8-bit character is transferred on bit at a time
4. The stop bit is transferred
It is during the transfer of the stop bit that 8051 raises the TI flag,
indicating that the last character was transmitted
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 326
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Importance of TI Flag
5. By monitoring the TI flag, we make sure that we are not
overloading the SBUF
Importance of TI Flag
By checking the TI flag bit, we know whether or not the 8051 is ready
to transfer another byte
It must be noted that TI flag bit is raised by 8051 itself when it
finishes data transfer
It must be cleared by the programmer with instruction CLR TI
If we write a byte into SBUF before the TI flag bit is raised, we risk
the loss of a portion of the byte being transferred
The TI bit can be checked by
The instruction JNB TI,xx
Using an interrupt
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 328
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Solution:
MOV TMOD, #20H ;timer 1,mode 2(auto reload)
MOV TH1, #-6 ;4800 baud rate
MOV SCON, #50H ;8-bit, 1 stop, REN enabled
SETB TR1 ;start timer 1
HERE: JNB RI, HERE ;wait for char to come in
MOV A, SBUF ;saving incoming byte in A
MOV P1, A ;send to port 1
CLR RI ;get ready to receive next byte
SJMP HERE ;keep getting data
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 331
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Importance of RI Flag
In receiving bit via its RxD pin, 8051 goes through the following steps
1. It receives the start bit
Indicating that the next bit is the first bit of the character byte it is about
to receive
2. The 8-bit character is received one bit at time
3. The stop bit is received
When receiving the stop bit 8051 makes RI = 1, indicating that an entire
character byte has been received and must be picked up before it gets
overwritten by an incoming character
Importance of RI Flag
4. By checking the RI flag bit when it is raised, we know that a
character has been received and is sitting in the SBUF register
We copy the SBUF contents to a safe place in some other register
or memory before it is lost
5. After the SBUF contents are copied into a safe place, the RI flag bit
must be forced to 0 by CLR RI in order to allow the next received
character byte to be placed in SBUF
Failure to do this causes loss of the received character
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 333
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Importance of RI Flag
By checking the RI flag bit, we know whether or not the 8051 received a character byte
If we failed to copy SBUF into a safe place, we risk the loss of the received byte
It must be noted that RI flag bit is raised by 8051 when it finish receive data
It must be cleared by the programmer with instruction CLR RI
If we copy SBUF into a safe place before the RI flag bit is raised, we risk copying
garbage
Thank You
Dipl.-Ing. B. Kommey
bkommey.coe@knust.edu.gh
nii_kommey@msn.com
050 770 32 86
Whatsup: 0507703286
Skype_id: calculus.affairs
Overview
Buses
Overview
Bus Types
Synchronous/
Processor-
I/O Bus Backplane Bus Asynchronous
Memory Bus
Bus
Overview
Standard
Buses
What is a Bus?
A Bus is a shared communication link
It is a single set of wires used to connect multiple subsystems
A Bus is also a fundamental tool for composing large, complex systems
Processor
Input
Control
Memory
Datapath
Output
Bus
Advantages of Buses
Versatility:
New devices can be added easily
Peripherals can be moved between computer
systems that use the same bus standard
Low Cost:
A single set of wires is shared in multiple ways
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 347
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Disadvantage of Buses
It creates a communication bottleneck
The bandwidth of that bus can limit the maximum I/O
throughput
The maximum bus speed is largely limited by:
The length of the bus
The number of devices on the bus
The need to support a range of devices with:
Widely varying latencies
Widely varying data transfer rates
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 348
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Control lines:
Signal requests and acknowledgments
Indicate what type of information is on the data lines
Data lines carry information between the source and the
destination:
Data and Addresses
Complex commands
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 349
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Types of Busses
Types of Busses
Types of Busses
PCI Bus
I/O Busses
I/O Devices
I/O buses tap into the processor-memory bus via bus adaptors:
Processor-memory bus: mainly for processor-memory traffic
I/O buses: provide expansion slots for I/O devices
Apple Macintosh-II
NuBus: Processor, memory, and a few selected I/O devices
SCCI Bus: the rest of the I/O devices
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 356
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Bus
Adaptor
Bus
Adaptor I/O Bus
Backplane Bus
Bus I/O Bus
Adaptor
“backside
cache”
Backplane Bus Bus
Adaptor
Separate sets of pins for different functions
I/O Bus
Caches
Graphics bus (for fast frame buffer)
I/O busses are connected to the backplane bus
Advantage:
Busses can run at different speeds
Much less overall loading!
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 358
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Bunch of Wires
Electrical Specification
Synchronous Bus
Includes a clock in the control lines
A fixed protocol for communication that is relative to the clock
Advantage:
involves very little logic and can run very fast
Disadvantages:
Every device on the bus must run at the same clock rate
To avoid clock skew, they cannot be long if they are fast
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 360
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Asynchronous Bus
It is not clocked
It can accommodate a wide range of devices
It can be lengthened without worrying about clock skew
Busses so far
Master Slave °°°
Control Lines
Address Lines
Data Lines
Bus Master: has ability to control the bus, initiates transaction
Bus Slave: module activated by the transaction
Bus Communication Protocol: specification of sequence of events and timing
requirements in transferring information.
Asynchronous Bus Transfers: control lines (req, ack) serve to orchestrate sequencing.
Synchronous Bus Transfers: sequence relative to common clock.
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 362
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Bus Transaction
wired-OR
Advantage: simple
Disadvantages:
Cannot assure fairness:
A low-priority device may be locked out indefinitely
The use of the daisy chain grant signal also limits the bus speed
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 366
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Grant Req
Bus
Arbiter
BG
R/W Cmd+Addr
Address
BG
R/W Cmd+Addr
Address
Wait
Block transfers:
Allow the bus to transfer multiple words in back-to-back bus cycles
Only one address needs to be sent at the beginning
The bus is not released until the last word is transferred
Cost: (a) increased complexity
(b) decreased response time for request
Serial Communications
Standards
Cabling
Configuration
Protocol
Standards
The terms RS-232, RS-422, and RS-485 all refer to physical
standards for serial communication developed by the
Electronic Industries Association (EIA).
The standards specify the electrical interface between
equipment.
RS-232
By far the most popular of the serial protocols
DB-9 has become more popular over last several years due to compact size.
It is a limited but normally adequate implementation
Crossover
DTE should connect to DCE with straight through cable
DTE can connect to DTE and DCE can connect to DCE using a
crossover cable
Handshaking
Handshaking is the process of ensuring that data not be
transmitted when the receiver is not ready and to ensure error
free transmission.
Minimal Implementations
Although the RS-232 standard uses up to 25 wires, as few as 2 may be
used for 1 way communications, or as few as 3 for 2 way
communications.
Configuration
Once the hardware is correctly connected, the data
configuration must be determined and adhered to by both
devices
Data rate (Baud)
Number of data bits (7 or 8)
Number of stop bits
Parity or no parity
Handshaking
Configuration
Protocols
Each device to be controlled will have a protocol, which are the
“rules”
Data Formats
IEEE488
GPIB (IEEE-488) parallel
General Purpose Interface (or Instrument) Bus
originally HPIB; Hewlett Packard
IEEE488
An 8-bit parallel bus allowing up to 15 devices connected to the same
computer port
addressing of each machine (either via menu or dip-switches) determines
who’s who
can daisy-chain connectors, each cable 2 m or less in length
Extensive handshaking controls the bus
computer controls who can talk and who can listen
Many test-and-measurement devices equipped with GPIB
common means of controlling an experiment:
positioning detectors, measuring or setting voltages/currents, etc.
Can be reasonably fast (1 Mbit/sec)
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 389
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Thank You
Dipl.-Ing. B. Kommey
bkommey.coe@knust.edu.gh
nii_kommey@msn.com
050 770 32 86
Whatsup: 0507703286
Skype_id: calculus.affairs
Overview
Interrupt Interrupt
Definitions Service Execution
Routine ISR Steps
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 392
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Overview
8051
Software Enable/Disable Interrupt
Interrupt
Interrupt Interrupts Priorities
Types
External
Reset Timer Serial
Hardware
Interrupt Interrupt Interrupt
Interrupt
Polling
The microcontroller continuously monitors the status
of a given device
Polling
Interrupts
Whenever any device needs its service, the device notifies the
microcontroller by sending it an interrupt signal
Upon receiving an interrupt signal, the microcontroller
interrupts whatever it is doing and serves the device
5. Upon executing the RETI instruction, the microcontroller returns to the place
where it was interrupted
First, it gets the program counter (PC) address from the stack by popping the top
two bytes of the stack into the PC
Then it starts to execute from that address
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 403
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
2. The value of EA
if EA = 1, interrupts are enabled and will be responded to if
their corresponding bits in IE are high
If EA = 0, no interrupt will be responded to, even if the
associated bit in the IE register is high
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 408
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Timer Interrupts
The timer flag (TF) is raised when the timer rolls over
In polling TF, we have to wait until the TF is raised
The problem with this method is that the
microcontroller is tied down while waiting for TF to be
raised, and cannot do anything else
Using interrupts solves this problem and, avoids tying
down the controller
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 411
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Timer Interrupts
If the timer interrupt in the IE register is enabled, whenever
the timer rolls over, TF is raised, and the microcontroller is
interrupted in whatever it is doing, and jumps to the interrupt
vector table to service the ISR
In this way, the microcontroller can do other until it is notified
that the timer has rolled over
Thus the pin must be held in a low state until the start of the
ISR execution
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 417
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Edge-Triggered Interrupt
To make INT0 and INT1 edge-triggered interrupts,
we must program the bits of the TCON register
The TCON register holds, among other bits, the IT0 and IT1 flag bits
that determine level- or edge-triggered mode of the hardware
interrupt
Edge-Triggered Interrupt
Edge-Triggered Interrupt
It indicates that the interrupt is being serviced now and on this INTn
pin, and no new interrupt will be responded to until this service is
finished
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 421
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Interrupt Priority
When the 8051 is powered up, the priorities are assigned according to
the following
In reality, the priority scheme is nothing but an internal polling
sequence in which the 8051 polls the interrupts in the sequence listed
and responds accordingly
Interrupt Priority
We can alter the sequence of interrupt priority by assigning a higher
priority to any one of the interrupts by programming a register called
IP (interrupt priority)
When two or more interrupt bits in the IP register are set to high
While these interrupts have a higher priority than others, they are
serviced according to the sequence of interrupts table
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 431
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Interrupt Priority
Solution:
Interrupt Priority Example
(a) MOV IP,#00000100B ;IP.2=1 assign INT1 higher priority.
The instruction SETB IP.2 also will do the same thing as the above line since IP is bit-
addressable.
(b) The instruction in Step (a) assigned a higher priority to INT1 than the others; therefore,
when INT0, INT1, and TF0 interrupts are activated at the same time, the 8051 services INT1
first, then it services INT0, then TF0.
This is due to the fact that INT1 has a higher priority than the other two because of the
instruction in Step (a). The instruction in Step (a) makes both the INT0 and TF0 bits in the IP
register 0.
As a result, the sequence in the interrupt table is followed which gives a higher priority to INT0
over TF0
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 434
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
eg. If the IE bit for timer 1 is set, an instruction such as SETB TF1 will
interrupt the 8051 in whatever it is doing and will force it to jump to
the interrupt vector table
Thank You
Dipl.-Ing. B. Kommey
bkommey.coe@knust.edu.gh
nii_kommey@msn.com
050 770 32 86
Whatsup: 0507703286
Skype_id: calculus.affairs
Overview
Overview
Direct
Double DMA
Memory
Buffering Configurations
Access DMA
Masking Interrupts
If interrupts are masked (IRQ and FIQ disabled), nothing will be
processed until the ISR completes and returns.
Remember: entering IRQ mode masks IRQs and entering FIQ mode masks FIQs
and IRQs
keyboard_ISR() {
MASK_INTERRUPTS();
input_buffer[tail++ % BUF_SIZE] = ch;
UNMASK_INTERRUPTS();
...
}
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 446
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
keyboard_ISR(){
Buffer Processing
MASK_INTERRUPTS();
ch < Read ACIA input register
input_buffer[tail++ % BUF_SIZE] = ch;
UNMASK_INTERRUPTS();
}
while (!quit){
if (tail != head){
process_command(input_buffer);
remove_command(input_buffer);
}
What happens if another command is }
entered as you remove one from the
input_buffer?
Must be careful when modifying the buffer with interrupts turned on.
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 447
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Buffer Processing
printStr(char *string) { printStr(“this is a line”);
while (*string) {
outputBuffer[tail++ % BUF_SIZE] = *string++;
}
}
T H I S I S
How about the print buffer?
tail points here and a timer interrupt occurs
Jump to timer_ISR
timer_ISR(){
clockTicks++;
printStr(convert(clockTicks));
}
T H I S I S 2 : 3 0
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 448
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Programmed I/O
All of our examples so far have used programmed I/O
Programmed I/O: a program running on the processor moves data to/from the
device using instructions.
Either interrupts or polling are used to discover when devices are ready.
Memory
Processor buffer
On-chip
cache program
device
Bus
Processor grabs data from device and copies to buffer “by hand”
(manually)
Hardware using DMA: disk drives, graphics cards, network cards, sound cards
DMA can lead to cache coherency problems
If a CPU has a cache and external memory, then the data the DMA controller has
access to (stored in RAM) may not be updated with the correct data stored in the
cache.
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 457
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Non-coherent systems:
OS ensures that the cache lines are flushed before an outgoing
DMA transfer is started and invalidated before a memory range
affected by an incoming DMA transfer is accessed.
The OS makes sure that the memory range is not accessed by any
running threads in the meantime.
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 459
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
DMA Transfer
(input example)
software: asks for data (e.g. read called)
1. Device driver allocates a DMA buffer, sends signal to device
indicating where to send the data, sleeps
2. Device writes data to DMA buffer, raises interrupt when finished
3. Interrupt handler gets data from DMA buffer, acknowledges
interrupt, awakens software to process the data
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 460
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
DMA Transfer
hardware: asynchronously pushes data to the system
May push data even if no process is listening!
1. hardware raises an interrupt to announce that new data has arrived
2. interrupt handler allocates a buffer, tells the hardware where to
transfer the data
DMA Transfer
Overview (input example – network transfers)
• hardware: must deal with continuous data flow
Use a circular (ring) buffer in memory shared by device and the processor
1. incoming packet placed in next available buffer in the ring
2. interrupt is raised by the device
3. device driver sends packet to kernel code that will process it
4. device driver inserts a new buffer into the ring
(note: buffer allocation occurs at initialization so the insertion of a buffer is
just the selection of an already allocated buffer for the ring)
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 462
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
DMA Transfer
Overview (input example – network transfers)
• pseudo code for read using circular buffer
Err_Type Procedure read(data_type data) {
if (empty_flag) return (ERR_BUF_EMPTY);
else { memory(read_ptr) = data;
full_flag = false;
read_ptr = (((read_ptrB)+1)mod N)+B;
if (read_ptr == write_ptr) empty_flag = true;
return(ErrOK);
}
}
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 463
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
DMA Transfer
DMA
Cycle stealing causes the CPU to execute more slowly
Number of required busy cycles can be cut by integrating the DMA and I/O
functions
Path between DMA module and I/O module that does not include the system bus
DMA Configurations
DMA Configurations
I/O Buffering
I/O Buffering
Block-oriented
Information is stored in fixed sized blocks
Transfers are made a block at a time
Used for disks and tapes
Stream-oriented
Transfer information as a stream of bytes
Used for terminals, printers, communication ports, mouse, and
most other devices that are not secondary storage
Single Buffer
Single Buffer
Block-oriented
User process can process one block of data while next block is read in
Swapping can occur since input is taking place in system memory, not user
memory
Operating system keeps track of assignment of system buffers to user
processes
Stream-oriented
Used a line at time
User input from a terminal is one line at a time with carriage return signaling the end of
the line
Output to the terminal is one line at a time
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 473
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Double Buffer
Use two system buffers instead of one
Circular Buffer
More than two buffers are used
head
… …
… …
… …
tail The buffer is
… … empty when:
… … tail = head
… …
… …
… …
[14] [15]
[13] [0] head
[12] [1]
The buffer is
[11] [2]
tail full when:
[10] [3] head = tail – 1
[9] [4]
[8] [5]
[7] [6]
Thank You
Dipl.-Ing. B. Kommey
bkommey.coe@knust.edu.gh
nii_kommey@msn.com
050 770 32 86
Whatsup: 0507703286
Skype_id: calculus.affairs
Overview
Embedded System OS
Windows Embedded
VxWorks Android
Embedded Linux
Server
Windows (XP/2000 Server &Advanced Server)
Unix Varieties
Embedded
Many
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 483
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Palm PDA
Palm OS
Symbian
Symbian OS
VxWorks
VxWorks is a commercial hard real time operating
system developed by wind river systems.
VxWorks
A dedicated real time system, not intended as
a general purpose OS.
lacks many modern OS features that interfere
with real time performance (flat memory
model, no paging).
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 494
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
VxWorks
Scheduling is done using a preemptive priority driven
approach, priorities are chosen arbitrarily by the user (0-255).
Priorities can be changed by the user at runtime but this is
discouraged.
A user can lock a task so that it can’t be preempted even by
higher priority tasks or interrupts.
This allows the use of the fixed priority response time analysis
to check schedule-ability offline.
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 495
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
VxWorks
Is resource sharing aware and has a priority inheritance
built in.
Optimizations in implementation of the context switch
and the return from interrupts.
The kernel never disables NMI (non-maskable interrupts)
so they are always available to the user.
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 496
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
VxWorks - Limitations
Lacks many modern OS features.
Despite the flat memory model dynamic memory allocation still cases
memory fragmenting, which increases timing unpredictability.
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 497
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
VxWorks - Limitations
GDB —Debugger
Embedded Linux
Both on strong
uptake curve!
Thank You
Dipl.-Ing. B. Kommey
bkommey.coe@knust.edu.gh
nii_kommey@msn.com
050 770 32 86
Whatsup: 0507703286
Skype_id: calculus.affairs
Overview
Overview
Cryptography
Data
Hashing Rivest Shamir
Encryption Authentication
MD5 Adleman RSA
Standard DES
Security
Threats Mechanisms
Authorization
Interruption
Authentication
Interception
Security
Objects
passive entities whose security attributes must be protected
Subjects
active entities that access objects
Threats
potential dangers which harm security
Security Policy
a precise specification to describe appropriate levels of security
Security Mechanism: an implementation of a given security policy
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 511
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Types of Threats
Interception
an unauthorized subject has gained access to an object, such as stealing
data, overhearing others communication, etc.
Interruption
services or data become unavailable, unusable, destroyed, and so on,
such as lost of file, denial of service, etc.
Types of Threats
Modification
unauthorized changing of data or tempering with services, such as
alteration of data, modification of messages, etc.
Fabrication
additional data or activities are generated that would normally no exist,
such as adding a password to a system, replaying previously send
messages, etc.
Methods of Attack
Eavesdropping
obtaining copies of messages without authority
Masquerading
sending/receiving messages using other’s identifier
Tempering
stealing messages and altering their contents
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 514
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Methods of Attack
Replaying
storing messages and sending them at later date
Infiltrating
accessing system in order to run programs that implement
the attack (virus, worm, Trojan horse)
Unknown yet
new attacking methods may appear later
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 515
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Indirect Infiltration
Trojan Horse
A piece of code that misuses its environment. The program seems innocent
enough, however when executed, unexpected behavior occurs.
Worms
Use spawning mechanism; standalone programs. Such facilities may exist
accidentally as well as intentionally.
Viruses
Fragment of code embedded in a legitimate program. Mainly effects personal
PC systems. These are often downloaded via e-mail or as active components in
web pages.
Security Mechanisms
Encryption
transforming data into something an attacker cannot understand, i.e.,
providing a means to implement confidentiality, as well as allowing
user to check whether data have been modified.
Authentication
verifying the claimed identity of a subject, such as user name,
password, etc.
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 517
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Security Mechanisms
Authorization
checking whether the subject has the right to perform the action
requested.
Auditing
tracing which subjects accessed what, when, and which way. In
general, auditing does not provide protection, but can be a tool
for analysis of problems.
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 518
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
reply
Cryptography
Cryptography System
DEFINITIONS: Symmetric cryptosystem:
Encryption:
Ke = Kd = K
C = E( P, Ke )
E = Encrypting Algorithm P= D(E( P, K ), K)
P = Plain text
Ke = Encryption key
C = Cipher text Asymmetric cryptosystem:
Decryption:
Ke ≠ Kd
P = D( C, Kd )
D = Decrypting Algorithm
P = D( E(P, Ke), Kd )
Kd = Decryption key
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 523
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
K=1
P = Attack at dawn
C = Buubdl!bu!ebxo
Discussion of DES
Even through the DES algorithm is well known, but the key or
cipher is difficult to break using analytical methods.
Discussion of DES
Using a brute-force attack by simply searching for a key is
possible.
However, for 56-bit key, there are 256 possible key combinations,
if we could search one key in 1 µs, then we need 2283 years to try
all keys. (Distributed.net broke a DES-56 within 22 hours and 15
minutes, by using 100,000 PCs).
Encryption Decryption
Plain P Cipher C Plain P
C = E(P, KE) P = D(C, KD)
decryption
code 00 01 02 03 … 25 26
MD5: Message-Digest
Initialization: Algorithm 5
input: 448 bits 448 bits 448 bits …
MD5 is a hash function for computing a 128-bit, fixed-length message digest from an
arbitrary length binary input.
Initialization: dividing input into 448-bit blocks and then padding these blocks into 512-
bit blocks.
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 533
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Authentication
How to make the communication between clients and servers (or senders
and receivers) secure? We need to authentication of communication
parties.
Authentication and message integrity are closely related, cannot go
without each other.
Commonly use authentication models:
(1) based on a shared secret key
(2) based on a key from KDC (Key Distribution Center)
(3) based on public key
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 535
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Authentication based on a shared secret key, but using three instead of five
messages. Any problem?
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 537
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Using a ticket KB, KDC(KA, B) and letting Alice set up a connection to Bob.
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 540
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Digital Signatures
A digit signature has the same authentication and legally binding functions
as a handwritten signature.
An electronic document or message M can be signed by an entity A by
encrypting a copy of M in a key KA and attaching it to a plain-text copy of
M and A’s identifier, such as <M, A, E(M, KA)>.
Once a signature is attached to a electronic document, it should be possible
(1) any party that receives a copy of message to verify that the document
was originally signed by the signatory, and (2) the signature can not be
altered either in transmit or the receivers.
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 543
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
2
KS(A,M,T)
K
D
A 3 C B
A,M,KS(A,M,T)
4
B,KS(A,M,T)
5
KB,KDC (A,M,T)
Access Control
Subject Ref Monitor Object
Request Authorization
A request from a client can be carried out only if the client has sufficient access
rights for that requested operation.
Verifying access rights is called access control, whereas authorization is about
granting access rights.
Many access control models:
Access Control Matrix
Access Control List (Capability List)
Firewalls
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 547
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Firewalls
A Firewall is a special kind reference monitor to control external access to any
part of a distributed system.
A Firewall disconnects any part of a distributed system from outside world, all
outgoing and incoming packets must be routed through the firewall.
A firewall itself should be heavily protected against any kind of security threads.
Models of firewall:
Packet-filtering gateway
Proxy:
Application-level Proxy
Circuit-level Proxy
4/15/2017 Ing. B. Kommey, bkommey.coe@knust.edu.gh, 0507703286 551
EMBEDDED SYSTEMS
DEPARTMENT OF COMPUTER ENGINEERING
Bastian
internal network
… protected hosts …
Filtering gateway
bastian
internal network
Thank You
Dipl.-Ing. B. Kommey
bkommey.coe@knust.edu.gh
nii_kommey@msn.com
050 770 32 86
Whatsup: 0507703286
Skype_id: calculus.affairs