26
RPS GROUP OF INSTUTIONS SUMMER TRAINING REPORT ON ‘ EMBEDDED SYSTEM’ BY SOFCON Submitted to : Submitted by : Mr. KARAMBIR SHEORAN SANDEEP Asstt. Professor & Head 1130112367 ECE Deptt. Department of Electronics & Communication Engineering

SUMMER TRAINING REPORT ON ‘ EMBEDDED SYSTEM ’ BY SOFCON Submitted to : Submitted by : Mr. KARAMBIR SHEORAN SANDEEP Asstt. Professor & Head 1130112367 ECE

Embed Size (px)

Citation preview

Page 1: SUMMER TRAINING REPORT ON ‘ EMBEDDED SYSTEM ’ BY SOFCON Submitted to : Submitted by : Mr. KARAMBIR SHEORAN SANDEEP Asstt. Professor & Head 1130112367 ECE

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

Page 2: SUMMER TRAINING REPORT ON ‘ EMBEDDED SYSTEM ’ BY SOFCON Submitted to : Submitted by : Mr. KARAMBIR SHEORAN SANDEEP Asstt. Professor & Head 1130112367 ECE

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

Page 3: SUMMER TRAINING REPORT ON ‘ EMBEDDED SYSTEM ’ BY SOFCON Submitted to : Submitted by : Mr. KARAMBIR SHEORAN SANDEEP Asstt. Professor & Head 1130112367 ECE

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.

Page 4: SUMMER TRAINING REPORT ON ‘ EMBEDDED SYSTEM ’ BY SOFCON Submitted to : Submitted by : Mr. KARAMBIR SHEORAN SANDEEP Asstt. Professor & Head 1130112367 ECE

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

Page 5: SUMMER TRAINING REPORT ON ‘ EMBEDDED SYSTEM ’ BY SOFCON Submitted to : Submitted by : Mr. KARAMBIR SHEORAN SANDEEP Asstt. Professor & Head 1130112367 ECE

8051: Pin Diagram

Page 6: SUMMER TRAINING REPORT ON ‘ EMBEDDED SYSTEM ’ BY SOFCON Submitted to : Submitted by : Mr. KARAMBIR SHEORAN SANDEEP Asstt. Professor & Head 1130112367 ECE

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.

Page 7: SUMMER TRAINING REPORT ON ‘ EMBEDDED SYSTEM ’ BY SOFCON Submitted to : Submitted by : Mr. KARAMBIR SHEORAN SANDEEP Asstt. Professor & Head 1130112367 ECE

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

Page 8: SUMMER TRAINING REPORT ON ‘ EMBEDDED SYSTEM ’ BY SOFCON Submitted to : Submitted by : Mr. KARAMBIR SHEORAN SANDEEP Asstt. Professor & Head 1130112367 ECE

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

Page 9: SUMMER TRAINING REPORT ON ‘ EMBEDDED SYSTEM ’ BY SOFCON Submitted to : Submitted by : Mr. KARAMBIR SHEORAN SANDEEP Asstt. Professor & Head 1130112367 ECE

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

Page 10: SUMMER TRAINING REPORT ON ‘ EMBEDDED SYSTEM ’ BY SOFCON Submitted to : Submitted by : Mr. KARAMBIR SHEORAN SANDEEP Asstt. Professor & Head 1130112367 ECE

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.

Page 11: SUMMER TRAINING REPORT ON ‘ EMBEDDED SYSTEM ’ BY SOFCON Submitted to : Submitted by : Mr. KARAMBIR SHEORAN SANDEEP Asstt. Professor & Head 1130112367 ECE

ColorWavelength (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)

Page 12: SUMMER TRAINING REPORT ON ‘ EMBEDDED SYSTEM ’ BY SOFCON Submitted to : Submitted by : Mr. KARAMBIR SHEORAN SANDEEP Asstt. Professor & Head 1130112367 ECE

Green 500 < λ < 5701.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]

Page 13: SUMMER TRAINING REPORT ON ‘ EMBEDDED SYSTEM ’ BY SOFCON Submitted to : Submitted by : Mr. KARAMBIR SHEORAN SANDEEP Asstt. Professor & Head 1130112367 ECE

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

Page 14: SUMMER TRAINING REPORT ON ‘ EMBEDDED SYSTEM ’ BY SOFCON Submitted to : Submitted by : Mr. KARAMBIR SHEORAN SANDEEP Asstt. Professor & Head 1130112367 ECE

#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/AD039

P0.1/AD138

P0.2/AD237

P0.3/AD336

P0.4/AD435

P0.5/AD534

P0.6/AD633

P0.7/AD732

P1.01

P1.12

P1.23

P1.34

P1.45

P1.56

P1.67

P1.78

P3.0/RXD10

P3.1/TXD11

P3.2/INT012

P3.3/INT113

P3.4/T014

P3.7/RD17

P3.6/WR16

P3.5/T115

P2.7/A1528

P2.0/A821

P2.1/A922

P2.2/A1023

P2.3/A1124

P2.4/A1225

P2.5/A1326

