MPMC20EC5T01
MPMC20EC5T01
Features: It is a 16-bit μp, 8086 has a 20 bit address bus can access up to 2^20=1MB memory
locations (1 MB), It can support up to 64K I/O ports, It provides fourteen 16 -bit registers, It has
multiplexed address and data bus AD0- AD15 and A16 – A19, It requires single phase clock
with 33% duty cycle to provide internal timing,8086 is designed to operate in two modes,
Minimum and Maximum, It can prefetch up to 6 instruction bytes from memory and queues
them in order to speed up instruction execution. It requires +5V power supply,A 40 pin dual in
line package It is available in 3 versions based on the frequency of operation −
o 8086 → 5MHz
o 8086-2 → 8MHz
o (c)8086-1 → 10 MHz
Minimum and Maximum Modes:
The minimum mode is selected by applying logic 1 to the MN / MX input pin. This is a single
microprocessor configuration. The maximum mode is selected by applying logic 0 to the MN /
MX input pin. This is a multi micro processors configuration.8086 does not have a RAM or
ROM inside it. However, it has internal registers for storing intermediate and final results and
interfaces with memory located outside it through the System Bus. 2 Marks
Relevant Explanation about Registers, Pipelinig, Segmnetation, Bus Interface unit, Execution
Unit, Physical address calculation etc., 1 Marks
1 b. 8085 Pin Description
PIN Diagram 4 Marks
Explanation 3 Marks
Maximum mode Configuration: In this we can connect more processors to 8086 (8087/8089).
8086 max mode is basically for implementation of allocation of global resources and passing bus
control to other coprocessor (i.e. second processor in the system), because two processors cannot
access system bus at same instant. All processors execute their own program.
When MN/ MX’ = 0 , 8086 works in max mode. Clock is provided by 8284 clock generator.
8288 bus controller- Address form the address bus is latched into 8282 8-bit latch. Three such
latches are required because address bus is 20 bit.
The ALE (Address latch enable) is connected to STB (Strobe) of the latch. The ALE for latch is
given by 8288 bus controller.
The data bus is operated through 8286 8-bit transceiver. Two such transceivers are required,
because data bus is 16-bit. The transceivers are enabled the DEN signal, while the direction of
data is controlled by the DT/R signal. DEN is connected to OE’ and DT/ R’ is connected to T.
Both DEN and DT/ R’ are given by 8288 bus controller.
Control signals for all operations are generated by decoding S’2, S’1 and S’0 using 8288 bus
controller.
Bus request is done using RQ’ / GT’ lines interfaced with 8086. RQ0/GT0 has more
priority than RQ1/GT1.
INTA’ is given by 8288, in response to an interrupt on INTR line of 8086.
In max mode, the advanced write signals get enabled one T-state in advance as
compared to normal write signals. This gives slower devices more time to get ready to
accept the data; therefore it reduces the number of cycles.
It derives the outputs ALE, DEN*, DT/R*, MWTC*, AMWC*, IORC*, IOWC* and
AIOWC*.
IORC*, IOWC* are I/O read command and I/O write command signals respectively.
INTA* pin is used to issue two interrupt acknowledge pulses to the interrupt controller
or to an interrupting device.
2 b.
Register Organization Names 4 Marks
Explanation 3 Marks
General-purpose registers are used to store temporary data within the microprocessor. There are
8 general-purpose registers in the 8086 microprocessor.
AX: This is the accumulator. It is of 16 bits and is divided into two 8-bit registers AH and AL to
also perform 8-bit instructions. It is generally used for arithmetical and logical instructions but in
8086 microprocessor it is not mandatory to have an accumulator as the destination operand.
BX: This is the base register. It is of 16 bits and is divided into two 8-bit registers BH and BL to
also perform 8-bit instructions. It is used to store the value of the offset.
CX: This is the counter register. It is of 16 bits and is divided into two 8-bit registers CH and CL
to also perform 8-bit instructions. It is used in looping and rotation.
DX: This is the data register. It is of 16 bits and is divided into two 8-bit registers DH and DL to
also perform 8-bit instructions. It is used in the multiplication and input/output port addressing.
SP: This is the stack pointer. It is of 16 bits. It points to the topmost item of the stack. If the stack
is empty the stack pointer will be (FFFE)H. Its offset address is relative to the stack segment.
BP – This is the base pointer. It is of 16 bits. It is primarily used in accessing parameters passed
by the stack. Its offset address is relative to the stack segment.
SI – This is the source index register. It is of 16 bits. It is used in the pointer addressing of data
and as a source in some string-related operations. Its offset is relative to the data segment.
DI – This is the destination index register. It is of 16 bits. It is used in the pointer addressing of
data and as a destination in some string-related operations. Its offset is relative to the extra
segment
3 a. ASSEMBLER DIRECTIVES
Assembler Directives list 4 Marks
Explanation of any 3-3 Marks
Assembler directives are the Instructions to the Assembler, linker and loader regarding the
program being executed are also called ‘pseudo instructions. Control the generation of machine
codes and organization of the program; but no machine codes are generated for assembler
directives.
They are used to
› specify the start and end of a program
› attach value to variables
› allocate storage locations to input/ output data
› define start and end of segments, procedures, macros etc..
ASSUME
Used to tell the assembler the name of the logical segment it should use for a specified segment.
You must tell the assembler that what to assume for any segment you use in the program.
Example
ASSUME: CODE
Tells the assembler that the instructions for the program are in segment named CODE.
DB – Defined Byte
Used to declare a byte type variable or to set aside one or more locations of type byte in memory.
Example
PRICES DB 49H, 98H, 29H:
Declare array of 3 bytes named PRICES and initialize 3 bytes as shown.
DD – Define Double Word
Used to declare a variable of type double word or to reserve a memory location which can be
accessed as double word.
DQ – Define Quadword
Used to tell the assembler to declare the variable as 4 words of storage in memory.
DT – Define Ten Bytes
Used to tell the assembler to declare the variable which is 10 bytes in length or reserve 10 bytes
of storage in memory.
DW – Define Word
Used to tell the assembler to define a variable type as word or reserve word in memory.
DUP: used to initialize several locations and to assign values to location
END – End the Program
To tell the assembler to stop fetching the instruction and end the program execution.
ENDP – it is used to end the procedure.
ENDS – used to end the segment.
EQU – EQUATE
Used to give name to some value or symbol.
EVEN – Align On Even Memory Address
Tells the assembler to increment the location counter to the next even address if it is not already
at an even address.
EXTRN
Used to tell the assembler that the name or labels following the directive are in some other
assembly module.
INCLUDE – include source code from file
Used to tell the assembler to insert a block of source code from the named file into the current
source module. This shortens the source code.
LABEL
Used to give the name to the current value in the location counter. The LABEL directive must be
followed by a term which specifies the type you want associated with that name.
LENGTH
Used to determine the number of items in some data such as string or array.
NAME
Used to give a specific name to a module when the programs consisting of several modules.
OFFSET
It is an operator which tells the assembler to determine the offset or displacement of named data
item or procedure from the start of the segment which contains it.
It stands for Chip Select. A LOW on this input selects the chip and enables the communication
between the 8255A and the CPU. It is connected to the decoded address, and A0 & A1 are
connected to the microprocessor address lines. Their result depends on the above conditions −
These input signals work with RD, WR, and one of the control signal.
DMA stands for Direct Memory Access. It is designed by Intel to transfer data at the fastest rate.
It allows the device to transfer the data directly to/from memory without any interference of the
CPU.Using a DMA controller, the device requests the CPU to hold its data, address and control
bus, so the device is free to transfer data directly to/from the memory. The DMA data transfer is
initiated only after receiving HLDA signal from the CPU.
Following is the sequence of operations performed by a DMA −
Initially, when any device has to send data between the device and the memory, the
device has to send DMA request (DRQ) to DMA controller.
The DMA controller sends Hold request (HRQ) to the CPU and waits for the CPU to
assert the HLDA.
Then the microprocessor tri-states all the data bus, address bus, and control bus. The CPU
leaves the control over bus and acknowledges the HOLD request through HLDA signal.
Now the CPU is in HOLD state and the DMA controller has to manage the operations
over buses between the CPU, memory, and I/O devices.
SOC-Start of Conversion
EOC-End of Conversion
Signals in the real world are analog: light, sound, temperature, pressure, acceleration or other
phenomenon. So, real-world signals must be converted into digital, using a circuit called ADC
(Analog-to-Digital Converter), before they can be manipulated by digital equipment.
The time taken by the ADC from the active edge of SOC pulse till the active edge of EOC signal
is called as the conversion delay of the ADC.
General algorithm for ADC interfacing contains the following steps
1. Ensure the stability of analog input, applied to the ADC
2. Issue start of conversion SOC pulse to ADC
3. Read end of conversion EOC signal to mark the end of conversion process
4. Read digital data output of the ADC as equivalent digital output.
The analog to digital converter chips 0808 and 0809 are 8- bit CMOS, successive approximation
converters. It is fastest technique. The conversion delay is 100 µs at a clock frequency of 640
kHz, which is quite low as compared to other converters. This converter internally has a 3:8
analog multiplexer, so that at a time 8 different analog inputs can be connected to the chips. Out
of these 8 inputs only one can be selected for conversion by using 3 address lines A, B, C. The
CPU may drive these lines using output port lines in case of multichannel applications.
An IRET instruction at the end of the interrupt service procedure returns execution to the main
program.
Interrupt Vector Table 8086:
The 8086 gets the new values of CS and IP register from four memory addresses. When it
responds to an interrupt, the 8686 goes to memory locations to get the CS and IP values for the
start of the interrupt service routine. In an Interrupt Structure of 8086 system the first 1 Kbyte of
memory from 00000H to 003FFH is reserved for storing the starting addresses of interrupt
service routines. This block of memory is often called the Interrupt Vector Table in 8086 or
the interrupt pointer table. Since 4 bytes are required to store the CS and IP values for each
interrupt service procedure, the table can hold the starting addresses for 256 interrupt service
routines. Fig. 9.2 shows how the 256 interrupt pointers are arranged in the memory table.
Each interrupt type is given a number between 0 to 255 and the address of each interrupt js
found by multiplying the type by 4 e.g. for type 11, interrupt address is 11 x 4 = 4410= 0002CH
Only first five types have explicit definitions such as divide by zero and non maskable interrupt.
The next 27 interrupt types, from 5 to 31, are reserved by Intel for use in future microprocessors.
The upper 224 interrupt types, from 32 to 255, are available for user for hardware or software
interrupts.
7 a.
Definition 2 Marks
Features 3Marks
5 Interrupt sources 2 Marks
Microcontroller is a semiconductor IC that itself contains microprocessor, ports, timers,
counters, memory etc., on the same IC
Features
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
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.it having four register banks,64K bytes on-chip programmable memory
(ROM),128 user defined flags,16 bit timers,32 general purpose registers each of 8-bit 8051
microcontroller offers a number of special features such as ADC, UARTs, Op-amp, etc.
Interrupts are the events that temporarily suspend the main program, pass the control to the
external sources and execute their task. It then passes the control to the main program where it
had left off.8051 has 5 interrupt signals, i.e. INT0, TFO, INT1, TF1, RI/TI. Each interrupt can
be enabled or disabled by setting bits of the IE register and the whole interrupt system can be
disabled by clearing the EA bit of the same register.
Access to external memory is slower than access to internal data memory. There may be up to
64K Bytes of external data memory. Several 8051 devices provide on-chip XRAM space that is
accessed with the same instructions as the traditional external data space. This XRAM space is
typically enabled via proper setting of SFR register and overlaps the external memory space.
Setting of that register must be manually done in code, before any access to external memory or
XRAM space is made.
8 b.
Calculations, Directives, Instructions, program flow 4 Marks
ALP 3 Marks
To toggle all the bits of port 1 for every 200ms, we need to use a timer interrupt to generate an
interrupt every 200ms. In the interrupt service routine (ISR), we can toggle all the bits of port 1.
Here are the calculations needed:
1. Crystal frequency: 11.0592MHz
2. Machine cycle frequency: Crystal frequency/12 = 921.6kHz
3. Timer 0 mode: 16-bit timer mode
4. Timer 0 initial value: 65536 - (200ms * Machine cycle frequency) = 65536 - (200ms *
921.6kHz) = 65536 - 184320 = 47016 (decimal)
5. Timer 0 reload value: Same as initial value (47016 decimal)
6. Timer 0 interrupt frequency: Machine cycle frequency / Timer 0 reload value = 921.6kHz
/ 47016 = 19.6Hz
Org 0h; Set the origin to 00H
Mov P1,#00H;Initialize port 1 to 0
Mov Tmod,#01H;set timer0 to 16 bit mode
Mov TH0, Highbyte (47016) set timer0 to high value;
Mov TL0, lowerbyte (47016) set timer0 to high value;
SetB TR0; start Timer0
SetB EA; Enable global Interrupts Main
SJMP Main; loop timer0 forever Timer0_ISR
CPL P1; Toggle all bits of port1
RETI; Return from Interrupt
Steps to follow
1. Start
2. Select the channel using Address pins.
3. A Low – High transition on ALE to latch in the address.
4. A Low – High transition on Start to reset the ADC’s SAR.
5. A High – Low transition on ALE.
6. A High – Low transition on start to start the conversion.
7. Wait for End of cycle (EOC) pin to become high.
8. Make Output Enable pin High.
9. Take Data from the ADC’s output
10. Make Output Enable pin Low.
11. Stop
9 b. Programming the 8051 to receive data serially
Steps and Relevant Explanation 7 marks
In programming the 8051 to receive character bytes serially, the following steps must be taken.
1. The TMOD register is loaded with the value 20H, indicating the use of Timer 1 in mode2 to
set the baud rate.
2. TH1 is loaded with one of the values in Table(2) to set the baud rate.
3. The SCON register is loaded with the value 50H, indicating serial mode 1, where 8-bit data is
framed with start and stop bits and receive enable is turned on.
4. TR1 is set to 1 to start Timer 1.
5. RI is cleared with the “CLR RI” instruction.
6. The RI flag bit is monitored with the use of the instruction “JNB RI, xx” to see if an entire
character has been received yet.
7. When RI is raised, SBUF has the byte. Its contents are moved into safe place.
8. To receive the next character, go to Step 5.
10 a.
TCON Register format 3 Marks
SCON Register Format 3 Marks
Explanation 1 Mark
TCON (Timer Control register) TCON is an 8-bit register. Its bits are used for generating
interrupts internal or external. The most important bits of the timer TR and TF are also in it.
TR (timer run) and TF (timer overflow) bits which we use in almost all over timer applications
are in it.
TF1 Timer 1 Overflow flag. Set when timer overflows. Clear by software
TR1 set to enable Timer 1
TF0 Timer 0 Overflow flag. Set when timer overflows. Clear by software
TR0 Set to enable Timer 0
IEI Interrupt flag for interrupt 1
ITI Set for negative edge trigger for interrupt 1, clear for level trigger
IE0 Interrupt flag for interrupt 0
IT0 Set for negative edge trigger for interrupt 0, clear for level trigger
SCON (Serial Control) it’s an 8 bit register, Used for serial data communication. It is bit
addressable.
SM0, SM1 and SM2 are used to specify the serial connection mode. There are five different
modes four are shown above in the diagram. The fifth one is when we make SM2=1 which is 8-
bit transfer mode. The most common mode is mode 1.
REN is Receive Enable, when REN=1 it allows the 8051 to receive and transfer data . If you
want 8051 to both transfer and receive data, REN must be set to ‘1’. when REN=0 it means
receiver is disabled.
TB8 and RB8 is used for serial modes 2 and 3.
TI and RI are important bits. TI is Transmit Interrupt flag, When 8051 micro controller finishs
the transfer of 8-bit character, it raises the TI flag to indicate that it is ready to transfer another
byte. RI is Receive Interrupt flag, When 8051 receive data via RxD pin(Port1 pin 0), it get rid of
the start and stop bits and places the byte in the SBUF. Then it raises the RI flag to indicate that a
byte has been received and should be picked up before it is lost.
Seven segment displays are used to indicate numerical information. Seven segments display can
display digits from 0 to 9 and even we can display few characters like A, b, C, H, E, e, F, etc.
These are very popular and have many more applications. This system displays the digits from 0
to 9 continuously with a predefined delay. In the process, seven segment displays internally
consist of 8 LEDs. In these LEDs, 7 LEDs are used to indicate the digits 0 to 9 and single LED is
used for indicating decimal point. Generally seven segments are two types, one is common
cathode and the other is common anode. In common cathode, all the cathodes of LEDs are tied
together and labeled as com. and the anode are left alone. In common anode, seven segment
display all the anodes are tied together and cathodes are left freely. Below figure shows the
internal connections of seven segment Display.