0% found this document useful (0 votes)
223 views45 pages

BEC405A Module 1 Akshaya

The document provides an introduction to the 8051 Microcontroller, detailing its features, applications, and the structure of embedded systems. It outlines the criteria for choosing a microcontroller, characteristics of embedded systems, and the various types of embedded systems. Additionally, it describes the CPU registers, data memory, and program memory of the 8051 Microcontroller, highlighting its components and functionalities.

Uploaded by

Faiz Karobari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
223 views45 pages

BEC405A Module 1 Akshaya

The document provides an introduction to the 8051 Microcontroller, detailing its features, applications, and the structure of embedded systems. It outlines the criteria for choosing a microcontroller, characteristics of embedded systems, and the various types of embedded systems. Additionally, it describes the CPU registers, data memory, and program memory of the 8051 Microcontroller, highlighting its components and functionalities.

Uploaded by

Faiz Karobari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 45

AKSHAYA INSTITUTE OF TECHNOLOGY,TUMKUR

Department of Electronics & Communication Engineering

Module 1 Notes for


“Introduction”
[BEC405A]

Prepared by:
Dr. Vijaya Kumar H R

Associate Professor

Department of ECE.

Akshaya Institute of Technology

Tumakuru
Microcontrollers Semester 4
8051 Microcontroller
Module 1: Introduction

Dr. Vijaya Kumar H R


Associate. Professor, Dept. of ECE, AIT, Tumakuru
Dr. Vijaya Kumar H R
Associate. Professor, Dept. of ECE, AIT, Tumakuru
Dr. Vijaya Kumar H R
Associate. Professor, Dept. of ECE, AIT, Tumakuru
Criteria for Choosing a Microcontroller Various versions of Microcontroller

• Meeting the computing needs of the task at


hand efficiently and cost effectively
• Speed
• Packaging
• Power consumption
• The amount of RAM and ROM on chip
• The number of I/O pins and the timer on
chip
• How easy to upgrade to higher
performance or lower power-consumption
version
• Cost per unit

Dr. Vijaya Kumar H R


Associate. Professor, Dept. of ECE, AIT, Tumakuru
Applications of Microcontroller

1. Consumer electronics products: Toys, Camera, Robots, washing machine, Microwave ovens
2. Instrumentation and process control: Oscilloscopes, Multimeter, Leakage current tester, data acquisition and control.
3. Medical instruments: ECG, Blood measurements.
4. Communication: Cell phones, telephone sets, communication machines.
5. Office: Security system, FAX Machine, copier, printer, paging, intercom.
6. Auto: Engine control, air bag, security system, center locking system.
7. Others: Cellular phones, traffic controller, musical instruments, camera, E voting machine etc.

Dr. Vijaya Kumar H R