P2.6/A1427

U1

AT89C51

D1LED-YELLOW

D2LED-RED

D3LED-GREEN

D4LED-BLUE

D5LED-BIRY

D6LED-BIRG

D7LED-BIGY

D8LED-BIBY

Page 15: SUMMER TRAINING REPORT ON ‘ EMBEDDED SYSTEM ’ BY SOFCON Submitted to : Submitted by : Mr. KARAMBIR SHEORAN SANDEEP Asstt. Professor & Head 1130112367 ECE

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

Page 16: SUMMER TRAINING REPORT ON ‘ EMBEDDED SYSTEM ’ BY SOFCON Submitted to : Submitted by : Mr. KARAMBIR SHEORAN SANDEEP Asstt. Professor & Head 1130112367 ECE

OUTPUT h g f e d c b a HEX CODE

0 1 1 0 0 0 0 0 0 C0

1 1 1 1 1 1 0 0 1 F9

2 1 0 1 0 0 1 0 0 A4

3 1 0 1 1 0 0 0 0 B0

4 1 0 0 1 1 0 0 1 99

5 1 0 0 1 0 0 1 0 92

6 1 0 0 0 0 0 1 0 82

7 1 1 1 1 1 0 0 0 F8

8 1 0 0 0 0 0 0 0 80

9 1 0 0 1 0 0 0 0 90

Truth Table: 7 Segment Display

Page 17: SUMMER TRAINING REPORT ON ‘ EMBEDDED SYSTEM ’ BY SOFCON Submitted to : Submitted by : Mr. KARAMBIR SHEORAN SANDEEP Asstt. Professor & Head 1130112367 ECE

#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

Page 18: SUMMER TRAINING REPORT ON ‘ EMBEDDED SYSTEM ’ BY SOFCON Submitted to : Submitted by : Mr. KARAMBIR SHEORAN SANDEEP Asstt. Professor & Head 1130112367 ECE

XTAL218

XTAL119

ALE30

EA31

PSEN29

RST9

P0.0/AD039

P0.1/AD138

P0.2/AD237

P0.3/AD336

P0.4/AD435

P0.5/AD534

P0.6/AD633

P0.7/AD732

P1.01

P1.12

P1.23

P1.34

P1.45

P1.56

P1.67

P1.78

P3.0/RXD10

P3.1/TXD11

P3.2/INT012

P3.3/INT113

P3.4/T014

P3.7/RD17

P3.6/WR16

P3.5/T115

P2.7/A1528

P2.0/A821

P2.1/A922

P2.2/A1023

P2.3/A1124

P2.4/A1225

P2.5/A1326

P2.6/A1427

U1

AT89C51

7 SEG LED CKT DIAGRAM

PROTEUS DESIGN

Page 19: SUMMER TRAINING REPORT ON ‘ EMBEDDED SYSTEM ’ BY SOFCON Submitted to : Submitted by : Mr. KARAMBIR SHEORAN SANDEEP Asstt. Professor & Head 1130112367 ECE

Pin no. Description

1 Ground

2 +5 Volts

3 LCD contrast

4 Instruction/Data input

5 Write/read signal

6 Enable signal

7 to 14 D0 to D7 data bus lines

About LCD

Page 20: SUMMER TRAINING REPORT ON ‘ EMBEDDED SYSTEM ’ BY SOFCON Submitted to : Submitted by : Mr. KARAMBIR SHEORAN SANDEEP Asstt. Professor & Head 1130112367 ECE

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

Page 21: SUMMER TRAINING REPORT ON ‘ EMBEDDED SYSTEM ’ BY SOFCON Submitted to : Submitted by : Mr. KARAMBIR SHEORAN SANDEEP Asstt. Professor & Head 1130112367 ECE

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

Page 22: SUMMER TRAINING REPORT ON ‘ EMBEDDED SYSTEM ’ BY SOFCON Submitted to : Submitted by : Mr. KARAMBIR SHEORAN SANDEEP Asstt. Professor & Head 1130112367 ECE

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

Page 23: SUMMER TRAINING REPORT ON ‘ EMBEDDED SYSTEM ’ BY SOFCON Submitted to : Submitted by : Mr. KARAMBIR SHEORAN SANDEEP Asstt. Professor & Head 1130112367 ECE

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

Page 24: SUMMER TRAINING REPORT ON ‘ EMBEDDED SYSTEM ’ BY SOFCON Submitted to : Submitted by : Mr. KARAMBIR SHEORAN SANDEEP Asstt. Professor & Head 1130112367 ECE

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.

Page 25: SUMMER TRAINING REPORT ON ‘ EMBEDDED SYSTEM ’ BY SOFCON Submitted to : Submitted by : Mr. KARAMBIR SHEORAN SANDEEP Asstt. Professor & Head 1130112367 ECE

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.

Page 26: SUMMER TRAINING REPORT ON ‘ EMBEDDED SYSTEM ’ BY SOFCON Submitted to : Submitted by : Mr. KARAMBIR SHEORAN SANDEEP Asstt. Professor & Head 1130112367 ECE