0% found this document useful (0 votes)
42 views17 pages

8085 Basics

tutorial
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)
42 views17 pages

8085 Basics

tutorial
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/ 17

8085 Basic

• As a CPU
• 8085 programing model
• 8085 pin diagram
• 8085 Architecture
As a CPU
• The microprocessor is a programmable device that takes in numbers, performs on
them arithmetic or logical operations according to the program stored in memory
and then produces other numbers as a result.
• Programmable device: The microprocessor can perform different sets of
operations on the data it receives depending on the sequence of instructions
supplied in the given program. By changing the program, the microprocessor
manipulates the data in different ways. –
• Instructions: Each microprocessor is designed to execute a specific group of
operations. This group of operations is called an instruction set. This instruction set
defines what the microprocessor can and cannot do.
• Takes in: The data that the microprocessor manipulates must come from
somewhere. • It comes from what is called “input devices”. • These are devices
that bring data into the system from the outside world. • These represent devices
such as a keyboard, a mouse, switches, and the like.
• Numbers: The microprocessor has a very narrow view on life. It only understands
binary numbers. A binary digit is called a bit (which comes from binary digit). The
microprocessor recognizes and processes a group of bits together. This group of
bits is called a “word”. The number of bits in a Microprocessor’s word, is a measure
of its “abilities”.
A microprocessor based system
Microprocessor consists of: –
 Control unit: control
microprocessor operations.
 ALU: performs data processing
function.
 Registers: provide storage internal
to CPU.
 Interrupts
 Internal data bus

• In addition to the arithmetic & logic circuits, the ALU includes the accumulator, which
is part of every arithmetic & logic operation.
• ALU includes a temporary register used for holding data temporarily during the
execution of the operation
Programing model
REGISTERS
The Registers are of 8-bit & 16-bit size used for
different purposes
• A- Accumulator – This is an special purpose
register. All the ALU operations are
performed with reference to the contents
of Accumulator.
• B,C,D,E,H,L – General purpose registers.
These registers can also used for 16-bit
operations in pairs. The default pairs are BC,
DE & HL.
• F – Flag register – This register indicates the
status of the ALU operation.

D7 D6 D5 D4 D3 D2 D1 D0
S Z AC P CY
 Sign Flag: It occupies the seventh bit of the flag register, which is also known
as the most significant bit. It helps the programmer to know whether the
number stored in the accumulator is positive or negative. If the sign flag is
set, it means that number stored in the accumulator is negative, and if reset,
then the number is positive.
 Zero Flag:: It occupies the sixth bit of the flag register. It is set, when the
operation performed in the ALU results in zero(all 8 bits are zero), otherwise
it is reset. It helps in determining if two numbers are equal or not.
 Auxiliary Carry Flag: It occupies the fourth bit of the flag register. In an
arithmetic operation, when a carry flag is generated by the third bit and
passed on to the fourth bit, then Auxiliary Carry flag is set. If not flag is reset.
This flag is used internally for BCD(Binary-Coded decimal Number)
operations.
 Parity Flag: It occupies the second bit of the flag register. This flag tests for
number of 1’s in the accumulator. If the accumulator holds even number of
1’s, then this flag is set and it is said to even parity. On the other hand if the
number of 1’s is odd, then it is reset and it is said to be odd parity.
 Carry Flag: It occupies the zeroth bit of the flag register. If the arithmetic
operation results in a carry(if result is more than 8 bit), then Carry Flag is set;
otherwise it is reset.
• PC – Program Counter – This is a 16-bit register used to
address the memory location from where an instruction is
going to be executed.
• SP – Stack pointer - This is a 16-bit register used to address
the top of the stack memory location.
• Temporary register, W & Z – These registers are only used by
8085 and are not available for the programmer.
• Address Bus (A15-A8 and AD7-AD0): The microprocessor 8085
has 16 bit address lines from A15-A8 and AD7-AD0. These
lines are used to transfer 16 bit address of memory as well as
8-bit address of I/O ports.
• Data Bus: The lower 8 lines (AD7-AD0) are often called as
multiplexed data lines.
Pin Diagram of 8085
40 pins classified into 6 groups:

1. Data bus

2. Address bus

3. Control & status lines

4. Externally generated

5. Serial interface

6. Power supply & clock