Associate. Professor, Dept. of ECE, AIT, Tumakuru
• An embedded system is a combination of computer hardware and software designed for a specific function.
Embedded systems may also function within a larger system.
• The systems can be programmable or have a fixed functionality. Industrial machines, consumer electronics,
agricultural and processing industry devices, automobiles, medical equipment, cameras, digital watches,
household appliances, airplanes, vending machines and toys, as well as mobile devices, are possible locations
for an embedded system.
• While embedded systems are computing systems, they can range from having no user interface (UI) -- for example, on
devices designed to perform a single task -- to complex graphical user interfaces (GUIs), such as in mobile devices. User
interfaces can include buttons, LEDs (light-emitting diodes) and touchscreen sensing. Some systems use remote user
interfaces as well.
Dr. Vijaya Kumar H R
Associate. Professor, Dept. of ECE, AIT, Tumakuru
Characteristics of embedded systems Structure of embedded systems
• The main characteristic of embedded systems Embedded systems vary in complexity but, generally,
is that they are task-specific. consist of three main elements:
• Additionally, embedded systems can include •Hardware. The hardware of embedded systems is based
the following characteristics: typically, consist around microprocessors and microcontrollers.
of hardware, software and firmware; Microprocessors are very similar to microcontrollers and,
• can be embedded in a larger system to typically, refer to a CPU (central processing unit) that is
perform a specific function, as they are built for integrated with other basic computing components such as
specialized tasks within the system, not memory chips and digital signal processors (DSPs).
various tasks; Microcontrollers have those components built into one chip.
• can be either microprocessor-based or •Software and firmware. Software for embedded systems
microcontroller-based -- both are integrated can vary in complexity. However, industrial-grade
circuits that give the system compute power; microcontrollers and embedded IoT systems usually run
• are often used for sensing and real-time very simple software that requires little memory.
computing in internet of things (IoT) devices, •Real-time operating system. These are not always
which are devices that are internet-connected included in embedded systems, especially smaller-scale
and do not require a user to operate; systems. RTOS define how the system works by
• can vary in complexity and in function, which supervising the software and setting rules during program
affects the type of software, firmware and execution.
hardware they use; and
• are often required to perform their function Dr. Vijaya Kumar H R
under a time constraint to keep the larger Associate. Professor, Dept. of ECE, AIT, Tumakuru
system functioning properly.
Basic embedded system would consist of Types of embedded systems
the following elements: There are a few basic embedded system types, which differ
•Sensors convert physical sense data into in their functional requirements. They are:
an electrical signal. •Mobile embedded systems are small-sized systems that
•Analog-to-digital (A-D) converters change are designed to be portable. Digital cameras are an example
an analog electrical signal into a digital one. of this.
•Processors process digital signals and •Networked embedded systems are connected to a
store them in memory. network to provide output to other systems. Examples
•Digital-to-analog (D-A) converters change include home security systems and point of sale (POS)
the digital data from the processor into systems.
analog data. •Standalone embedded systems are not reliant on a host
•Actuators compare actual output to system. Like any embedded system, they perform a
memory-stored output and choose the specialized task. However, they do not necessarily belong to
correct one. a host system, unlike other embedded systems. A calculator
or MP3 player is an example of this.
The sensor reads external inputs, the •Real-time embedded systems give the required output in
converters make that input readable to the a defined time interval. They are often used in medical,
processor, and the processor turns that industrial and military sectors because they are responsible
information into useful output for the for time-critical tasks. A traffic control system is an example
embedded system. of this.
Dr. Vijaya Kumar H R
Associate. Professor, Dept. of ECE, AIT, Tumakuru
Embedded
Microcontroller

Dr. Vijaya Kumar H R


Associate. Professor,
Dept. of ECE, AIT,
Tumakuru
Features of 8051 Microcontroller:
•4KB bytes on-chip program memory (ROM)
•128 bytes on-chip data memory (RAM)
•Four register banks
•128 user defined software flags
•8-bit bidirectional data bus
•16-bit unidirectional address bus
•32 general purpose registers each of 8-bit
•16 bit Timers (usually 2, but may have more
or less)
•Three internal and two external Interrupts
•Four 8-bit ports,(short model have two 8-bit
ports)
Dr. Vijaya
Kumar H R •16-bit program counter and data pointer
Associate.
Professor, •8051 may also have a number of special
Dept. of ECE,
features such as UARTs, ADC, Op-amp, etc.
AIT, Tumakuru
CPU of 8051: Registers are used in the CPU to store information on temporarily basis
which could be data to be processed, or an address pointing to the data which is to be
fetched. In 8051, there is one data type is of 8-bits, from the MSB (most significant bit)
D7 to the LSB (least significant bit) D0. With 8-bit data type, any data type larger than 8-
bits must be broken into 8-bit chunks before it is processed. The most widely used
registers of the 8051 are A (accumulator), B, R0-R7, DPTR (data pointer), and PC
(program counter). All these registers are of 8-bits, except DPTR and PC.

