rps group of instutions
DESCRIPTION
RPS GROUP OF INSTUTIONS. SATNALI ROAD, BALANA(MOHINDERGARH) -123029. SUMMER TRAINING REPORT ON ‘ EMBEDDED SYSTEM ’ BY SOFCON. Submitted to : Submitted by : - PowerPoint PPT PresentationTRANSCRIPT
RPS GROUP OF INSTUTIONS
SUMMER TRAINING REPORTON
‘ EMBEDDED SYSTEM’BY
SOFCON
Submitted to : Submitted by :Mr. KARAMBIR SHEORAN SANDEEPAsstt. Professor & Head 1130112367ECE Deptt. Department of Electronics & Communication Engineering
Embedded Systems
Embedded system means the processor is embedded into that application
An embedded product uses a microprocessor or microcontroller to do task
In an embedded system, there is only one application software that is typically burned into ROM
Example printer, keyboard, video game player
MicrocontrolerFeatures of 8051
ROM - 4K bytesRAM - 128 bytesTimer - 2I/O pins - 32Serial port - 1Interrupt sources - 6
8051 is based on CISC architecture.It is based on Harvard architecture.
So, it has separate program and data memory.
Block Diagram of 8051
CPU
On-chip RAM
On-chip ROM for program code
4 I/O Ports
Timer 0
Serial PortOSC
Interrupt Control
External interrupts
Timer 1
Timer/Counter
Bus Control
TxD RxDP0 P1 P2 P3
Address/Data
Counter Inputs
8051: Pin Diagram
What is a microprocessor? The microprocessor is the integration of a number of useful functions. These functions are:
The ability to execute a stored set of instructions to carry out user defined tasks.
General-purpose microprocessor.
Act as CPU for Computers.
No RAM, ROM, I/O on CPU chip itself
Example Intel’s 8086 ,8085.
Microprocessor v/s Micro-controllers
MicroprocessorsHigh end of market where performance mattersHigh power dissipation–high costNeed peripheral devices to work Mostly used in microcomputersMicrocontrollersTargeted for low end of market where performance doesn’t matterLow power dissipation – low cost Memory plus I/O devices, all integrated into one chipMostly used in embedded systems
USE OF CIntroduction to C programming
Powerful features, simple syntax, and portability make C a preferred language among programmers for business and industrial applications. Portability means that C programs written for a computer with a particular kind of processor, say Intel, can be executed on computers with different processors such as Motorola, Sun Sparc, or IBM with little or no modification
Origin of C Dennis M. Ritchie, a systems engineer at Bell Laboratories, New Jersey developed C in the early 1970’s.
Where is C useful? The following is a partial list of areas where C language is used: Ø Embedded Systems Ø Systems ProgrammingØ Artificial IntelligenceØ Industrial AutomationØ Computer GraphicsØ Space ResearchØ Image ProcessingØ Game Programming
LED [LIGHT EMITTING DIOIDE]
Type optoelectronic
Working principle Electroluminescence
Invented Nick Holonyak Jr. (1962)
Electronic symbol
Pin configuration Anode and Cathode
A light-emitting diode (LED) is a semiconductor light source. LEDs are used as indicator lamps in many devices
STRUCTURE OF LED Like a normal diode, the LED consists of a chip of semiconducting material doped with impurities to create a p-n junction. As in other diodes, current flows easily from the p-side, or anode, to the n-side, or cathode.
Color Wavelength (nm) Voltage (V) Semiconductor Material
Infrared λ > 760 ΔV < 1.9Gallium arsenide (GaAs)Aluminium gallium arsenide (AlGaAs)
Red 610 < λ < 760 1.63 < ΔV < 2.03
Aluminium gallium arsenide (AlGaAs)Gallium arsenide phosphide (GaAsP)Aluminium gallium indium phosphide (AlGaInP)Gallium(III) phosphide (GaP)
Orange 590 < λ < 610 2.03 < ΔV < 2.10Gallium arsenide phosphide (GaAsP)Aluminium gallium indium phosphide (AlGaInP)Gallium(III) phosphide (GaP)
Yellow 570 < λ < 590 2.10 < ΔV < 2.18Gallium arsenide phosphide (GaAsP)Aluminium gallium indium phosphide (AlGaInP)Gallium(III) phosphide (GaP)
Green 500 < λ < 570 1.9[42] < ΔV < 4.0
Indium gallium nitride (InGaN) / Gallium(III) nitride (GaN)Gallium(III) phosphide (GaP)Aluminium gallium indium phosphide (AlGaInP)Aluminium gallium phosphide (AlGaP)
Blue 450 < λ < 500 2.48 < ΔV < 3.7
Zinc selenide (ZnSe)Indium gallium nitride (InGaN)Silicon carbide (SiC) as substrateSilicon (Si) as substrate — (under development)
Violet 400 < λ < 450 2.76 < ΔV < 4.0 Indium gallium nitride (InGaN)
Purple multiple types 2.48 < ΔV < 3.7Dual blue/red LEDs,blue with red phosphor,or white with purple plastic
Ultraviolet λ < 400 3.1 < ΔV < 4.4
Diamond (235 nm)[43]
Boron nitride (215 nm)[44][45]
Aluminium nitride (AlN) (210 nm)[46]
Aluminium gallium nitride (AlGaN)Aluminium gallium indium nitride (AlGaInN) — (down to 210 nm)[47]
LEDs are produced in a variety of shapes and sizes. The 5 mm cylindrical package (red, fifth from the left) is the most common, estimated at 80% of world production.The color of the plastic lens is often the same as the actual color of
light emitted, but not always. For instance, purple plastic is often used for infrared LEDs, and most blue devices have clear housings. There are also LEDs in SMT packages, such as those found on blinkies and on cell phone
keypads (not shown).The main types of LEDs are miniature, high power devices and custom designs
such as alphanumeric or multi-color
Types
#include<reg51.h>#define led P1void msdelay(unsigned int);void main(){while(1){led=0xff;msdelay(44);led=0x00;msdelay(44); }} void msdelay(unsigned int t){unsigned int i,j;for(i=0;i<=1233;i++)for(j=0;j<=t;j++);}
CODING FOR LED BLINKING
XTAL218
XTAL119
ALE30
EA31
PSEN29
RST9
P0.0/AD0 39
P0.1/AD1 38
P0.2/AD2 37
P0.3/AD3 36
P0.4/AD4 35
P0.5/AD5 34
P0.6/AD6 33
P0.7/AD7 32
P1.01
P1.12
P1.23
P1.34
P1.45
P1.56
P1.67
P1.78
P3.0/RXD 10
P3.1/TXD 11
P3.2/INT0 12
P3.3/INT1 13
P3.4/T0 14
P3.7/RD 17P3.6/WR 16P3.5/T1 15
P2.7/A15 28
P2.0/A8 21
P2.1/A9 22
P2.2/A10 23
P2.3/A11 24
P2.4/A12 25
P2.5/A13 26
P2.6/A14 27
U1
AT89C51
D1LED-YELLOW
D2LED-RED
D3LED-GREEN
D4LED-BLUE
D5LED-BIRY
D6LED-BIRG
D7LED-BIGY
D8LED-BIBY
7-segment LED Display is display device which can display one digit at a time
Actually one digit is represented by arrangement of 7 LEDs in a small cubical box
For representing 3 digit number we need three 7-segment LED Displays
7-segment LED Display
look like
OUTPUT h g f e d c b a HEX CODE0 1 1 0 0 0 0 0 0 C01 1 1 1 1 1 0 0 1 F92 1 0 1 0 0 1 0 0 A43 1 0 1 1 0 0 0 0 B04 1 0 0 1 1 0 0 1 995 1 0 0 1 0 0 1 0 926 1 0 0 0 0 0 1 0 827 1 1 1 1 1 0 0 0 F88 1 0 0 0 0 0 0 0 809 1 0 0 1 0 0 0 0 90
Truth Table: 7 Segment Display
#include<reg51.h>#define seg P1sbit inc=P2^0;sbit dec=P2^1;void main(){unsigned int k=0,i;while(1){if(inc==0){k=k+1; for(i=0;i<=35000;i++);}if(dec==0){k=k-1;for(i=0;i<=35000;i++);}switch(k){case 0:seg=0x3f;break;
case 1:seg=0x06;break;case 2:seg=0x5b;break;case 3:seg=0x4f;break;case 4:seg=0x66;break;case 5:seg=0x6d;break;case 6:seg=0x7d;break;case 7:seg=0x07;break;case 8:seg=0x7f;break;case 9:seg=0x67;break;}}}
CODING FOR 7 SEG LED
XTAL218
XTAL119
ALE30
EA31
PSEN29
RST9
P0.0/AD0 39
P0.1/AD1 38
P0.2/AD2 37
P0.3/AD3 36
P0.4/AD4 35
P0.5/AD5 34
P0.6/AD6 33
P0.7/AD7 32
P1.01
P1.12
P1.23
P1.34
P1.45
P1.56
P1.67
P1.78
P3.0/RXD 10
P3.1/TXD 11
P3.2/INT0 12
P3.3/INT1 13
P3.4/T0 14
P3.7/RD 17P3.6/WR 16P3.5/T1 15
P2.7/A15 28
P2.0/A8 21
P2.1/A9 22
P2.2/A10 23
P2.3/A11 24
P2.4/A12 25
P2.5/A13 26
P2.6/A14 27
U1
AT89C51
7 SEG LED CKT DIAGRAM
PROTEUS DESIGN
Pin no. Description 1 Ground2 +5 Volts3 LCD contrast4 Instruction/Data
input
5 Write/read signal6 Enable signal7 to 14 D0 to D7 data bus
lines
About LCD
RS – register select If RS=0, used to send commands such as clear display, cursor position etc. If RS=1, used to send data to the LCD.
R/W – read / write If R/W = 1, read from LCD If R/W = 0, write to LCD
E – enable A 450 nano seconds high-to-low pulse is applied in order to send data.
For 16x2 LCD the address of the cursor positions are:
All these addresses are in hexadecimal.
80 81 82 83 84 85 86 to 8FC0 C1 C2 C3 C4 C5 C6 to CF
DESCRIPTION
LCD Address
HEX CODE COMMAND HEX
CODE COMMAND
0x01 CLEAR LCD 0x02 RETURN HOME
0x04 SHIFT CURSOR LEFT 0x06 SHIFT CURSOR RIGHT
0x05 SHIFT DISPLAY RIGHT 0x07 SHIFT DISPLAY LEFT
0x08 DISPLAY OFF, CURSOR OFF 0x0A DISPLAY OFF, CURSOR ON
0x0C DISPLAY ON, CURSOR OFF 0x0E DISPLAY ON, CURSOR BLINKING
0x10 SHIFT CURSOR TO LEFT 0x14 SHIFT CURSOR TO RIGHT
0x18 SHIFT DISPLAY TO LEFT 0x1C SHIFT DISPLAY TO RIGHT
0x80 FORCE CURSOR TO BEGINNING OF FIRST LINE 0xC0 FORCE CURSOR TO BEGINNING
OF 2ND LINE
0x38 2 LINES & 5X7 MATRIX
LCD Command Codes
Addressing Modes
The CPU can access data in various ways. The data could be in a register or in memory or be provided as an immediate value. These various ways of accessing data are called addressing modes.
Total 5 addressing modes:
1) Immediate2) Register3) Direct4) Register indirect5) Indexed
Immediate addressing mode
Ex: MVI A,25H ;load 25h into AImmediate data must be preceded by the pound sign “#”.
Although DPTR is 16 bit, it can be accessed as two 8-bit registers, DPH and DPL.
Ex: MOV DPTR, #2550h is same as, MOV DPL, #50h MOV DPH,#25h
Register Addressing ModesEx: MOV A, R0 ;copy contents of R0 into A
Direct addressing ModeEx: MOV R0,40h ;save the contents of RAM location 40h in R0
MOV 56h,A ;save the contents of A in RAM location 56h
The ‘#’ symbol distinguishes between the direct addressing and immediate addressing mode.
Register Indirect addressing Mode
Here register is used as a pointer to the data.
If the data is inside CPU, only registers R0 and R1 are used
for this purpose.
When R0 and R1 are used as pointers, i.e., when they
hold the address of RAM, they must be preceded by “@”
sign.
Ex:
MOV A,M ;
MOV @R1,B ;move contents of B into RAM location whose
address is held by R1.