8051 Microcontroller Architecture
8051 Microcontroller Architecture
8051 Microcontroller Architecture
Objectives
P1.1 2 39 P0.0(AD0)
P1.2 3 38 P0.1(AD1)
P1.3 4 37 P0.2(AD2)
P1.4 5 36 P0.3(AD3)
Ext
Memory
P1.5 6 8051 35 P0.4(AD4) Address
P1.6 7 34 P0.5(AD5)
P1.7 8 33 P0.6(AD6)
RST 9 32 P0.7(AD7)
XTAL 2 18 23 P2.2(A10)
clock
XTAL 1 19 22 P2.1(A9)
GND 20 21 P2.0(A8)
(40)Vcc
Port 1 Port 3
(20) Vg
Data RAM
TCON,TMOD EPROM
Register B Acc T
TLO/1, THO/1
code
SCON,SBUF,IE,IP
FCON
(SFRs
Ex.M access ALT
Control Timer User data PC
(29-31) And
Control
psw
IR +1
Reset
(9)
A7 - 0
A15 - 8
A Ex.M (upto 64k)
15 - 0
Internal code
External data memory
Memory
RAM
ROM or EPROM
64k
4k or up
0xFF
SFR(direct access)
128 bytes External code memory
ROM or EPROMext
64k
0x80
0x7F
0x30
0x2F
0x20
0x1F Register bank 0(R0-R7)
CY AC F0 RS1 RS0 OV P
TMOD - ( Timer Mode Register) SFR(not bit addressable)
bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0
Gate Control:
• 0= Timer enabled(normal mode)
• 1 = if INT0/INT1 is high, the timer is enabled to count
the number of pulses in the external interrupt ports
(P3.2 and P3.3)
C/T - Counter/Timer Selector