Accumulator: A register or Acc register: The accumulator, register A, is a 8 bit register


and it is used for all arithmetic and logic operations. If the accumulator is not present,
then every result of each calculation (addition, multiplication, shift, etc.) is to be stored
into the main memory. Access to main memory is slower than access to a register like the
accumulator because the technology used for the large main memory is slower (but
cheaper) than that used for a register.

The "B" Register: The "B" register is very similar to the Accumulator in the sense that
it may hold an 8-bit (1-byte) value. The "B" register is used only by two 8051
instructions: MUL AB and DIV AB. To quickly and easily multiply or divide A by another
number, you may store the other number in "B" and make use of these two
instructions. Apart from using MUL and DIV instructions, the "B" register is often used
as yet another temporary storage register, much like a ninth R register.

Dr. Vijaya Kumar H R


Associate. Professor, Dept. of ECE, AIT, Tumakuru
The Data Pointer: The Data Pointer (DPTR) is the 8051’s only user-accessible 16-bit (2-byte) register. The
Accumulator, R0–R7 registers and B register are 1-byte value registers. DPTR is meant for pointing to data. It is
used by the 8051 to access external memory using the address indicated by DPTR. DPTR is the only 16-bit register
available and is often used to store 2-byte values.

The Program Counter: The Program Counter (PC) is a 2-byte address which tells the 8051 where the next
instruction to execute can be found in the memory. PC starts at 0000h when the 8051 initializes and is
incremented every time after an instruction is executed. PC is not always incremented by 1. Some instructions
may require 2 or 3 bytes; in such cases, the PC will be incremented by 2 or 3.

The Stack Pointer (SP): The Stack Pointer, like all registers except DPTR and PC, may hold an 8-bit (1-byte) value.
The Stack Pointer tells the location from where the next value is to be removed from the stack. When a value is
pushed onto the stack, the value of SP is incremented and then the value is stored at the resulting memory
location. When a value is popped off the stack, the value is returned from the memory location indicated by SP,
and then the value of SP is decremented.
This order of operation is important. SP will be initialized to 07h when the 8051 is initialized. If a value is pushed
onto the stack at the same time, the value will be stored in the internal RAM address 08h because the 8051 will
first increment the value of SP (from 07h to 08h) and then will store the pushed value at that memory address
(08h). SP is modified directly by the 8051 by six instructions: PUSH, POP, ACALL, LCALL, RET, and RETI.
. Dr. Vijaya Kumar H R
Associate. Professor, Dept. of ECE, AIT, Tumakuru
8051 Flag Bits and PSW Register
The program status word (PSW) register is an 8-bit register, also known as flag register. It is of 8-bit wide but only 6-
bit of it is used. The two unused bits are user-defined flags. Four of the flags are called conditional flags, which
means that they indicate a condition which results after an instruction is executed. These four
are CY (Carry), AC (auxiliary carry), P (parity), and OV (overflow). The bits RS0 and RS1 are used to change the
bank registers. The following figure shows the program status word register.
•CY, the carry flag − This carry flag is set (1) whenever there is
a carry out from the D7 bit. It is affected after an 8-bit addition or
subtraction operation. It can also be reset to 1 or 0 directly by an
instruction such as "SETB C" and "CLR C" where "SETB"
stands for set bit carry and "CLR" stands for clear carry.
•AC, auxiliary carry flag − If there is a carry from D3 and D4
during an ADD or SUB operation, the AC bit is set; otherwise, it
is cleared. It is used for the instruction to perform binary coded
decimal arithmetic.
•P, the parity flag − The parity flag represents the number of 1's
in the accumulator register only. If the A register contains odd
number of 1's, then P = 1; and for even number of 1's, P = 0.
•OV, the overflow flag − This flag is set whenever the result of
a signed number operation is too large causing the high-order bit
to overflow into the sign bit. It is used only to detect errors in
signed arithmetic operations.

Dr. Vijaya Kumar H R


