Seminar Topics & Project Ideas On Computer Science Electronics Electrical Mechanical Engineering Civil MBA Medicine Nursing Science Physics Mathematics Chemistry ppt pdf doc presentation downloads and Abstract

Full Version: 8051 Tutorial pdf
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
8051 Tutorial


[attachment=50298]

INTRODUCTION

Despite it’s relatively old age, the 8051 is
one of the most popular microcontrollers in use
today. Many derivative microcontrollers have since
been developed that are based on--and
compatible with--the 8051. Thus, the ability to
program an 8051 is an important skill for anyone
who plans to develop products that will take
advantage of microcontrollers.
Many web pages, books, and tools are
available for the 8051 developer.
I hope the information contained in this
document/web page will assist you in mastering
8051 programming. While it is not my intention that
this document replace a hardcopy book purchased
at your local book store, it is entirely possible that
this may be the case. It is likely that this document
contains everything you will need to learn 8051
assembly language programming. Of course, this
document is free and you get what you pay for so
if, after reading this document, you still are lost you
may find it necessary to buy a book

Code Memory

Code memory is the memory that holds
the actual 8051 program that is to be run. This
memory is limited to 64K and comes in many
shapes and sizes: Code memory may be found
on-chip, either burned into the microcontroller as
ROM or EPROM. Code may also be stored
completely off-chip in an external ROM or, more
commonly, an external EPROM. Flash RAM is
also another popular method of storing a program.
Various combinations of these memory types may
also be used--that is to say, it is possible to have
4K of code memory on-chip and 64k of code
memory off-chip in an EPROM.

External RAM

As an obvious opposite of Internal RAM,
the 8051 also supports what is called External
RAM. As the name suggests, External RAM is any
random access memory which is found off-chip.
Since the memory is off-chip it is not as flexible in
terms of accessing, and is also slower. For
example, to increment an Internal RAM location by
1 requires only 1 instruction and 1 instruction
cycle. To increment a 1-byte value stored in
External RAM requires 4 instructions and 7
instruction cycles. In this case, external memory is
7 times slower!

Special Function Register (SFR) Memory

Special Function Registers (SFRs) are
areas of memory that control specific functionality
of the 8051 processor. For example, four SFRs
permit access to the 8051’s 32 input/output lines.
Another SFR allows a program to read or write to
the 8051’s serial port. Other SFRs allow the user
to set the serial baud rate, control and access
timers, and configure the 8051’s interrupt system.
When programming, SFRs have the
illusion of being Internal Memory. For example, if
you want to write the value "1" to Internal RAM
location 50 hex you would execute the instruction.