1 the 8051 microcontroller architecture a microcontroller (μc) is a single integrated circuit that...

16
1 The 8051 Microcontroller Architecture A microcontroller (μC) is a single integrated circuit that executes a user program for controlling some device. A microcontroller has a CPU in addition to a fixed amount of RAM, ROM, I/O ports, serial port, and a timer all on a single chip. An embedded system uses a microcontroller to do one task and one task only. Microcontrollers are found in devices such as microwave ovens, automobiles, keyboards, CD players, cell phones, security systems, electronic toys, garage door openers, answering machines, … etc.

Upload: adele-mcgee

Post on 22-Dec-2015

228 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 The 8051 Microcontroller Architecture A microcontroller (μC) is a single integrated circuit that executes a user program for controlling some device

1

The 8051 Microcontroller Architecture

• A microcontroller (μC) is a single integrated circuit that executes a user program for controlling some device.

• A microcontroller has a CPU in addition to a fixed amount of RAM, ROM, I/O ports, serial port, and a timer all on a single chip.

• An embedded system uses a microcontroller to do one task and one task only.

• Microcontrollers are found in devices such as microwave ovens, automobiles, keyboards, CD players, cell phones, security systems, electronic toys, garage door openers, answering machines, … etc.

Page 2: 1 The 8051 Microcontroller Architecture A microcontroller (μC) is a single integrated circuit that executes a user program for controlling some device

2

Differences between Microprocessors and Microcontrollers

1. Microprocessors contain no ROM, no RAM, no I/O ports, while microcontrollers contain ROM, RAM, I/O ports, timers and other peripherals.

2. Microcontroller systems are cheaper and more cost effective.

3. The computing power of microprocessors is higher.

Page 3: 1 The 8051 Microcontroller Architecture A microcontroller (μC) is a single integrated circuit that executes a user program for controlling some device

3

Factors Influencing the Selection of Microcontroller Chips

• Speed

• Packaging

• Power consumption

• Amount of RAM and ROM on-chip

• Number of I/O pins

• How easy to upgrade to higher performance versions

• Cost per unit

Page 4: 1 The 8051 Microcontroller Architecture A microcontroller (μC) is a single integrated circuit that executes a user program for controlling some device

4

Commercial 8-bit Microcontrollers

1. Intel’s 8051 Family

2. Microchip’s PIC Family

3. Motorola’s 6811 Family

4. Zilog’s Z8 Family

8051 Family Manufacturers

• Intel (Original)

• Atmel

• Philips/Signetics

• AMD

• Infenion (Formally Siemens)

• Dallas Semiconductors

Page 5: 1 The 8051 Microcontroller Architecture A microcontroller (μC) is a single integrated circuit that executes a user program for controlling some device

5

The 8051 Microcontroller

• 8-bit CPU

• 128B on-chip RAM

• 4KB on-chip ROM

• 2 Timers

• Four I/O Ports (Each 8-bits wide)

• One Serial Port

DIP PackageSMD

Package

Page 6: 1 The 8051 Microcontroller Architecture A microcontroller (μC) is a single integrated circuit that executes a user program for controlling some device

6

8051 Pin Configuration

Page 7: 1 The 8051 Microcontroller Architecture A microcontroller (μC) is a single integrated circuit that executes a user program for controlling some device

7

8051 Family Members

MicrocontrollerOn-chip ROMOn-chip RAMTimers

80514K ROM128 bytes2

80310128 bytes2

87514K EPROM128 bytes2

89514K Flash ROM128 bytes2

80528K ROM256 bytes3

80320256 bytes3

87528K EPROM256 bytes3

89528K Flash ROM256 bytes3

Page 8: 1 The 8051 Microcontroller Architecture A microcontroller (μC) is a single integrated circuit that executes a user program for controlling some device

8

8051 IC Minimum Connections

1 Machine Cycle = 12 Clock Periods = 12/ fck

fck = Clock frequency (4MHz – 30MHz)

Page 9: 1 The 8051 Microcontroller Architecture A microcontroller (μC) is a single integrated circuit that executes a user program for controlling some device

9

8051 Memory Architecture

• The 8051 microcontroller uses the Harvard Architecture

• In Harvard Model the program memory is separated from data memory

Page 10: 1 The 8051 Microcontroller Architecture A microcontroller (μC) is a single integrated circuit that executes a user program for controlling some device

10

Memory Organization

Internal RAM Memory Map

Internal and External Memories

On-chip ROM Address Space

Page 11: 1 The 8051 Microcontroller Architecture A microcontroller (μC) is a single integrated circuit that executes a user program for controlling some device

11

Code Memory

Page 12: 1 The 8051 Microcontroller Architecture A microcontroller (μC) is a single integrated circuit that executes a user program for controlling some device

12

Memory Expansion

Page 13: 1 The 8051 Microcontroller Architecture A microcontroller (μC) is a single integrated circuit that executes a user program for controlling some device

13

Special Function Registers (SFRs)

Page 14: 1 The 8051 Microcontroller Architecture A microcontroller (μC) is a single integrated circuit that executes a user program for controlling some device

14

The 8051 Basic Registers

Page 15: 1 The 8051 Microcontroller Architecture A microcontroller (μC) is a single integrated circuit that executes a user program for controlling some device

15

PSW Register (Flag Register)

Page 16: 1 The 8051 Microcontroller Architecture A microcontroller (μC) is a single integrated circuit that executes a user program for controlling some device

16

8051 I/O Ports

• The 8051 contains 4 I/O Ports

• Each port has 8-lines

• Each port can be programmed for input or output of data

• Port 0 and Port 2 can be used data and address lines for external memory interfacing

• Port 3 has alternate functions for external connections

• Port 0 should be connected to pull-up resistors before using it for data input or output

• Port 1 is solely designed for I/O data exchange