8051 microcontroller
-
Upload
shubhrika-sehgal -
Category
Engineering
-
view
92 -
download
3
Transcript of 8051 microcontroller
TRAINING
SEMINAR
8051
MICROCONT
ROLLER
SESSION’S AGENDA Introduction To 8051 Microcontroller Characteristics of 8051 Microcontroller Pin Diagram Of AT89C51 Programming Languages
• Assembly Language• High Level Language (Hardware C )
Software Used Led, 7 Segment, LCD And Its Interfacing Project Undergone
• Interfacing of Digital Clock With Visitor Counter
The Intel 8051 micro controller is the "grandfather" of all modern micro controllers. Over 10 manufacturers (including Intel) now make over 100 different varieties of 8051 micro controllers.
It was developed in 1971. The most commonly used 8051 ICs are
AT89C51,AT89S51. 8051 microcontroller enters the data in
HEXADECIMAL. Maximum Storage of 8 bit microcontroller is 255.
INTRODUCTION TO 8051 MICROCONTROLLER(MCU)
Characteristics of Microcontroller (MCU) RAM 128 Bytes ROM 4 KB Extended Memory up to 64 KB Architecture Von Neumann Technology CISC Power Required +5 V (DC) Bovd rate 9600 Packaging DLP Timers TMOD,TCON GPR 32 bits Frequency to run a program 921.6 KHz Time to run a program 1.085 μsec
Pin Diagram of AT89C51 It is 40 pin IC. It has 4 Port(P0,P1,P2,P3). It has 8 special pins and 32
general pins . 8 special pins are : 9th pin(Reset) has the highest
authority. 18,19 pins are for providing pulse
by crystal oscillator. 20 pin is generally grounded. 29 pin-PSEN(Program Store
Enable) 30 pin-ALE(Address Latch Enable) 31 pin-EA (Enable/External
access) 40 pin is given VCC i.e. power
ASSEMBLY LANGUAGE It is a Case Insensitive Language. Basic elements are Label, Comments, Operands,
Directives and Commands. A Label is a textual designation (generally an easy-to-
read word) for a line in a program, or section of a program .
Comment is a series of words that a programmer writes to make the program more clear and legible.
An operand is a value on which the instruction is to be performed. The operand may be a processor register, a memory address, a literal constant, or a label.
Directive is similar to an instruction, but unlike an instruction it is independent on the microcontroller model, they are usually given purposeful meanings via variables or registers.
ASSEMBLY LANGUAGE Commonly used ,Commands are as following :
MOVSyntax : MOV desination,source Example: MOV R1,#20h h represents no is in hexadecimal R1 is a destination register# is pond sign Note: When there is an alphabet at MSB then 0 is always used before it i.e.
MOV R1,#0a4h MCU accepts 8 bit data hence to represents 0-9
no we use 0 before it i.e.MOV R1,#04h
ASSEMBLY LANGUAGE ADDSyntax: ADD desination,source ADD command is always used in accumulator. JZ Syntax: JZ A, labelJump if zero i.e. if A=0 then Jump to label Example: org 00h MOV A ,#0 JZ A,SS MOV R1,#6 SS:MOV R2,#23 END MOV R1,#6 will not be performed as it will jump to SS
ASSEMBLY LANGUAGE JNZSyntax :JNZ A, label
Jump if not zero i.e. if A≠0 then Jump to label Example: org 00h MOV A ,#10 JNZ A,SS MOV R1,#6 SS:MOV R2,#23 END MOV R1,#6 will not be performed as it will jump to SS DJNZ Same as JNZ only the value of the Accumulator is decremented INC/DEC Value of register is incremented and decremented CPLCompliment of the accumulators value
HIGH LEVEL LANGUAGESo Embedded C is a high level language
that is commonly used o Developed by Dennis Ritchie & Bell Labs o C is a Case Sensitive Languageso C use header file <reg51.h>o SPECIAL FUNCTION REGISTER
Sbit is used to set a bit high It is written before main function and after
header file
Software Required Keil software used to write program in either of the
language c or assembly Editor window HumanAssemblerLinker MachineOH Converter UC Proteus is used to design the software circuitry
It is used to see the code interaction with simulated Hardware in Real time.
Avaible for PIC,8051,MSP430,AVR,HC11,ARM7/LPC2000 and basic Stamp Processors
Light Emitting Diode And Its Interfacing Color: LEDs can emit light of an intended
color without using any color filters as traditional lighting methods need. This is more efficient and can lower initial costs.
Size: LEDs can be very small (smaller than 2 mm).
On/Off time: LEDs light up very quickly Applications :• Indicators and signs• Data communication and other signaling• Sustainable lighting
Design
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
D1
LED-BLUE
D2
LED-BLUE
D3
LED-BLUE
D4
LED-BLUE
D5
LED-BLUE
D6
LED-BLUE
D7
LED-BLUE
D8
LED-BLUE
7 Segment Display And Its Interfacing* It is generally of 2 types :Common Cathode It’s 3 and 8 pins
are grounded for its working
More Brighter More Logical
Common Anode It’s 3 and 8 pins
are given Vcc for its working
Less Brighter Less Logical
Design
LCD And Its Interfacing Liquid Crystal Display It is manufactured by Optrax. Available LCD 2x16,2x20,2x40.. 2x16 LCD has 16 pins that are
1-Ground 2-Vcc(+5V)Dc 3-Contrast Control 4-Register Select 5-Read/Write 6-Enable 7-14 –Data lines 15- Positive Terminal 16-Negative Terminal
Design
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
AT89S51
D714
D613
D512
D411
D310
D29
D18
D07
E6
RW5
RS4
VSS
1
VDD
2
VEE
3
LCD1LM016L
Interfacing of Digital Clock With Visitor Counter
Digital Clock
Visitor counter
Interfacing of Digital Clock With Visitor Counter
Main components of project
Interfacing of Digital Clock With Visitor Counter
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
AT89S51
D714
D613
D512
D411
D310
D29
D18
D07
E6
RW5
RS4
VSS
1
VDD
2
VEE
3
LCD1LM016L
THANK YOU