8051 Family Microcontroller
by Chin-Shiuh Shieh on
Microcontrollers
- Microprocessors, such as 8086 family, have only CCU and ALU in them. External RAM, ROM, and I/O are required.
- Microcontrollers, such as 8051 family, encompass CCU, ALU, RAM, ROM, and I/O in a single chip.
- Microcontrollers have limited computational power, but their low-cost make them prevalent in comsumer products and small-scale control systems.
- We adopt 8051 family microcontroller in our class for its general structure and managable system complexity.
- A large number of manufactures offer different variants of 8051 family microcontroller.
ATMEL AT89C51
Features
- 8-bit CPU optimized for control applications
- 128 bytes of on-chip Data RAM, 4K bytes of on-chip Program Memory (Flash Memory/ROM)
- 64K Program Memory address space, 64K Data Memory address space
- 32 bidirectional and individually addressable I/O lines
- Two 16-bit timer/counters
- Full duplex programmable UART
- 6-source/5-vector interrupt structure with two priority levels
Pin Configurations
- Pin Configurations
- Vcc, GND: supply voltage (5V), ground
- XTAL1, XTAL2: crystal connections for system clock
- RST: reset input
- EA: External Access, EA=5V to enable internal ROM.
- P0.0~P0.7: Port 0, bidirectional bit-addressable with open drain
- P1.0~P1.7: Port 1, bidirectional bit-addressable with internal pullups
- P2.0~P2.7: Port 2, bidirectional bit-addressable with internal pullups
- P3.0~P3.7: Port 3, bidirectional bit-addressable with internal pullups
- Alternative Functions of Port 3
- PSEN: Program Store Enable, read strobe for external program memory
- ALE: Address Latch Enable, for multiplexing AD0~AD7
- A8~A15(P2.0~P2.7): high-byte address bus for external addressing
- AD0~AD7(P0.0~P0.7): multiplexed low-byte address bus and data bus for external addressing
Memory Organization
Special Function Registers
Interrupt Mechanism
Addressing Mode
- Immediate: MOV A,#20h
- Register: MOV A,R0
- Direct: MOV A,30h
- Indirect: MOV A,@R0
- External Data Indirect: MOVX A,@DPTR
- Code Indirect: MOVC A,@A+DPTR
Instruction Set