0% found this document useful (0 votes)
49 views

Important Questions 8051

The document discusses the 8051 microcontroller architecture. It explains that the 8051 has an 8-bit architecture with Harvard architecture and RISC concepts. It then describes the various components of 8051 including the ALU, registers, memory organization, timers, ports and addressing modes.

Uploaded by

Hitesh Mohanty
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)
49 views

Important Questions 8051

The document discusses the 8051 microcontroller architecture. It explains that the 8051 has an 8-bit architecture with Harvard architecture and RISC concepts. It then describes the various components of 8051 including the ALU, registers, memory organization, timers, ports and addressing modes.

Uploaded by

Hitesh Mohanty
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/ 14

Q1 EXPLAIN 8051 Architecture?

8051 architecture is shown below

It has Harward architecture with RISC (Reduced Instruction Set Computer) concept. The block
diagram of 8051 microcontroller is shown in Fig 3. below1.It consists of an 8-bit ALU, one 8- bit
PSW(Program Status Register), A and B registers , one 16-bit Program counter , one 16-bit
Data pointer register(DPTR),128 bytes of RAM and 4kB of ROM and four parallel I/O ports each
of 8-bit width

8051 has 8-bit ALU which can perform all the 8-bit arithmetic and logical operations in one
machine cycle. The ALU is associated with two registers A & B.1.The A register is also called
the Accumulator
The R registers: The "R" registers are a set of eight registers that are named R0, R1, etc. up to
and including R7. These registers are used as auxillary registers in many operations
Program Counter(PC) : 8051 has a 16-bit program counter .The program counter always points
to the address of the next instruction to be executed

Stack Pointer Register (SP) : It is an 8-bit register which stores the address of the stack top. i.e
the Stack Pointer is used to indicate where the next value to be removed from the stack
STACK in 8051 Microcontroller : The stack is a part of RAM used by the CPU to store
information temporarily. This information may be either data or an address

Data Pointer Register(DPTR) : It is a 16-bit register which is the only user-accessible. DPTR, as
the name suggests, is used to point to data.

Program Status Register (PSW) : The 8051 has a 8-bit PSW register which is alsoknown as
Flag register

Q2 EXPLAIN MEMORY ORGANISATION IN 8051?

The 8051 microcontroller has 128 bytes of Internal RAM and 4kB of on chip ROM .The RAM is
also known as Data memory and the ROM is known as program memory.

Internal RAM OF 8051 : This Internal RAM is found on-chip on the 8051 .So it is the fastest
RAM available, and it is also the most flexible in terms of reading, writing, and modifying it’s
contents. Internal RAM is volatile, so when the 8051 is reset this memory is cleared. The 128
bytes of internal RAM is organized as below. (i) Four register banks (Bank0,Bank1, Bank2 and
Bank3) each of 8-bits (total 32 bytes). The default bank register is Bank0. The remaining Banks
are selected with the help of RS0 and RS1 bits of PSW Register. (ii) 16 bytes of bit addressable
area and (iii) 80 bytes of general purpose area (Scratch pad memory) as shown in the diagram
The 32 bytes of RAM from address 00 H to 1FH are used as working registers organized as four
banks of eight registers each.The registers are named as R0-R7 .Each register can be
addressed by its name or by its RAM address.

Internal ROM (On –chip ROM): The 8051 microcontroller has 4kB of on chip ROM but it can be
extended up to 64kB.

Q3 EXPLAIN Special function registers for 8051

In 8051 microcontroller there certain registers which uses the RAM addresses from 80h to FFh
and they are meant for certain specific operations .These registers are called Special function
registers (SFRs).Some of these registers are bit addressable also. The list of SFRs and their
functional names are given below. In these SFRs some of them are related to I/O ports
(P0,P1,P2 and P3) and some of them are meant for control operations (TCON,SCON, PCON..)
and remaining are the auxillary SFRs, in the sense that they don't directly configure the 8051.

(write few of these)


Q EXPLAIN PARALLEL I/O Ports in 8051???
The 8051 microcontroller has four parallel I/O ports , each of 8-bits .So, it
provides the user 32 I/O lines for connecting the microcontroller to the
peripherals. The four ports are P0 (Port 0), P1(Port1) ,P2(Port 2) and P3 (Port3).
Upon reset all the ports are output ports. In order to make them input, all the
ports must be set i.e a high bit must be sent to all the port pins.

PORT 0: Port 0 is an 8-bit I/O port with dual purpose. If external memory is used,
these port pins are used for the lower address byte address/data (AD0-AD7),
otherwise all bits of the port are either input or output.Port 0 can also be used as
address/data bus(AD0-AD7), allowing it to be used for both address and data

Port 1: Port 1 occupies a total of 8 pins (pins 1 through 8). It has no dual
application and acts only as input or output port. In contrast to port 0, this port
does not need any pull-up resistors since pull-up resistors connected internally

Port 2 : Port 2 is also an eight bit parallel port. (pins 21- 28). It can be used as
input or output port. As this port is provided with internal pull-up resistors it does
not need any external pull-up resistors. Upon reset, Port 2 is configured as an
output port.

Dual role of port 2 : Port2 lines are also associated with the higher order address lines
A8-A15. In systems based on the 8751, 8951, and DS5000, Port2 is used as simple I/O
port.. But, in 8031- based systems, port 2 is used along with P0 to provide the 16-bit
address for the external memory.