Associate. Professor, Dept. of ECE, AIT, Tumakuru
Dr. Vijaya Kumar H R
Associate. Professor, Dept. of ECE, AIT,
Tumakuru
Data Memory (RAM) or Internal RAM
of 8051 Microcontroller: The Data
Memory or RAM of the 8051
Microcontroller stores temporary data
and intermediate results that are
generated and used during the normal
operation of the microcontroller. Original
Intel’s 8051 Microcontroller had 128B of
internal RAM.

Three parts:
1. 4 Register bank.
2. Bit-addressable location or Special
function registers
3. General purpose or Scratch pad
registers.

Dr. Vijaya Kumar H R


Associate. Professor, Dept. of ECE, AIT, Tumakuru
• The 4 banks are named as Bank0, Bank1, Bank2 and Bank3. Each Bank consists of 8 registers named as R0 – R7. Each Register can be
addressed in two ways: either by name or by address. To address the register by name, first the corresponding Bank must be selected. In
order to select the bank, we have to use the RS0 and RS1 bits of the Program Status Word (PSW) Register (RS0 and RS1 are 3rd and 4th
bits in the PSW Register).
• When addressing the Register using its address i.e., 12H for example, the corresponding Bank may or may not be selected. (12H
corresponds to R2 in Bank2). The next 16B of the RAM i.e., from 20H to 2FH are Bit – Addressable memory locations.
• There are totally 128 bits that can be addressed individually using 00H to 7FH or the entire byte can be addressed as 20H to 2FH. For
example 32H is the bit 2 of the internal RAM location 26H.
• The final 80B of the internal RAM i.e., addresses from 30H to 7FH, is the general purpose RAM area which are byte addressable. These
lower 128B of RAM can be addressed directly or indirectly.
• The upper 128B of the RAM i.e., memory addresses from 80H to FFH is allocated for Special Function Registers (SFRs). SFRs control
specific functions of the 8051 Microcontroller. Some of the SFRs are I/O Port Registers (P0, P1, P2 and P3), PSW (Program Status Word), A
(Accumulator), IE (Interrupt Enable), PCON (Power Control), etc.
• SRFs Memory addresses are only direct addressable. Even though some of the addresses between 80H and FFH are not assigned to any
SFR, they cannot be used as additional RAM area. In some microcontrollers, there is an additional 128B of RAM, which share the memory
address with SFRs i.e., 80H to FFH. But, this additional RAM block is only accessed by indirect addressing.
Dr. Vijaya Kumar H R
Associate. Professor, Dept. of ECE, AIT, Tumakuru
Dr. Vijaya Kumar H R
Associate. Professor,
Dept. of ECE, AIT,
Tumakuru
Program Memory (ROM) of 8051 Microcontroller
In 8051 Microcontroller, the code or instructions to be executed are stored in the Program Memory, which is
also called as the ROM of the Microcontroller. The original 8051 Microcontroller by Intel has 4KB of internal
ROM.
Some variants of 8051 like the 8031 and 8032 series doesn’t have any internal ROM (Program Memory) and
must be interfaced with external Program Memory with instructions loaded in it.
Almost all modern 8051 Microcontrollers, like 8052 Series, have 8KB of Internal Program Memory (ROM) in the
form of Flash Memory (ROM) and provide the option of reprogramming the memory.
In case of 4KB of Internal ROM, the address space is 0000H to 0FFFH. If the address space i.e., the program
addresses exceed this value, then the CPU will automatically fetch the code from the external Program
Memory.

Dr. Vijaya Kumar H R


