Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 16

AMBEDKAR INSTITUTE OF

TECHNOLOGY

INTRODUCTION TO MICROPROCESSORS
ASSIGNMENT
SUBMITTED BY: AYUSH
SUBMITTED TO: SHYAM BAMBIWAL
ROLL NO: 1802071013
BRANCH: DIGITAL ELECTRONICS
SEMESTER/YEAR: IVth SEM/IInd YEAR
INTRODUCTION TO MICROPROCESSOR
ASSIGNMENT
1. Compare memory mapped IO and IO mapped IO.

Q2 Draw a neat block diagram of 8255 and explain its working in


detail.
Answer: Figure shows the internal block diagram of 8255A. It
consists of data bus buffer, control logic and Group A and Group B
controls.
1.Data Bus Buffer: This tri-state bi-directional buffer is used to
interface the internal data lilts of 8255 to the system data bus.
Input or Output instructions executed by the CPU either Read
date from or Write data into the buffer. Output data from the CPU
to the ports or control register, and input data to the CPU from
the ports or status register are all passed through the buffer.

2.Control Logic: The control logic block accepts control bus signals as
well as inputs from the address bus, and issues commands to the
individual group control blocks (Group A control and Group B control).
It issues appropriate enabling signals to access the required
data/control words or status word. The input pins for the control logic
section are described here.

3,Group A and Group B Controls: Each of the Group A and Group B


control blocks receives control words from the CPU and issues
appropriate commands to the ports associated with it. The Group A
control block controls Port A and PC_7-PC_4 while the Group B control
block controls Port B and PC_3-PC_0.

4,Port A: This has an 8-bit latched and buffered output and an 8-bit
input latch. It can be programmed in three modes: mode 0, mode 1 and
mode 2.

5.Port B: This has an 8-bit data I/O latch/ buffer and an 8-bit data input
buffer. It can be programmed in mode 0 and mode 1.

6.Port C: This has one 8-bit unlatched input buffer and an 8-bit output
latch/buffer. Port C can be spitted into two parts and each can be used
as control signals for ports A and B in the handshake mode. It can be
programmed for bit set/reset operation.

Q3. Write short notes on address decoding with suitable examples.

Address Decoding

  Address decoding refers to the way a computer system decodes the


addresses on the address bus to select memory locations in one or
more memory or peripheral devices. The 68000's 23-bit address bus
permits 223 16-bit words to be uniquely addressed.

In full address decoding, each addressable memory location


corresponds to a unique address value on the address bus. Figure
shows an example of two memory devices configured using full address
decoding. Memory M1 is selected whenever A12- A23=000000000000,
while M2 is selected whenever A12- A23=100000000000.

  
Figure: Full address decoding of
two memory devices.
In partial address decoding, not all address lines in the address bus are
used in the decoding process. Figure shows two memory devices
configured using partial decoding, where A23 is used to distinguish
between the two. In this example, M1 and M2 are repeated 2,048
times through the memory space. When A23=0, M1 is selected;
when A23=1, M2 is selected.

Figure: Partial address decoding of


two memory devices.
Q4. What are the different types of data transfer scheme used in 8085.

Answer: At the time of executing one 8085 program, interruption can


be done in the mid-way by the virtue of the program by an Input
Output device. Interruption can be done by the method according to
which the processor works, since it wants urgent communication with
the processor. The data transfer schemes always want for sending
information to the processor, rather receiving information from the
8085 processor. It is so because sending and receiving information in
the entire 8085 data transfer scheme process plays a vital role for
executing the entire program rather process. The communication is not
done directly with the Input Output device. The communication
processes are carried out systematically by the help of Input Output
device by the virtue of an Input Output port. The data transfer can be
either in two forms namely parallel or serial respectively. By the virtue
of the Programmed Input Access or rather transferring data in parallel
the data transfer can be possible by using the Input Output
programmed part or by Direct Memory Access (DMA) scheme. For
transferring data in parallel we have three different ways by means of
which microprocessor communicates with an Input or Output. They
are:
 Basic or simple data transfer scheme: The simplest data transfer
scheme is the basic or simple data transfer. This method is
beneficial to us when we have accurate know-ledge of the Input
Output device timing characteristics.
 Status check data transfer: Status check data transfer process is a