PORT 3 : Port3 is also an 8-bit parallel port with dual function.( pins 10 to 17). The port
pins can be used for I/O operations as well as for control operations. The details of
these additional operations are given below in the table. Port 3 also do not need any
external pull-up resistors as they are provided internally similar to the case of Port2 &
Port 1. Upon reset port 3 is configured as an output port

Alternate Functions of Port 3 : P3.0 and P3.1 are used for the RxD (Receive Data) and
TxD (Transmit Data) serial communications signals.
Explain timers in microcontroller?

The 8051 microcontroller has two 16-bit timers Timer 0 (T0) and Timer 1(T1)
which can be used either to generate accurate time delays or as event counters.
These timers are accessed as two 8-bit registers TLO, THO & TL1 ,TH1 because
the 8051 microcontroller has 8-bit architecture.

TIMER 0 : The Timer 0 is a 16-bit register and can be treated as two 8-bit
registers (TL0 & TH0) and these registers can be accessed similar to any other
registers like A,B or R1,R2,R3
M1,M0 (Mode) : These two bits are the timer mode bits. The timers of the 8051
can be configured in three modes.Mode0, Mode1 and Mode2.

Q . Pin diagram of 8051?

The 8051 microcontroller is available as a 40 pin DIP chip and it works


at +5 volts DC. Among the 40 pins , a total of 32 pins are allotted for
the four parallel ports P0,P1,P2 and P3 i.e each port occupies 8-pins
.The remaining pins are VCC, GND, XTAL1, XTAL2, RST, EA ,PSEN.
RST: The RESET pin is an input pin and it is an active high pin. When
a high pulse is applied to this pin the microcontroller will reset and
terminate all activities

ALE (Address latch enable): This is an output pin, which is active high.
When connected to external memory , port 0 provides both address
and data i.e address and data are multiplexed through port 0

P0.0- P0.7(AD0-AD7) : The port 0 pins multiplexed with Address/data


pins

P2.0- P2.7(A8-A15) : The port2 pins are multiplexed with the higher
order address pins

P1.0- P1.7 :These 8-pins are dedicated for Port1 to perform input or
output port operations.

P3.0- P3.7 :These 8-pins are meant for Port3 operations and also for
some control operations like Read,Write,Timer0,Timer1 ,INT0,INT1
,RxD and TxD

Q Addressing modes Of 8051?

The 8051 microcontroller supports mainly 5 addressing modes. They


are 1.Immediate addressing mode 2.Direct Addressing mode
3.Register addressing mode 4. Register Indirect addressing mode
5.Indexed addressing mode
Immediate addressing mode : The addressing mode in which the data
operand is a constant and it is a part of the instruction itself is known
as Immediate addressing mode.
EX: MOV A , # 27 H

Direct addressing mode: The addressing mode in which the data


operand is in the RAM location (00 -7FH) and the address of the data
operand is given in the instruction is known as Direct addressing
mode

MOV R1, 42H

Register addressing mode :The addressing mode in which the data


operand to be manipulated lies in one of the registers is known as
register addressing mode

MOV A,R0 : Move the contents of the register R0 to the accumulator

Register Indirect addressing mode :The addressing mode in which a


register is used as a pointer to the data memory block is known as
Register indirect addressing mode

MOV A,@ R0 :Move the contents of RAM location whose address is in


R0 into A (accumulator)

Indexed addressing mode : This addressing mode is used in


accessing the data elements of lookup table entries located in
program ROM space of 8051 Ex : MOVC A,@ A+DPTR
QUESTION : Interface analog to digital converter to 8051, also
write assembly language for it : [NOTE THIS IS ANALOG TO
DIGITAL NOT DIGITAL TO ANALOG]

From the circuit it is clear that the ADC interfaced directly to the
microcontroller. The Port1 is used as an input port which receives the
digital data from the ADC.Port pins P2.5 and P2.6 are used for SOC
and EOC operation.When the conversion is over the ADC will send an
interrupt signal to the microcontroller through the pin P2.7 .Now the
Microcontroller receives digital data through the Port1.This data after
conversion to decimal data is displayed on the LCD module .
The assembly language program for ADC is given below
. MOV P1 , 0FF H ; Make the port1 high and configure port1 as Input
port
BACK: CLR P2.6 ; Generation of SOC pulse
SETB P2.5 ; LOOP JB P2.7 , LOOP ; Wait for conversion, Is
conversion over?
CLR P2.5 ; Enable Read the digital data.
MOV A ,P1 ; Read digital data through Port1
SETB P2.5 ; Disable read after read operation
CALL DISPLAY ; Display the data on LCD module
SJMP BACK ; Continue the conversion process

Q .INTERFACING 8051 WITH EXTERNAL MEMORY?(PREV YR


QUESTION)

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.
Q .8051 relay interfacing?

USED : TRANSISTOR AS A HELP

Transistor is wired as a switch. which drives the relay. The transistor will be in
OFF state when the when the pin P2.0 is in LOW state. When 1 is written to P2.0
current will flow to the base of the transistor and the relay energises.

Q. Interfacing 8051 with Digital to analog converter?

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy