MC Unit 1
MC Unit 1
_____________________________________________________________________________________
St. Joseph’s College of Engineering 1 Department of EIE/EEE
EE1572 Microprocessors and Microcontrollers Unit I 8085 Processor
C) IO/M, S0 and S1 : IO/M indicates whether I/O operation or memory operation is being
carried out. S1 and S0 indicate the type of machine cycle in progress.
D) READY : It is used by the microprocessor to sense whether a peripheral is ready or not for data
transfer. If not, the processor waits. It is thus used to synchronize slower peripherals to the
microprocessor.
4. Interrupt Signals:
The 8085 Pin Diagram has five hardware interrupt signals: RST 5.5, RST 6.5, RST 7.5,
TRAP and INTR. The microprocessor recognises interrupt requests on these lines at the end of the
current instruction execution.
The INTA (Interrupt Acknowledge) signal is used to indicate that the processor has acknowledged
an INTR interrupt.
_____________________________________________________________________________________
St. Joseph’s College of Engineering 2 Department of EIE/EEE
EE1572 Microprocessors and Microcontrollers Unit I 8085 Processor
B) SOD (Serial O/P Data) : This is an output signal which enables the transmission of serial data
bit by bit to the external device.
6. DMA Signal:
A) HOLD : This signal indicates that another master is requesting for the use of address
bus, data bus and control bus.
B) HLDA : This active high signal is used to acknowledge HOLD request.
7. Reset Signals:
A) RESET IN : A low on this pin
Sets the program counter to zero (0000H).
Resets the interrupt enable and HLDA flip-flops.
Tri-states the data bus, address bus and control bus. (Note : Only during RESET is active).
Affects the contents of processor’s internal registers randomly.
On reset, the PC sets to 0000H which causes the 8085 Pin Diagram to execute the first
instruction from address 0000H. For proper reset operation reset signal must be held low for at
least 3 clock cycles. The power-on reset circuit can be used to ensure execution of first instruction
from address 0000H.
B) RESET OUT : This active high signal indicates that processor is being reset. This
signal is synchronized to the processor clock and it can be used to reset other devices connected in
the system.
Registers:
The 8085/8080A-programming model includes six registers, one accumulator, and one flag
register, as shown in Figure. In addition, it has two 16-bit registers: the stack pointer and the
program counter. The 8085/8080A has six general-purpose registers to store 8-bit data; these are
identified as B, C, D, E, H, and L as shown in the figure. They can be combined as register pairs -
BC, DE, and HL - to perform some 16-bit operations. The programmer can use these registers to
store or copy data into the registers by using data copy instructions.
Accumulator:
The accumulator is an 8-bit register that is a part of arithmetic/logic unit (ALU). This
register is used to store 8-bit data and to perform arithmetic and logical operations. The result of
an operation is stored in the accumulator. The accumulator is also identified as register A.
_____________________________________________________________________________________
St. Joseph’s College of Engineering 3 Department of EIE/EEE
EE1572 Microprocessors and Microcontrollers Unit I 8085 Processor
Architecture of 8085
Flags:
The ALU includes five flip-flops, which are set or reset after an operation according to data
conditions of the result in the accumulator and other registers. They are called Zero (Z), Carry
(CY), Sign (S), Parity (P), and Auxiliary Carry (AC) flags. The most commonly used flags are
Zero, Carry, and Sign. The microprocessor uses these flags to test data conditions.
For example, after an addition of two numbers, if the sum in the accumulator id larger than
eight bits, the flip-flop uses to indicate a carry -- called the Carry flag (CY) – is set to one. When
an arithmetic operation results in zero, the flip-flop called the Zero (Z) flag is set to one. The first
Figure shows an 8-bit register, called the flag register, adjacent to the accumulator. However, it is
not used as a register; five bit positions out of eight are used to store the outputs of the five flip-
flops. The flags are stored in the 8-bit register so that the programmer can examine these flags
(data conditions) by accessing the register through an instruction.
These flags have critical importance in the decision-making process of the microprocessor.
The conditions (set or reset) of the flags are tested through the software instructions. For example,
the instruction JC (Jump on Carry) is implemented to change the sequence of a program when CY
flag is set.
_____________________________________________________________________________________
St. Joseph’s College of Engineering 4 Department of EIE/EEE
EE1572 Microprocessors and Microcontrollers Unit I 8085 Processor
Instruction Register/Decoder:
Temporary store for the current instruction of a program. Latest instruction sent here from
memory prior to execution. Decoder then takes instruction and „decodes‟ or interprets the
instruction. Decoded instruction then passed to next stage.
Control Generator:
Generates signals within µ P to carry out the instruction which has been decoded. In reality
causes certain connections between blocks of the µP to be opened or closed, so that data goes
where it is required, and so that ALU operations occur.
Register Selector:
This block controls the use of the register stack in the example. Just a logic circuit which
switches between different registers in the set will receive instructions from Control Unit.
_____________________________________________________________________________________
St. Joseph’s College of Engineering 5 Department of EIE/EEE
EE1572 Microprocessors and Microcontrollers Unit I 8085 Processor
The monitor program is a permanent program written by the system designer to take care
of system initialization. System initialization includes the following :
1. Programming the 8279 for keyboard scanning and display refreshing.
2. Programming peripheral ICs 8259, 8257, 8255, 8251, 8254, etc.
3. Initializing stack.
4. Display a message on the LED's.
5. Initializing the interrupt vector table.
_____________________________________________________________________________________
St. Joseph’s College of Engineering 6 Department of EIE/EEE
EE1572 Microprocessors and Microcontrollers Unit I 8085 Processor
_____________________________________________________________________________________
St. Joseph’s College of Engineering 7 Department of EIE/EEE
EE1572 Microprocessors and Microcontrollers Unit I 8085 Processor
The simplified schematic of this memory organization is shown in Fig. and the addresses
allotted to each memory IC are shown in Table.
_____________________________________________________________________________________
St. Joseph’s College of Engineering 8 Department of EIE/EEE
EE1572 Microprocessors and Microcontrollers Unit I 8085 Processor
_____________________________________________________________________________________
St. Joseph’s College of Engineering 9 Department of EIE/EEE
EE1572 Microprocessors and Microcontrollers Unit I 8085 Processor
_____________________________________________________________________________________
St. Joseph’s College of Engineering 10 Department of EIE/EEE
EE1572 Microprocessors and Microcontrollers Unit I 8085 Processor
The 8 kb EPROM IC requires 13 address lines (213 = 8 k). The 8 kb RAM IC requires 13
address lines (213 = 8 k). The address lines A0 - A12 are connected to all the EPROMs and RAMs.
Hence, A0 - A12 will select the required memory location. The address lines A13, A14 and A15
are not used for memory address. Hence by decoding these address lines we can generate chip
select signals.
The 3-to-8 decoder, 74LS138 is employed to produce the chip-select signals for the system.
The decoder has 8-output lines which can be used as 8-chip select signals. All the 8-chip select
signals are used to select memory ICs. EPROM's are mapped at the beginning of memory space.
The decoder will select a memory IC by decoding the address lines A13, A14 and A15. The address
lines A0 - A12 will select a particular memory location in the selected IC.
In this system the full memory capacity of 64 kb is utilized for memory. Hence the
peripheral ICs and the IO ports should be IO-mapped in the system. The EPROM is mapped from
_____________________________________________________________________________________
St. Joseph’s College of Engineering 11 Department of EIE/EEE
EE1572 Microprocessors and Microcontrollers Unit I 8085 Processor
0000H to 5FFFH. The RAM is mapped from 6000H to FFFFH. The EPROM capacity is 24 kb.
The RAM capacity is 40 kb.
The Length of the address bus determines the amount of memory a system can address.
Such as a system with a 32-bit address bus can address 2^32 memory locations. If each memory
location holds one byte, the addressable memory space is 4 GB. However, the actual amount of
memory that can be accessed is usually much less than this theoretical limit due to chipset and
motherboard limitations.
2. Data bus:
It is a group of conducting wires which carries Data only. Data bus is bidirectional
because data flow in both directions, from microprocessor to memory or Input/Output
devices and from memory or Input/Output devices to microprocessor. Length of Data Bus
of 8085 microprocessor is 8 Bit (That is, two Hexadecimal Digits), ranging from 00 H to
FF H. (H denotes Hexadecimal). When it is write operation, the processor will put the data
(to be written) on the data bus, when it is read operation, the memory controller will get
the data from specific memory block and put it into the data bus. The width of the data bus
is directly related to the largest number that the bus can carry, such as an 8 bit bus can
_____________________________________________________________________________________
St. Joseph’s College of Engineering 12 Department of EIE/EEE
EE1572 Microprocessors and Microcontrollers Unit I 8085 Processor
represent 2 to the power of 8 unique values, this equates to the number 0 to 255.A 16 bit
bus can carry 0 to 65535.
3. Control bus:
It is a group of conducting wires, which is used to generate timing and control
signals to control all the associated peripherals, microprocessor uses control bus to process
data, that is what to do with selected memory location. Some control signals are:
Memory read
Memory write
I/O read
I/O Write
Opcode fetch
If one line of control bus may be the read/write line.If the wire is low (no electricity
flowing) then the memory is read, if the wire is high (electricity is flowing) then the
memory is written.
The 8085 microprocessor supports both memory-mapped IO and IO-mapped IO. The
8031/8051 microcontroller supports only memory-mapped IO. Hence in a 8031/8051-based
system, some of the memory addresses should be reserved for IO devices, and in these systems the
IO devices are interfaced similar to that of memory devices.
1. For accessing the IO-mapped devices, the processor executes the IO read or write cycle.
_____________________________________________________________________________________
St. Joseph’s College of Engineering 13 Department of EIE/EEE
EE1572 Microprocessors and Microcontrollers Unit I 8085 Processor
2. During IO read or write cycle, the 8-bit address is placed on both low order address lines and
the high order address lines.
3. IO/M is asserted high to indicate the IO operation (for read as well as write).
A 8085 processor does not provide separate read (RD) and write (WR) signals for memory
and IO devices. But it differentiates the memory and IO device accessed by an IO/M signal. The
three signals RD, WR and IO/M can be decoded as shown in Fig. 6.21 to provide separate read
and write control signals for IO devices and memory devices.
When the devices are IO-mapped, then only the IN and OUT instructions have to be used
for data transfer between the device and the processor. For IO-mapped devices, a separate decoder
should be used to generate the required chip select signals.
Comparison of Memory Mapping and I/O Mapping of I/O Devices in an 8085-Based System
_____________________________________________________________________________________
St. Joseph’s College of Engineering 14 Department of EIE/EEE
EE1572 Microprocessors and Microcontrollers Unit I 8085 Processor
In the memory-mapped ports, the information In the I/O mapped ports, the information bytes
data can be moved to the I/O devices from any can be moved around between the ports and
register or vice versa. the accumulator register only.
The full memory address space cannot be used The full memory address space can be used
solely for addressing memory for interfacing. solely for addressing memory for interfacing.
Data transfer is possible between any register and Data transfer is possible between the
I/O device. accumulator and I/O device only.
Here, a large number of I/O ports (216 ports) are Only 256 I/O ports i.e., 28 ports, are made
possible to be used for interfacing. available for interfacing.
While executing the memory, write or read While executing the I/O write or read cycles,
cycles, the IO/M` is set to low (IO/M` = 0 ). the IO/M` is set to high (IO/M` = 1 ).
There is more decoder hardware involved. There is less decoder hardware involved.
Separate control signals are not required since we Special control signals are used here since we
have a unified memory space. have separate memory spaces.
We can perform arithmetic and logical We cannot perform arithmetic and logical
operations on the data. operations on the data.
Programmed I/O:
Here the processor has to check whether the I/O device is ready or not through the Ready
signal of the I/O device. If the ready signal is high then it will send the data to the I/O device.
Otherwise it will continuously check the Ready signal. The processor is busy in checking the
Ready signal. The drawback is wastage of time.
Interrupt I/O:
In this method the I/O device will interrupt the Processor through the INTR signal to
indicate to the processor that it is ready to accept the next data. Then the processor will send the
INTA signal. Then the processor stops its normal execution and start transferring the data to the
I/O device.
DMA:
Using DMA I/O device can directly transfer the data to the Memory using the Address and
Data buses of Processor.
_____________________________________________________________________________________
St. Joseph’s College of Engineering 15 Department of EIE/EEE
EE1572 Microprocessors and Microcontrollers Unit I 8085 Processor
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.
_____________________________________________________________________________________
St. Joseph’s College of Engineering 16 Department of EIE/EEE
EE1572 Microprocessors and Microcontrollers Unit I 8085 Processor
RST 5 28 H
RST 6 30 H
RST 7 38 H
4. Non-Vectored Interrupts:
Non-Vectored Interrupts are those in which vector address is not predefined. The interrupting
device gives the address of sub-routine for these interrupts. INTR is the only non-vectored
interrupt in 8085 microprocessor.
6. Priority of Interrupts:
When microprocessor receives multiple interrupt requests simultaneously, it will execute the
interrupt service request (ISR) according to the priority of the interrupts. They are TRAP,
RST 7.5, RST 6.5, RST 5.5 and INTR. So, TRAP is the highest priority interrupt signal and
INTR is the least priority interrupt signal.
_____________________________________________________________________________________
St. Joseph’s College of Engineering 17 Department of EIE/EEE