Associate. Professor, Dept. of ECE, AIT, Tumakuru
Description of the Pins :
•Pin 1 to Pin 8 (Port 1) –
Pin 1 to Pin 8 are assigned to Port 1 for simple I/O operations. They
can be configured as input or output pins depending on the logic
control i.e. if logic zero (0) is applied to the I/O port it will act as an
output pin and if logic one (1) is applied the pin will act as an input
pin. These pins are also referred to as P1.0 to P1.7 (where P1
indicates that it is a pin in port 1 and the number after ‘.’ tells the pin
number i.e. 0 indicates first pin of the port. So, P1.0 means first pin of
port 1, P1.1 means second pin of the port 1 and so on). These pins
are bidirectional pins.

•Pin 9 (RST) –
Reset pin. It is an active-high, input pin. Therefore if the RST pin is
high for a minimum of 2 machine cycles, the microcontroller will reset
i.e. it will close and terminate all activities. It is often referred as
“power-on-reset” pin because it is used to reset the microcontroller
to it’s initial values when power is on (high).

Dr. Vijaya Kumar H R


Associate. Professor, Dept. of ECE, AIT, Tumakuru
•Pin 10 to Pin 17 (Port 3) –
Pin 10 to pin 17 are port 3 pins which are also referred to as P3.0 to P3.7. These pins are similar to port 1 and can be used as
universal input or output pins. These pins are bidirectional pins. These pins also have some additional functions which are as
follows:
• P3.0 (RXD) :
10th pin is RXD (serial data receive pin) which is for serial input. Through this input signal microcontroller receives data
for serial communication.
• P3.1 (TXD) :
11th pin is TXD (serial data transmit pin) which is serial output pin. Through this output signal microcontroller transmits
data for serial communication.
• P3.2 and P3.3 (INT0′, INT1′ ) :
12th and 13th pins are for External Hardware Interrupt 0 and Interrupt 1 respectively. When this interrupt is
activated(i.e. when it is low), 8051 gets interrupted in whatever it is doing and jumps to the vector value of the
interrupt (0003H for INT0 and 0013H for INT1) and starts performing Interrupt Service Routine (ISR) from that vector
location.
• P3.4 and P3.5 (T0 and T1) :
14th and 15th pin are for Timer 0 and Timer 1 external input. They can be connected with 16 bit timer/counter.
• P3.6 (WR’) :
16th pin is for external memory write i.e. writing data to the external memory.
• P3.7 (RD’) :
17th pin is for external memory read i.e. reading data from external memory.
Dr. Vijaya Kumar H R
Associate. Professor, Dept. of ECE, AIT, Tumakuru
•Pin 18 and Pin 19 (XTAL2 And XTAL1) –
These pins are connected to an external oscillator which is generally a quartz crystal oscillator. They are used to provide an external
clock frequency of 4MHz to 30MHz.

•Pin 20 (GND) –
This pin is connected to the ground. It has to be provided with 0V power supply. Hence it is connected to the negative terminal of
the power supply.

•Pin 21 to Pin 28 (Port 2) –


Pin 21 to pin 28 are port 2 pins also referred to as P2.0 to P2.7. When additional external memory is interfaced with the 8051
microcontroller, pins of port 2 act as higher-order address bytes. These pins are bidirectional.