Pin description:
• Address Bus and Data Bus:
The address bus is a group of sixteen lines i.e A0-A15. The address bus is
unidirectional, i.e., bits flow in one direction from the microprocessor unit to
the peripheral devices and uses the high order address bus.
• Control and Status Signals:
ALE – It is an Address Latch Enable signal. It goes high during first T state of a
machine cycle and enables the lower 8-bits of the address, if its value is 1
otherwise data bus is activated.
IO/M’ – It is a status signal which determines whether the address is for
input-output or memory. When it is high(1) the address on the address bus is
for input-output devices. When it is low(0) the address on the address bus is
for the memory.
SO, S1 – These are status signals. They distinguish the various types of
operations such as halt, reading, instruction fetching or writing.
• RD’ – It is a signal to control DATA BUS
IO/M’ S1 S0
READ operation. When it is low STATUS
the selected memory or input-
output device is read. 0 1 1 Opcode fetch
• WR’ – It is a signal to control
Memory
WRITE operation. When it goes 0 1 0
read
low the data on the data bus is
written into the selected Memory
0 0 1
write
memory or I/O location.
• READY – It senses whether a 1 1 0 I/O read
peripheral is ready to transfer 1 0 1 I/O write
data or not. If READY is high(1)
the peripheral is ready. If it is Interrupt
1 1 1
low(0) the microprocessor waits acknowledge
till it goes high. It is useful for
interfacing low speed devices 0 0 0 Halt
• Power Supply and Clock Frequency:
Vcc – +5v power supply
Vss – Ground Reference
XI, X2 – A crystal is connected at these two pins. The frequency is internally divided by
two, therefore, to operate a system at 3MHZ the crystal should have frequency of
6MHZ.
CLK (OUT) – This signal can be used as the system clock for other devices.
• Interrupts and Peripheral Initiated Signals:
The 8085 has five interrupt signals that can be used to interrupt a program
execution.
(i) INTR
(ii) RST 7.5
(iii) RST 6.5
(iv) RST 5.5
(v) TRAP
The microprocessor acknowledges Interrupt Request by INTA’ signal. In addition to
Interrupts, there are three externally initiated signals namely RESET, HOLD and READY.
To respond to HOLD request, it has one signal called HLDA.
INTR – It is an interrupt request signal.
INTA’ – It is an interrupt acknowledgment sent by the microprocessor after INTR is
received.
• Reset Signals:
RESET IN’ – When the signal on this pin is low(0), the program-counter is set
to zero, the buses are tristated and the microprocessor unit is reset.
RESET OUT – This signal indicates that the MPU is being reset. The signal can
be used to reset other devices.
• DMA Signals:
HOLD – It indicates that another device is requesting the use of the address
and data bus. Having received HOLD request the microprocessor relinquishes
the use of the buses as soon as the current machine cycle is completed.
Internal processing may continue. After the removal of the HOLD signal the
processor regains the bus.
HLDA – It is a signal which indicates that the hold request has been received
after the removal of a HOLD request, the HLDA goes low.
• Serial I/O Ports:
Serial transmission in 8085 is implemented by the two signals,
SID and SOD – SID is a data line for serial input where as SOD is a data line for
serial output.
Signal group:
 BUS
 Address Bus (A15-A8 and AD7-AD0): The microprocessor 8085 has 16 bit address lines from
A15-A8 and AD7-AD0. These lines are used to transfer 16 bit address of memory as well as 8-
bit address of I/O ports.
 Data Bus: The lower 8 lines (AD7-AD0) are often called as multiplexed data lines.
 CONTROL LINES
 RD : Read: This is active low signal which indicates that the selected I/O or memory device is
to be read and also is available on the data bus.
 WR : Write: This is active low signal which indicates that the data on data bus are to be
written into a selected memory location.
 IO/ M : (Input / Output / Memory): This is used to select either Input / Output devices or
memory operation. When it is high it indicates an I/O operation and when it is low, it
indicates a memory operation.
 STATUS LINES
 Status Pins (S1, S0): The microprocessor 8085 has two status pins as S1, S0 which is used to
indicate the status of microprocessor or operation which is performed by microprocessor.
 SPECIAL SIGNAL
 ALE (Address Latch Enable): The ALE signal is used to enable or disable the external latch IC
(74373/8212).
 The external latch IC is used for the de-multiplexing of AD7-AD0 lines, i.e., it is used to
separate the address and data from AD7-AD0 lines.
 If ALE = 1/0 then external latch IC is enabled / disabled respectively.
De-multiplexing of address and data bus:
8085 Architecture
Architecture 0f 8085
1. ALU
2. Timing and Control Unit
3. General Purpose Registers
4. Program Status word
5. Program Counter
6. Stack Pointer
7. Instruction Register and Decoder
8. Interrupt Control
9. Serial I/O Control
10. Address Bus
11. Data Bus

You might also like