Professional Documents
Culture Documents
Used As Used In
a CPU of a computer Control Application
• 8088 • 8086
• 80x86 • Z 80
• Pentium • MC 6800
• Intel 8051
• AVR
• PIC
• Dallas series
• Phillips
Microcontroller & Microprocessor
Television Copiers
Telephone Elevators
Body controller of Automobile Irons
Remote control Cellular phone
Different parts of PC(printer,modem,disk controller
keyboard ) Security system
Home appliances (Microwave oven , Washing machine)
Environment control (green house, factory)
Digital diary
Vending machines
8 – Bit Microcontrollers
• Motorola’s 6811
•Intel’s 8051
•Zilog’s Z8
•Microchip Technology’s PIC 16X
Intel Siemens
Atmel Dallas Semiconductor
Philips AMD
Microcontroller Block Diagram -
Features of 8031 Architecture
• Optimized 8 bit CPU for control applications
•Extensive Boolean processing capabilities.
•8 bit and 16 bit registers.
• 64 K program memory address space
• 64 K Data memory address space
•128 bytes of on chip data memory
•32 bi-directional and individually addressable I/O lines
• Two 16-bit timers/counters
•Full Duplex UART, programmable in 4 modes
8-bit UART , 9-bit UART , Inter-processor communication
link, shift register I/O expander
•5 vector interrupts structure with priority levels
•On chip clock oscillator
Inside Microcontroller
Ex.INT Timer I/P
Timer/Counter
Interrupt RO RAM
M
CPU
P0-P3
8051 Block Diagram
I/O
PSW SFR
ALU L P0 A0-7
& RAM D0-7
ROM I/O
L P2 A8-15
PC DPTR I/O
INT.
L P3
16- Bit Address Bus Counter
S.Data
EA
ALE
System Timing L- Latch
PSEN
Interrupts
XTAL1
XTAL2
Data Buffers
RESET
Memory Control
8051 Programming Model
A E0 B F0 TMOD TCON FFF
IP B8 IE A8
89 88
7F
General TH0 TL0 TH1 TL1
purpose 8C 8A 8D 8B
30 Area ROM
2F SCON SBUF PCON PSW
Bit Address 98 99 87 D0
20 Area
S
R.Bank 3
P
8
R.Bank 2 1
DPTR
R.Bank 1 DPH DPL PC
83 82
Registe
r
000
Port 0 Port 1 Port Port 3
Bank 0
80 90 2 B0
00
R0-R7 A0
* Bit addressable
Versions of 8051 from ATMEL
17
BANK 2
R0--R7
10
0F
BANK 1
R0--R7
08
07
BANK 0
R0 -- R7 20 07
00 30
00
Working Registers Bit Addressable General purpose
Program Status Word
CY AC F0 RS1 RS0 OV - P
User flag 0
TCON
Timer 1 overflow
flag Ext Int 0 signal type
control bit
1- edge trigger
0- level trigger
TMOD
Timer 1 Timer 0
Gate C or /T M1 M0 Gate C or /T M1 M0
Mode of timer
1 –Counter
C or /T
Osc Freq. /12 =0
0- Timer
OR gate enable bit
T1/0 pin C or /T To
=1 Timer
TR1/0 bit
Gate in TCON
Bit
/INT 1 or 0
SCON(Serial Port Control)
Transmitted bit 8
Priority of Timer 1
OF int.
Priority of serial port Priority of Ext. Int
interrupt 0
1- from Serial port when data transmission and reception
operation is executed.
2– from timers , when overflow occurs
2- from two input pins INT0, INT1
Each interrupt can be independently enabled and priority
will be given using IE and IP register.
Interrupt service routine starting address
External 0 0003h
Timer/Counter 0 000Bh
External 1 0013h
Timer/Counter 1 001Bh
Serial port 0023h 31