•Pin 29 (PSEN) –
PSEN stands for Program Store Enable. It is output, active-low pin. This is used to read external memory. In 8031 based system
where external ROM holds the program code, this pin is connected to the OE pin of the ROM.
.
Dr. Vijaya Kumar H R
Associate. Professor, Dept. of ECE, AIT, Tumakuru
•Pin 30 (ALE/ PROG) –
ALE stands for Address Latch Enable. It is input, active-high pin. This pin is used to distinguish between memory
chips when multiple memory chips are used. It is also used to de-multiplex the multiplexed address and data
signals available at port 0.During flash programming i.e. Programming of EPROM, this pin acts as program pulse
input (PROG).
•Pin 31 (EA/ VPP) –
EA is active low pin and stands for External Access input. It is used to enable/disable external memory interfacing.
In 8051, EA is connected to Vcc as it comes with on-chip ROM to store programs. For other family members such
as 8031 and 8032 in which there is no on-chip ROM, the EA pin is connected to the GND
•Pin 32 to Pin 39 (Port 0) –
Pin 32 to pin 39 are port 0 pins also referred to as P0.0 to P0.7. They are bidirectional input/output pins. They
don’t have any internal pull-ups. Hence, 10 K? pull-up registers are used as external pull-ups. Port 0 is also
designated as AD0-AD7 because 8051 multiplexes address and data through port 0 to save pins.
•Pin 40 (VCC) –
This pin provides power supply voltage i.e. +5 Volts to the circuit.
8051 doesn't have internal pull-up
resistor. Generally we use external pull up
resistor on Port0 of 8051 microcontroller. We
use resistor of 10k connected to pins and
VCC. Or we use 10k resistor array to do that,
the reason is because 8051 microcontroller
doesn't have internal pull up resistor on port0
Dr. Vijaya Kumar H R
Associate. Professor, Dept. of ECE, AIT, Tumakuru
Dr. Vijaya Kumar H R
Associate. Professor, Dept. of ECE, AIT, Tumakuru
Interfacing External Memory with 8051 Microcontroller
• It is always good to have an option to expand the capabilities of a Microcontroller, whether it is in terms of
Memory or IO or anything else. Such expansion will be useful to avoid design throttling. We have seen that a
typical 8051 Microcontroller has 4KB of ROM and 128B of RAM (most modern 8051 Microcontroller variants
have 8K ROM and 256B of RAM).
• The designer of an 8051 Microcontroller based system is not limited to the internal RAM and ROM present in
the 8051 Microcontroller. There is a provision of connecting both external RAM and ROM i.e., Data Memory
and Program.
• The reason for interfacing external Program Memory or ROM is that complex programs written in high – level
languages often tend to be larger and occupy more memory.
• Another important reason is that chips like 8031 or 8032, which doesn’t have any internal ROM, have to be
interfaced with external ROM.
• A maximum of 64KB of Program Memory (ROM) and Data Memory (RAM) each can be interface with the
8051 Microcontroller.
• An important point to remember when interfacing external memory with 8051 Microcontroller is that Port 0
(P0) cannot be used as an IO Port as it will be used for multiplexed address and data bus (A0 – A7 and D0 –
D7). Not always, but Port 2 may be used as higher byte of the address bus.
• In this tutorial, we have seen the 8051 Microcontroller Memory Organization, Program Memory, Data
Memory, Internal ROM and RAM and how to interface external Memory (ROM and RAM) with 8051
Microcontroller. Dr. Vijaya Kumar H R
Associate. Professor, Dept. of ECE, AIT, Tumakuru
Dr. Vijaya Kumar H R
Associate. Professor, Dept. of ECE, AIT, Tumakuru
Dr. Vijaya Kumar H R
Associate. Professor, Dept. of
ECE, AIT, Tumakuru
• The memory types are illustrated in the following graphic. They are: On-Chip Memory, External Code Memory, and External RAM.
• On-Chip Memory refers to any memory (Code (4K), RAM(128)BYTES, or other) that physically exists on the microcontroller itself. On-chip
memory can be of several types, but we'll get into that shortly.
• External Code Memory is code (or program) memory that resides off-chip. This is often in the form of an external EPROM.
• External RAM is RAM memory that resides off-chip. This is often in the form of standard static RAM or flash RAM.

• 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. When the program is stored on-chip the 64K maximum is often
reduced to 4k, 8k, or 16k. This varies depending on the version of the chip that is being used. Each version offers specific capabilities and
one of the distinguishing factors from chip to chip is how much ROM/EPROM space the chip has. However, code memory is most
commonly implemented as off-chip EPROM. This is especially true in low-cost development systems and in systems developed by
students. Programming Tip: Since code memory is restricted to 64K, 8051 programs are limited to 64K. Some assemblers and compilers
offer ways to get around this limit when used with specially wired hardware. However, without such special compilers and hardware,
programs are limited to 64K.

