You are on page 1of 29

MICROCONTROLLER 8051

Contents cover in Training
  

Introduction on embedded system Microcontroller basic 8051 Interfacing (LED, LCD, buzz, seven segment, switch matrix) Proteus, keil, flashmagic software

micro oven etc. Ex: AC.What is embedded system?   Embedded system is combination of hardware and software which design to perform the specific task. washing machine. .

Types of embedded system according to memory    Small scale Embedded system (8bit8051) Medium scale Embedded system (16bit-AVR) Large scale embedded system (32bit-ARM)  In training we will work on basic 8 bit .

Application areas  Automotive electronics  Aircraft electronics Trains Telecommunication   .

Application areas  Consumer electronics Fabrication equipment Smart buildings   .

Microcontrollers  Specially designed microprocessors  It is small on chip computer   Highly integrated chip includes all or most parts needed for controller A typical microcontroller has:    bit manipulation easy and direct access to I/O quick and efficient interrupt processing  Microcontroller drastically reduces design cost 7/175 .

      8/175 . stereos) Computers and computer equipment (laser printers. factory. television and VCRs..Applications  Appliances (microwave oven.. Environmental control (greenhouse. home) Instrumentation Aerospace Robotics. refrigerators. disk drives) Automobiles (engine control. diagnostics. modems. climate control). etc.

keyboard handling. or 32 bit microcontrollers specialized processors include features specific for     communications. 9/175 . signal processing. 8. and other tasks.Flavors   4. 16. video processing.

Intel 8051: Manufacturers           AMD ARM Microcontrollers ARC Cores Atmel Dallas Hitachi semiconductors Intel ISSI Matra Microchip         OKI Philips Siemens SMC SSI Texas Instruments ZiLog etc. 10/175 .

Popular Microcontrollers        Part 1 8048 (Intel) 8051 (Intel and others) 80c196 (MCS-96) 80186.80188 (Intel) 80386 EX (Intel) 65C02/W65C816S/W65C134S (Western Design Center) MC14500 (Motorola) 11/175 .

p t R l O M R A M t i m t i m e r e r 1 0 c o u n t e i n p u t s  Optional parts are:     O S C b u s c o n t r o l 4 I / O p o r t s s e r i a l p o r t T P 0P 2 P 1P 3 x DR x D a d d r e s s / d a t a 12/175 .Microcontrollers  Basic parts are:       Central Processing Unit e x t e r n a l i n e r r u p t s RAM EPROM/PROM/ROM or FLASH i n t e r r u Memory c o n t r o I/O serial or/and parallel timers interrupt controller C P U Watch Dog Timer AD Converter LCD driver etc.

6 1 . 0 / A s s 13/175 . 4 / A P 0 .66 3 1 . 0 T x D / 1 1 P 3 . 5 / A P 2 . 6 / A P 2 . 1 I N T 0 / P 31 2. 3 / A P 0 . 77 L 12 8 L 11 9 2 0 P 2 . 2 1 . 1 / A P 2 . 2 IN T 1 / P T 0 / P T 1 / P W R R D X T X T V / P / P A A 31 3. 5 1 . 0 1 . 7 / A P 2 . 4 1 . 3 3 1. 55 3 1 . 44 3 1. 1 1 . 4 / A P 2 . 3 / A P 2 . 6 / A P 0 . 2 / A P 0 . 1 / A P 0 . 6 / A E A A L E E N 1 5 1 4 1 3 1 2 1 1 1 0 9 8 P S D D D D D D D D 0 1 2 3 4 5 6 6 x D / P 3 1 0. 5 / A P 0 . 2 / A P 2 .Intel 8051: Pin Configurations    Part 1 Dual In-Line Package Plastic Lead Chip Carrier Plastic Quad Flat Pack P P P P P P P P R R 1 . 3 1 . 0 / A P 0 . 7 S T 1 2 3 4 5 6 7 8 9 4 0 3 9 3 8 3 7 3 6 3 5 3 4 3 3 3 2 3 1 3 0 2 9 2 8 2 7 2 6 2 5 2 4 2 3 2 2 2 1 V c c P 0 .

Port 0  V C C L 1 V S S X T A  SECONDARY FUNCTIONS  Open drain.Power Supply P0.Intel 8051: Pin Description    PORT 0 Part 1 VSS .7 . bi-directional I/O port Pins that have 1s written to them float and can be used as high-impedance inputs Multiplexed low-order address and data bus during accesses to external program and data memory A D D R E D A T A S S B U X T A R E P A R IN IN x D T 0 T 1 T x D L E S S A E / P T / V N R O G p p L 2 PORT 2 PORT 3 PORT 1 A D D R E S S T 0 T 1 W R R D 14/175 .Ground: 0V VCC .0-P0.

Port 2 emits high-order address byte during accesses to external program and data memory Bi-directional I/O port with internal pull-ups Pins that have 1s written to them float and can be used as high-impedance inputs.Serial output port INT0 .Port 3   RxD .Timer 1 external input WR .0-P3.External interrupt INT1 .Intel 8051: Pin Description  Part 2 P2.External interrupt T0 .External data memory write strobe RD .0-P2.Timer 0 external input T1 .7 .External data memory read strobe  15/175 .Serial input port TxD . Port 3 serves the special features:         P3.7 .Port 2     Bi-directional I/O port with internal pull-ups Pins that have 1s written to them float and can be used as high-impedance inputs.

External Access Enable  A high on this pin for two machine cycles resets the devices Output pulse for latching the low byte of address during an access to external memory Read strobe to external program memory   ALE .Reset   EA .Intel 8051: Pin Description  Part 3 RST .Program Store Enable   XTAL2 .Address Latch Enable  EA must be externally held low to enable device to fetch code from external memory locations. Input to the inverting oscillator amplifier and input to internal clock generator circuits Output from the inverting oscillator amplifier XTAL1 .Crystal 1   PSEN .Crystal 2  16/175 .

Intel 8051: The On-Chip Oscillator    Intel 8051 microcontrollers have an on-chip oscillator resonators are connected between XTAL1 and XTAL2 pins external oscillators (HMOS or CMOS) Q U A R T Z C R Y S T A L O R C E R A M I C R E S O N A T O R 8 0 5 1 L 2 C 1 X T A C 2 X V T A L 1 S S 17/175 .

Basic concept of Programming in C .

Basic concept of Programming in C .

Switch Matrix and Buzz .Interfacing with 8051      LED LED. Seven Segment LCD with switch LCD with Switch Matrix LCD.

LED interfacing with C Programming   Eight LED connected to the Port 0 Program: Circuit Diagram: .

Seven Segment Interfacing with 8051  Circuit diagram: .

LCD (JHD162) interfacing with 8051  Instruction  Pin description .

LCD (JHD162) interfacing with 8051  Program .

 Circuit diagram .Switch matrix   It is the ratio matrix 4*4 It means 16 switahes are used in the ckt.

LCD with switch matrix interfacing  Circuit diagram .

LCD with switch matrix interfacing  Program  Program .

. Keil. Flash Magic is used for installation Program in 8051. Flash Magic software    Proteus is used for testing the ckt on computer.Proteus. Keil is use for Programming and finding debugs in Program.

PROJECT .

!  % .

!  %.

!  % .

!  %.

!  #.

!  #.

. ! .!  % % '88                                         '.

 ! .

 ! .

 ! .

 ! .

 ! .

 ! .

 ! .

   !$ ! .

 ! .

 ! .

 ! .

 ! .

 ! .

 ! .

 ! .

 .

 .

79 390 !308.943..!.75943 ! #% '$$ '$$ 74:3/ ' ' ' !407$:55 ! !  ! !  !479 503/7.3 - /70.

.//7088..9.3/ /.3/.9.8 250/.2.3-0:80/.0 35:98 :9500/4 :9500/4 47/07.08799039490214.-:8/:73. 5479 - !389.088089409073.3-0:80/.3//....9 .3.9. 5747.8 .20247 ' % '$$ #$$ %&$ % #$% .3/.

'55 !$ .

!#  $ #&% $ # % % % % % # # ! #% ! #% #$$&$ ! #% .

 .

79 390 !308..!.943.75943 ! !  ! !  !479   /70.

9.20247 70.3//.943./.3/.39077:59 %  %  %207 09073.0890 850.5: 939073..39077:59 % % 9073.08799039490214.8 .10.././/7088-90 /:73.9.20247 7908974-0 # # 9073.35:9 % % %20709073.9:708 # # $07.5747..088089409073.5: :58 !389.3-0:80/.3-0:80/.3.35:9 # # 9073..4:95:95479 %  %  9073.9..3/.8 250/.0 35:98 !4790298 !4790298 47/07.35:95479 % % $07..2 .9 .9.20247 !479807../8974-0 ! !  ! !  !479   /70. 5479 939073.

9 ..9..3/.3-0:80/.3-0:80/.5: 939073.3/.0 35:98 .3. 5479 939073.8 .5: :58 !389.08799039490214.8 250/..

 .

094109.9438   //7088.75943 #$% #0809 #$% 439853 147942.-0 !$ #0..9.0889409073.202474.20247 % % 789..0883. :95:91742903.2$94703.4/01742 09073.947 .7...079348.0870809890 /0.08   9073.:98 !$ !747.0307.30.3/ 35:99439073.4.079348.2 20247 % % 789.3 ./8974-09409073....947 .-0 2:89-009073.5747..947 .79 390 !308..3 904-9041.//7088/:73.!.9. 35:994903...25107.-0 :95:95:80147.25107 ..-0/0.3.0/494 03..

 .

3/% 538 09073.4330.74.90/ -09003%.9478  $ 47 $ "&#%#$% # ##$ % #   %   % '$$ ..0.548.0..343 .947 70843.9478.390 %0 3 5 8..43974078 .343 .947 3 390 2.70..48..

 .

.05941!747.43..2233 .8.

..2233 .43.8.05941!747.

03$02039 989.39071.97  $9..3/: ..39    $0.97. 9$9..

2 7.2 .90/ 9490!479 !747.7.:9.4330.223 9..39071.39!747.

$0.39  7.:9/..2 .03$0203939071.7.

943 !3/08..  39071.39  3897:.75943 .

2 ..  39071.39  !747.

3889.08.97  920.97 98907.$9.2.7.:9/.9 7.2 .70 :80/390.942.

.2.989.7.2 .9739071.:9/.3 7.

3 !747.9739071.989.2.2 ..2 !747.

!7490:8 0 .223.8.8:80/147389.425:907 08:80147!747.70 !7490:88:80/1479089390.943!747.2 .8.3/13/3/0-:8 3!747..8419..943..23   .

!# % .