Traning 8051 2010
Traning 8051 2010
Traning 8051 2010
Introduction on embedded system Microcontroller basic 8051 Interfacing (LED, LCD, buzz, seven segment, switch matrix) Proteus, keil, flashmagic software
Embedded system is combination of hardware and software which design to perform the specific task. Ex: AC, washing machine, micro oven etc.
Small scale Embedded system (8bit8051) Medium scale Embedded system (16bit-AVR) Large scale embedded system (32bit-ARM)
Application areas
Automotive electronics
Application areas
Microcontrollers
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
7/175
Applications
Appliances (microwave oven, refrigerators, television and VCRs, stereos) Computers and computer equipment (laser printers, modems, disk drives) Automobiles (engine control, diagnostics, climate control), Environmental control (greenhouse, factory, home) Instrumentation Aerospace Robotics, etc...
8/175
Flavors
communications, keyboard handling, signal processing, video processing, and other tasks.
9/175
AMD ARM Microcontrollers ARC Cores Atmel Dallas Hitachi semiconductors Intel ISSI Matra Microchip
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
Microcontrollers
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.
p t R l
t i m t i m
e r e r
1 0
c o u n t e i n p u t s
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
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 . 0 1 . 1 1 . 2 1 . 3 1 . 4 1 . 5 1 . 6 1 . 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 . 0 / A P 0 . 1 / A P 0 . 2 / A P 0 . 3 / A P 0 . 4 / A P 0 . 5 / A P 0 . 6 / 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. 0 T x D / 1 1 P 3 . 1 I N T 0 / P 31 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. 3 3 1. 44 3 1. 55 3 1 .66 3 1 . 77 L 12 8 L 11 9
2 0
P 2 . 7 / A P 2 . 6 / A P 2 . 5 / A P 2 . 4 / A P 2 . 3 / A P 2 . 2 / A P 2 . 1 / A P 2 . 0 / A
s s
13/175
Part 1
V C
C L 1
X T A
SECONDARY FUNCTIONS
Open drain, 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
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
T 0 T 1 W R R D
14/175
Part 2
P2.0-P2.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. 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.
P3.0-P3.7 - Port 3
RxD - Serial input port TxD - Serial output port INT0 - External interrupt INT1 - External interrupt T0 - Timer 0 external input T1 - Timer 1 external input WR - External data memory write strobe RD - External data memory read strobe
15/175
Part 3
RST - Reset
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
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
XTAL2 - Crystal 2
16/175
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
T A
X V
T A L 1 S S
17/175
LED LED, Seven Segment LCD with switch LCD with Switch Matrix LCD, Switch Matrix and Buzz
Circuit Diagram:
Circuit diagram:
Instruction
Pin description
Program
Switch matrix
It is the ratio matrix 4*4 It means 16 switahes are used in the ckt.
Circuit diagram
Circuit diagram
Program
Program
Proteus is used for testing the ckt on computer. Keil is use for Programming and finding debugs in Program. Flash Magic is used for installation Program in 8051.
PROJECT