• 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! What External RAM loses in speed and flexibility it gains in quantity. While Internal RAM is limited to 128 bytes (256 bytes with an
8052), the 8051 supports External RAM up to 64K
Dr. Vijaya Kumar H R
Associate. Professor, Dept. of ECE, AIT, Tumakuru
•The program fetches to addresses 0000H through
OFFFH are directed to the internal ROM in the 8051
when the EA pin is attached to Vcc, and program
fetches to addresses 1000H through FFFFH are directed
to the external ROM/EPROM. When the EA pin is
grounded, all addresses fetched by the program (0000H
to FFFFH) are led to it.. ROM/EPROM that is external to
the device.
•As seen in Fig. NEXT PAGES, the PSEN signal is used to
trigger output e external ROM/EPROM. Port 0 is used
as a multiplexed address/bus, as seen in Fig.
•In the initial T-cycle, it provides a lower order 8-bit
address, and later it is used as a data bus. The external
latch and the ALE signal provided by the 8051 are used
to latch the 8-bit address.
•Remote ROM/EPROM(Read Only Memory/Electronic
Programmable ROM/Electronic Programmable
ROM/Electronic Program The PSEN signal is used to activate
output e external ROM/EPROM.
•ort 0 is used as a multiplexed address/bus. It supplies a
Dr. Vijaya Kumar H R lower-order 8-bit address in the first T-cycle and later serves
Associate. Professor, Dept. of ECE, AIT, Tumakuru as a data bus. The 8-bit address is latched using the external
latch and the ALE signal given by the 8051.
External data memory (RAM)
• External data memory is read or write memory. Since external data memory is indirectly accessed through a
data pointer register, DPTR (which must be loaded with an address), it is a slower process compared to
accessing the internal data memory.
• Note that the additional 128 bytes of memory is interfaced with RAM by the use of RD read signal, RD = 1 (is
active) when reading bytes from the external data memory (RAM). The command used to access data from
external RAM is,

Dr. Vijaya Kumar H R


Associate. Professor, Dept. of ECE, AIT, Tumakuru
•1External Interrupt 0 is 0003H, Timer 0 is 000BH, External Interrupt 1 is 0013H, Timer 1 is 001BH, and so on. If
an interrupt is to be used, the operation routine for it must be in the same place as the interrupt. If the interrupt
isn’t used, the service location may be used as general-purpose program memory.

In this operation, it will copy the contents of the


MOVX A, @Rp
external address in Rp to A.

Copy the contents of the external address in


MOVX A. @DPTR
DPTR to A.

MOVX @Rp. A Copy data from A to the external address in Rp

MOVX DPTR, A Copy data from A to the external address in DPTR

Dr. Vijaya Kumar H R


Associate. Professor, Dept. of ECE, AIT, Tumakuru
Dr. Vijaya Kumar H R
Associate. Professor, Dept. of ECE, AIT, Tumakuru
Dr. Vijaya Kumar H R
Associate. Professor, Dept. of ECE, AIT, Tumakuru

p2
Dr. Vijaya Kumar H R
Associate. Professor, Dept. of ECE, AIT, Tumakuru
Dr. Vijaya Kumar H R
Associate. Professor, Dept. of ECE, AIT, Tumakuru
Dr. Vijaya Kumar H R
Associate. Professor, Dept. of ECE, AIT, Tumakuru
Dr. Vijaya Kumar H R
Associate. Professor, Dept. of ECE, AIT,
Tumakuru
Dr. Vijaya Kumar H R
Associate. Professor, Dept. of ECE, AIT, Tumakuru
Dr. Vijaya Kumar H R
Associate. Professor, Dept. of ECE, AIT, Tumakuru
Dr. Vijaya Kumar H R
Associate. Professor, Dept. of ECE, AIT, Tumakuru
END OF MODULE 1

You might also like