Tutorials

Only available on StudyMode
  • Topic: Processor register, Computer architecture, Addressing mode
  • Pages : 85 (19718 words )
  • Download(s) : 109
  • Published : January 14, 2013
Open Document
Text Preview
8051 TUTORIAL
Donal Heffernan University of Limerick May-2002

8051 Tutorial D.Heffernan © 2000, 2001

1

Blank

8051 Tutorial D.Heffernan © 2000, 2001

2

Some reference material:
Test books + MacKenzie Scott. The 8051 Microcontroller, Prentice Hall. 3rd. Ed., 1999 + Yeralan and Ahluwalia. Programming and Interfacing the 8051 Microcontroller. Addison-Wesley. 1995.

U.L. Server (Shared folder) Go to ‘Network Neighborhood’, then ‘Entire Network’, then pick Domain ‘Intel_Data_Comm’ and choose the server ‘Intel_Comm’. In the folder ‘ET4514’ you will find the required information

Web Sites 8052 tutorial information by Vault Information Services: http://www.8052.com

Intel’s site for 8051 based products:
http://developer.intel.com/design/mcs51/

Philips’ site for 8051 based products:
http://www-us.semiconductors.philips.com/microcontrol/

Infineon (formerly Siemens) site for 8051 based products:
http://www.infineon.com/products/micro/micro.htm

Keil development tools:
http://www.keil.com/home.htm

Information on Analog Devices ADuC812 (8051/8052 compatible processor): www.analog.com/microconverter .

8051 Tutorial D.Heffernan © 2000, 2001

3

CONTENTS
Chapter 1 Chapter 2 Chapter 3 Chapter 4 Chapter 5 Chapter 6 Appendix A Appendix B Appendix C 8051 Microcomputer Overview A Simple Design Example Software Delay Routines Interrupts Timer/Counters The 8051 Serial Port Example Term Assignments Sample Exam Questions & Answers A Brief Introduction to Using Keil Tools 6 31 36 45 53 65 A1 B1 C1

8051 Tutorial D.Heffernan © 2000, 2001

4

8051 Tutorial D.Heffernan © 2000, 2001

5

Chapter 1

8051 Microcomputer Overview

1.1 INTRODUCTION Figure 1.1 shows a functional block of the internal operation of an 8051 microcomputer. The internal components of the chip are shown within the broken line box. ADDRESS BUS (External) 16 bit

Internal Memory
Memory Address Register (Uses P0 and P2)

I-RAM General Registers STACK Bit-addressable SFRs etc. DATA BUS (External) 8 bit

DPTR

P.C.

Internal data bus
Instruction Register

B

Acc
Accumulator

Instruction decoder/ control logic PSW flags
C AC F0 RS1 RS2 OV P

Temporary register

Temporary register

Control Lines

ALU 8-bit

RD/ WR/ PSEN/ ALE/ etc.

Figure 1.1 8051 functional block diagram.

8051 Tutorial D.Heffernan © 2000, 2001

6

Figure 1.2 shows the external code memory and data memory connected to the 8051 chip. Note – part of the external code memory can be located within the chip but we will ignore this feature for now. Also, variants of the chip will allow a lot more memory devices and I/O devices to be accommodate within the chip but such enhanced features will not be considered right now.

ADDRESS BUS (16-bit)
12MHz

8051

External DATA Memory (RAM)
control lines

External CODE Memory (ROM)

I-RAM

DATA BUS (8-bit)
I/O ports e.g. P1, P3 etc.

Figure 1.2 8051 chip with external memory

8051 Tutorial D.Heffernan © 2000, 2001

7

A quick comparison with the well known Pentium processor
A modern PC is powered by a Pentium processor (or equivalent), which is really a very powerful microprocessor. Where the 8051 microcontroller represents the low end of the market in terms of processing power, the Pentium processor is one of the most complex processors in the world. Figure 1.3 shows a simplified block diagram of the Pentium processor and a simple comparison between the 8051 and the Pentium is given in the table below. 1,000MHz (1 GHz.)

ADDRESS BUS (32-bit)

PENTIUM Chip
multiple 32-bit ALUs (Superscalar) control lines

The Pentium's Memory Space

DATA BUS (64-bit)

Figure 1.3 Simplified diagram of a Pentium processor

Simple comparison: Pentium vs. 8051 FEATURE
Clock Speed

8051
12Mhz. typical but 60MHz. ICs available 16 bits

PENTIUM
1,000 MHz. (1GHz.)

COMMENT
8051 internally divides clock by 12 so for 12MHz. clock effective clock rate is just 1MHz....
tracking img