Professional Documents
Culture Documents
1. Features: .......................................................................................................................... 2
2. Block Diagram of 8051: ............................................................................................. 3
3. PIN Diagram:................................................................................................................... 6
4. 8051 Oscillator & Timings: ..................................................................................... 7
5. Program Counter and Data Pointers: ................................................................... 8
6. A & B CPU Registers: ................................................................................................. 8
7. Flags and PSW: .............................................................................................................. 8
8. Internal Ram Interfacing:.......................................................................................... 9
9. Stack Pointer And Stack:........................................................................................ 10
10. Internal ROM: ............................................................................................................... 10
11. Ports: ................................................................................................................................ 10
12. SFR (Special Function Registers): ...................................................................... 13
1|P a ge
8051 MICROCONTROLLER
1. Features:
128 bytes of RAM (On Chip Data Memory)
4 KB of ROM (On Chip Program Memory)
2 Timers (Each of 16 bit)
1 Serial Port
4 I/O Ports (8 bits wide)
4 Register Banks
32 General Purpose Registers ( Each of 8 bit)
128 User defined software flags
8 bit bidirectional data bus
16 bit unidirectional address bus
16 bit program counter and data pointer
5 Interrupt Sources
a) 2 Internal
b) 2 External
c) 1 Serial Port Interrupt
2|P a ge
2. Block Diagram of 8051:
3|P a ge
4. Port 3:
Dedicated I/O Port.
2. RAM has:
a) Volatile
b) 128 bytes of Internal RAM
c) Divided into 32 Working Registers (divided into 4 banks of
8 bits each)
5. Serial Ports:
The Serial Ports available are RxD and TxD, which receive and transfer
data according to control signal:
a) SBUF (Serial Port Data Buffer): It holds the data.
b) SCON (Serial Control Register): It manages data
communication.
4|P a ge
c) PCON (Power Control Register): It manages data transfer
rates. It has further 4 programmable modes:
1. Serial Data Mode 0: Shift Register Mode.
2. Serial Data Mode1: Standard UART Mode (Serial
Communication).
3. Serial Data Mode 2: Multiprocessor Mode.
4. Serial Data Mode 3: Multiprocessor Mode.
6. Interrupt Control:
An Interrupt can come from internal/external source; it suspends the
microcontroller for a while. The 2 ways of giving instructions of interrupt
to microcontrollers are:
a) By sending software instructions
b) By sending hardware instructions
Note: 5 sources of interrupts in 8051 are:
1. Two External Interrupt Sources- Connected through
INT0 and INT1.
2. Two Internal Interrupt Sources- Timer Flag 0, Timer
Flag 1.
3. One Serial Port Interrupt
5|P a ge
3. PIN Diagram:
6|P a ge
11. A Controller memory’s Interfacing.
7|P a ge
therefore, 2 bytes in a single machine cycle can be fetched and
executed in 8051.
Single byte instructions are not executed in half cycle. However,
single byte throws away the second byte, which is the first byte of
new instruction.
8|P a ge
The PSW Register contains that status bits that reflect the present status of
the CPU.
0 0 Register Bank 0
0 1 Register Bank 1
1 0 Register Bank 2
1 1 Register Bank 3
9|P a ge
9. Stack Pointer And Stack:
8- bit Stack Pointer is used to hold an internal RAM address called as TOP of
Stack. The address held in the stack points the location in the internal RAM,
where last byte of data was stored.
11. Ports:
The major feature of microcontroller is versatility built into the O/I structure that
connects 8051 to the outside world. Flexibility of the usage of 40 pins on DIP
(Dual Inline Processor) is another important feature. The functions a pin
performs at any given instant depends firstly on what is physically connected to
it and then on what software commands are used to program the pin. Therefore,
in DIP mode 8051 is capable of yielding 64- bit operation.
10 | P a g e
1. Port 0:
11 | P a g e
2. Port 1:
3. Port 2:
1. It may be used as I/O port, similar to port 1. The alternate use Port
2 is to supply higher order address byte in conjunction with Port 0
and a lower order address byte to the external memory.
12 | P a g e
4. Port 3:
13 | P a g e
S.No. Name Function Internal RAM Address
[Hex]
6 IP Interrupt Priority OB8
7 P0 I/O Port Latch 80
8 P1 I/O Port Latch 90
9 P2 I/O Port Latch A0
10 P3 I/O Port Latch OB0
11 PCON Power Control 87
12 PSW Program Status Word OD0
13 SCON Serial Port Control 98
14 SBUF Serial Port Data Buffer 99
15 SP Stack Pointer 81
16 TMOD Timer 1 Counter Mode Control 89
17 TCON Timer 1 Counter Control 88
14 | P a g e