Introduction To Embedded System
AR LABS(A TRAINING UNIT OF METACORTEX
TECHNOLOGIES)
EMBEDDED SYSTEMS ??
LITERAL MEANING
EMBEDDED SYSTEM
BASIC DEFINTION
EMBEDDED SYSTEM: Combination of computer hardware & software, that is specifically designed for a particular kind of application device.
APPLICATIONS ARE NUMEROUS
APPLICATIONS OF EMBEDDED SYSTEM
Automotive electronics
Aircraft
Trains
Telecommunication
Specialties Of Embedded Systems
Performance
HIGH
Power Consumption
LOW
Cost
CHEAP
Size
SMALL
Software Up gradation capability
HIGH
BLOCK DIAGRAM OF EMBEDDED SYSTEM
Brain is the main part of the EMBEDDED SYSTEM or main centre of information processing.
For an embedded system designer knowledge of controlling unit or processor is a must.
The brain is often a microprocessor or microcontrollers.
CONTROLLING UNIT/BRAIN
BRAIN
Microprocessors Microcontrollers
32 bit 8 bit
DSPs, PC
16 bit 32 bit64 bit
CISC RISC
BRAIN
CPUGeneral-Purpose Micro-
processorRAM ROM I/O
PortTimer
Serial COM Port
Data Bus
Address Bus
General-Purpose Microprocessor System
CPU for ComputersNo RAM, ROM, I/O on CPU chip itself
Many chips on mother board
MICROPROCESSORS
Where to find microprocessors
What is a Microcontroller????????
Where To Find Microcontrollers?
• Microcontroller are found everywhere!• uC’s are considered embedded systems
Microprocessor
CPU is stand-alone, RAM, ROM, I/O,
timer are separate
designer can decide on the amount of ROM, RAM and I/O ports.
expensive
general-purpose
Microcontroller
CPU, RAM, ROM, I/O and timer are all on a
single chip
fix amount of on-chip ROM, RAM, I/O ports
for applications in which cost, power and space
are critical
single-purpose
v/s
COMMONLY USED CONTROLLERS..
8051 CONTROLLER BY INTEL / AT89C51
<< ADVANCED VIRTUAL RISC –AVR
PERIPHERAL INTERFACE CONTROLLER (PIC)
ADVANCE RISC MACHINE (ARM)
MICROCONTROLLER MANUFACTURERSo ATMEL
o MICROCHIP
o TEXAS INSTRUMENTS
o INTEL
o FREESCALE
PIC 16F877A
Owned & Developed By Microchip
Pic16f877a
8 bit uc
Analog features• 10 bit ADC• Brownout
reset
Memory feature• 368 bytes
of RAM • 256 bytes
of EEPROM• 8K FLASH
PROGRAM MEMORY
Peripheral• USART• 8 & 16 bit
Timer Counter
Special UC• IN Circuit
Serial Programming
368 x 8 bytes
(Data Memory)
256 x 8 bytes EEPROM
20 Mhz Clock Input
8K x 14 words
40/44-pin
3 TIMERS
T0,T2(8bit)
T1(16 bit)
PIC16F877A
RB7
RB6
RB5
RB3
RB4
RB1
RB2
Vdd
RB0
Vss
RD5
RD6
RD7
RD4
RC7
RC6
RC4
RC5
RD3
RD2
Vss
CLK1
CLK0
RD1
RD0
RC2
RC3
RC0
RC1
Vdd
RE2
RA2
RE1
RA3
RA4
RA5
RE0
RA0
Vpp
RA1
1
4
2
5
3
6
7
8
16
15
14
13
1211
10
9
18
17
20
19
21
23
22
27
29
28
26
25
24
35
34
33
32
31
30
40
39
38
37
36
PORT BRB0 - RB7
PORT CRC4-RC7
Higher Nibble
PORT CRC0-RC4
Lower Nibble
PORT DRD0 - RD3
Lower Nibble
PORT DRD7 – RD4
Higher Nibble
PORT ARA0-RA5
PORT ERE0 – RE1
SHOWING FIVE PORTS in uc
Oscillator
Programming
Write the program in PIC C.
Now burn the hex file using pic downloader.
Give Connections of Led’s on one port.
Steps to perform
Points To Remember
We have 5 bidirectional PORTS in our controller.
Any peripheral will be connected to these ports only.
The value on these ports decides the functionality of peripheral
Points To Remember
There are some predefined functions under the header file <pic16f877a.h> which we use
1.output_low(pin_x): Used to make particular pin low(0)
2.output_high(pin_x):Used to make particular pin high(1)
3.Output_port(value): using this function ,value is loaded on the port.
For e.g. we want to send a value like 15 on port B
In binary It means 00001111
We will writeOutput_port(15)
1=ON
0=Off
Red = on =1Blue =Off=0
another e.g. we want to send value
now 116 on port D
In binary It means 01110100
We will writeOutput_port(116)
Red = on =1Blue =Off=0
# include Header files#Use clock
Void main() {WHILE(1)
{
Output_port(y)
} while loop END
Main loop end
Body of Program
1. Include Header FILE2. Specify Clock
3. Void main() {4. Infinite LOOP {
Output_port( x)} }
To Blink a Single LED
#include<16f877a.h> //Header file to specify device#use delay(clock=20000000) //Definition of frequencyvoid main(){int x = 0; // Variable initializationwhile(1){output_high(pin_a0); //sets the pin a0delay_ms(400); // delay of 400msoutput_low(pin_a0); //clears the specified pin. a0 in this casedelay_ms(400); }
How Program Actually Works
#include<16f877a.h> #use delay(clock=20000000) void main(){int x = 0; while(1){output_high(pin_a0); delay_ms(400); output_low(pin_a0); delay_ms(400); }
After coming to while(1), it
stuck in infinite loop
How Program Actually Works
#include<16f877a.h> #use delay(clock=20000000) void main(){int x = 0; while(1){output_high(pin_a0); delay_ms(400); output_low(pin_a0); delay_ms(400); }
How Program Actually Works
#include<16f877a.h> #use delay(clock=20000000) void main(){int x = 0; while(1){output_high(pin_a0); delay_ms(400); output_low(pin_a0); delay_ms(400); }
Used to make pin a0 high
i.e., to glow led
How Program Actually Works
#include<16f877a.h> #use delay(clock=20000000) void main(){int x = 0; while(1){output_high(pin_a0); delay_ms(400); output_low(pin_a0); delay_ms(400); }
Used to generate delay of 400ms.
How Program Actually Works
#include<16f877a.h> #use delay(clock=20000000) void main(){int x = 0; while(1){output_high(pin_a0); delay_ms(400); output_low(pin_a0); delay_ms(400); }
Used to make pin a0 low
i.e., to off led
How Program Actually Works
#include<16f877a.h> #use delay(clock=20000000) void main(){int x = 0; while(1){output_high(pin_a0); delay_ms(400); output_low(pin_a0); delay_ms(400); }
How Program Actually Works
#include<16f877a.h> #use delay(clock=20000000) void main(){int x = 0; while(1){output_high(pin_a0); delay_ms(400); output_low(pin_a0); delay_ms(400); }
How Program Actually Works
#include<16f877a.h> #use delay(clock=20000000) void main(){int x = 0; while(1){output_high(pin_a0); delay_ms(400); output_low(pin_a0); delay_ms(400); }
& so on..
TO Blink ALL LED
#include<16f877a.h> // Header file to add the device#use delay(clock=20000000) // defination of frequencyvoid main(){int x = 0; // port data variable initialization while (1){output_b(x); // data sent to port bdelay_ms(400); // delay of 400msx= x^255; // XOR with 225 to complement the
} // data}