much more complex process than simple data transfer. We use
this method is used when there is lack of accurate knowledge of
the Input Output device consisting of the timing characteristics.
Status information is received by the processor regarding the
readiness of the Input Output device for performing the data
transfer.
 Interrupt driven data transfer: We use this method when there
lacks accurate knowledge of the timing characteristics of the Input
Output device which takes maximum time for the device to be
ready for use. Suppose we resort for the checking of data transfer;
the processor here wastes a huge time in the loop for the device
to get ready up to the mark.

 
5. Explain the working of RIM and SIM instruction in detail.

In 8085 Instruction set, SIM (Set Interrupt Mask) and RIM (Read


Interrupt Mask) instructions can perform mask and unmask RST7.5,
RST6.5, and RST5.5 interrupt pins and can also read their status. 

In 8085 Instruction set, SIM stands for “Set Interrupt Mask”. It is 1-Byte


instruction and it is a multi-purpose instruction. The main uses
of SIM instruction are –
 Masking/unmasking of RST7.5, RST6.5, and RST5.5
 Reset to 0 RST7.5 flip-flop
 Perform serial output of data.

Mnemonics, Operand Opcode (in HEX)

SIM 30

When SIM instruction is executed then the content of the Accumulator


decides the action to be taken. So before executing the SIM instruction,
it is mandatory to initialize Accumulator with the required value. The
meaning and purpose of the various bits of the accumulator when SIM
is executed has been depicted below – 

Note that except bit 5, which is a don't care bit, the other bits of the
Accumulator decide the effect of executing the SIM instruction.
Masking of interrupts: Only the LS 4 bits of the accumulator are used
for masking or unmasking of interrupts.
In 8085 Instruction set, RIM stands for “Read Interrupt Mask”. It is a 1-
Byte multi-purpose instruction. It is used for the following purposes.
 To check whether RST7.5, RST6.5, and RST5.5 are masked or not;
 To check whether interrupts are enabled or not;
 To check whether RST7.5, RST6.5, or RST5.5 interrupts are
pending or not;
 To perform serial input of data.

Mnemonics, Operand Opcode(in HEX)

RIM 20

To get the status information about the interrupt system, RIM


instruction provides status information about interrupt system and this
instruction can be used for serial input of data. Through this RIM
instruction, 8085 can know which interrupt is masked or unmasked,
etc. The contents of the Accumulator after the execution of the RIM
instruction provide this information.
Thus, it is essential to look into the Accumulator contents after the RIM
instruction is executed. The meaning of the various bits of the
Accumulator after RIM is executed is shown in the following figure –
Mask status of interrupts: The LS 3 bits of the accumulator are used to
provide mask status of interrupts. Note that they are not used for
masking or unmasking. Masking or unmasking has to be done using sim
instruction.
Q6. What is interrupt? What are its types?
Answer: Interrupt is signals send by an external device to the processor,
to request the processor to perform a particular task or work.
 
Mainly in the microprocessor based system the interrupts are used
for data transfer between the peripheral and the microprocessor.
 The processor will check the interrupts always at the 2nd T-state of
last machine cycle.
 If there is any interrupt it accept the interrupt and send the INTA
(active low) signal to the peripheral.
 The vectored address of particular interrupt is stored in program
counter.
 The processor executes an interrupt service routine (ISR)
addressed in program counter.
 It returned to main program by RET instruction.
 
Types of Interrupts:
 
It supports two types of interrupts.
 
 Hardware
 Software
 
1. Software interrupts:
 
The software interrupts are program instructions. These
instructions are inserted at desired locations in a program. The 8085
has eight software interrupts from RST 0 to RST 7. The vector address
for these interrupts can be calculated as follows.
 
 Interrupt number * 8 = vector address
 For RST 5,5 *  8 = 40 = 28H
 Vector address for interrupt RST 5 is 0028H
 
Vector addresses of all interrupts.
 
2 Hardware interrupts:
 
An external device initiates the hardware interrupts and placing an
appropriate signal at the interrupt pin of the processor. If the interrupt
is accepted then the processor executes an interrupt service routine.
SIM and RIM for interrupts:
 
 The 8085 provide additional masking facility for RST 7.5, RST 6.5
and RST 5.5 using SIM instruction.
 The status of these interrupts can be read by executing RIM
instruction.
 
 The masking or unmasking of RST 7.5, RST 6.5 and RST 5.5
interrupts can be performed by moving an 8-bit data to
accumulator and then executing SIM instruction.
 
 The status of pending interrupts can be read from accumulator
after executing RIM instruction.
 When RIM instruction is executed an 8-bit data is loaded in
accumulator, which can be interpreted as shown in fig.
 

Q7. What is software interrupt and hardware interrupt?

When microprocessor receives any interrupt signal from peripheral(s)


which are requesting its services, it stops its current execution and
program control is transferred to a sub-routine by
generating CALL signal and after executing sub-routine by
generating RET signal again program control is transferred to main
program from where it had stopped.
When microprocessor receives interrupt signals, it sends an
acknowledgement (INTA) to the peripheral which is requesting for its
service.
Interrupts can be classified into various categories based on different
parameters:

Hardware and Software Interrupts –


When microprocessors receive interrupt signals through pins
(hardware) of microprocessor, they are known as Hardware Interrupts.
There are 5 Hardware Interrupts in 8085 microprocessor. They are
– INTR, RST 7.5, RST 6.5, RST 5.5, TRAP

Software Interrupts are those which are inserted in between the


program which means these are mnemonics of microprocessor. There
are 8 software interrupts in 8085 microprocessor. They are – RST 0, RST
1, RST 2, RST 3, RST 4, RST 5, RST 6, RST 7.

Q8.What is meant by a microcontroller?

A microcontroller is a computer present in a single integrated circuit


which is dedicated to perform one task and execute one specific
application.
It contains memory, programmable input/output peripherals as well a
processor. Microcontrollers are mostly designed for embedded
applications and are heavily used in automatically controlled electronic
devices such as cell phones, cameras, microwave ovens, washing
machines, etc.
Q9. Compare microprocessor and microcontroller.
1. Key difference in both of them is presence of external peripheral,
where microcontrollers have RAM, ROM, EEPROM embedded in it
while we have to use external circuits in case of microprocessors.
2. As all the peripheral of microcontroller are on single chip it is
compact while microprocessor is bulky.
3. Microcontrollers are made by using complementary metal oxide
semiconductor technology so they are far cheaper than
microprocessors. In addition the applications made with
microcontrollers are cheaper because they need lesser external
components, while the overall cost of systems made with
microprocessors are high because of the high number of external
components required for such systems.
4. Processing speed of microcontrollers is about 8 MHz to 50 MHz, but
in contrary processing speed of general microprocessors is above 1 GHz
so it works much faster than microcontrollers.
5. Generally microcontrollers have power saving system, like idle mode
or power saving mode so overall it uses less power and also since
external components are low overall consumption of power is less.
While in microprocessors generally there is no power saving system
and also many external components are used with it, so its power
consumption is high in comparison with microcontrollers.
6. Microcontrollers are compact so it makes them favorable and
efficient system for small products and applications while
microprocessors are bulky so they are preferred for larger applications.
7. Tasks performed by microcontrollers are limited and generally less
complex. While task performed by microprocessors are software
development, Game development, website, documents making etc.
which are generally more complex so require more memory and speed
so that’s why external ROM, RAM are used with it.
8. Microcontrollers are based on Harvard architecture where program
memory and data memory are separate while microprocessors are
based on von Neumann model where program and data are stored in
same memory module.
Q10 Describe the architecture of 8051 with neat diagram.
8051 microcontroller is designed by Intel in 1981. It is an 8-bit
microcontroller. It is built with 40 pins DIP (dual inline package), 4kb of
ROM storage and 128 bytes of RAM storage, 2 16-bit timers. It consists
of are four parallel 8-bit ports, which are programmable as well as
addressable as per the requirement. An on-chip crystal oscillator is
integrated in the microcontroller having crystal frequency of 12 MHz.
Let us now discuss the architecture of 8051 Microcontroller.
In the following diagram, the system bus connects all the support
devices to the CPU. The system bus consists of an 8-bit data bus, a 16-
bit address bus and bus control signals. All other devices like program
memory, ports, data memory, serial interface, interrupt control,
timers, and the CPU are all interfaced together through the system
bus.

You might also like