Professional Documents
Culture Documents
Micro CH 04
Micro CH 04
CHAPTER: 04
Microprocessor System
4.1 PIN CONGURATION OF 8085
1
2
2
1
6
2
3
4
6 Serial IO signals
CHAPTER: 04
Microprocessor System
8085 is a 40 pin IC, DIP package. Signals from the pins can be grouped as follows:
q HOLD (input): Request use of Address and data bus by peripheral (Like DMA).
q HLDA (output): Hold Acknowledge: This signal acknowledges the HOLD
request.
q READY (Input) : Ready signal from slow- responding peripheral.
l Used to delay the microprocessor read and write cycles until a slow
responding peripheral is ready to send or accept data.
aAddress bus:
q 16 signal lines that are used as the address bus.
q These lines are split into two segments.
A15-A8-Unidirectional Higher Order (most significant 8 bits of the memory
address or the 8 bits of the I/O address.) Bus.
AD7-AD0-Multiplexed Lower Address/8-bit Data Bus
CHAPTER: 04
Microprocessor System
a Data bus:
q The signal lines AD7- AD0 are multiplexed to carry bidirectional data.
q AD7- AD0 are used the low order address bus as well as data bus.
IO/M S0 S1 Operation
0 0 0 Halt
0 0 1 Memory Write
0 1 0 Memory Read
1 0 1 I/O Write
1 1 0 I/O Read
0 1 1 Opcode Fetch
1 1 1 Interrupt Acknowledge
CHAPTER: 04
Microprocessor System
a Serial IO Signals:
q SID (input) - Serial input data line
q SOD (output) - Serial output data line
l These signals are used for serial communication.
The Microprocessor 8086 is a 16-bit CPU available in different clock rates and
packaged in a 40 pin CERDIP or plastic package.
CHAPTER: 04
Microprocessor System
a Functions for minimum mode ( MN/MX=0)
l After receiving the HOLD request, issues the hold acknowledge signal on.
CHAPTER: 04
Microprocessor System
a Functions for maximum/multiprocessor mode ( MN/MX=0)
iWorks with 8288 Bus Controller.
q S2, S1, S0 – Status Lines - These are the status lines which reflect
the type of operation, being carried out by the processor.
q LOCK (output) – If LOCK signal is low: other system bus master will be
prevented from gaining the system bus,
DEN
CHAPTER: 04
Microprocessor System
a Common signals for both modes
q BHE/S7-Bus High Enable: Transfers data over higher order( D15-D8 ) data bus.
q CLK- Clock Input - Provides the basic timing information for processor.
a Data Bus:
√ Group of wires which carries data between the system modules.
√ Width of data bus (No. of bits) can be 4, 8, 16, 32, or 64 lines.
√ These number represents the no. of bits they can carry.
a Address Bus:
√ Group of wires which carries address between the system modules.
√ Carries address of memory in which R/W has to be performed
√ Also used to address I/O ports.
CHAPTER: 04
Microprocessor System
a Control Bus:
√ Group of wires which carries control Informationas.
√ Transmits command and timing info between system modules.
√ Memory Write, Memory Read, I/O Write, I/O Read, Transfer
Acknowledge, Bus Request, Bus Grant, Interrupt Request,
Interrupt Acknowledge
a BUS TYPES:
q Transmitter and receivers are synchronized of clock.
q Data bits are transmitted with synchronization of clock.
q Devices connected by synchronous bus should be at same speed.
q All the events start at beginning of the clock cycle.
q Used in high – speed transmission.
Advantages: Involves very little logic and can run very fast.
Dis-Advantages: Clock skew limits bus length.
2) Asynchronous Bus:
q Transmitters and receivers are not synchronized by clock
q Devices connected by synchronous bus may not be at same speed.
q Start and stop bits are required to establish communication of each data.
q Occurrence of one event on the bus follows and depends on the occurrence
of previous event.
q Used in low
speed transmission.
CHAPTER: 04
Microprocessor System
3) Read and Write Bus Timing of 8085 and 8086 Microprocessors:
l Request acknowledgement
Instruction Cycle :- the time required completing the execution of an instruction. The
8085 instruction cycle consists of one to six machine cycles or one to six operations.
- Fetch cycle.
- Decode instruction.
- Execution cycle
Machine Cycle :- It is defined as the time required to complete one operation of accessing
memory, I/O, or acknowledging an external request. This cycle may consist of three to six
T-states.
Clock Cycle (T state) :- It is defined as one subdivision of the operation performed in one
clock period.
CHAPTER: 04
Microprocessor System
OPCODE FETCH MACHINE CYCLE
ADDRESS OPCODE
2000H MOV A,B (78H)
√ The first operation in any instruction is always Op-Code fetch from Memory.
√ Let’s consider the instruction MOV A, B stored at memory location 2000H.
√ Op-Code for the instruction is 78H and Op-Code fetch cycle is of 4 clock cycles.
STEP3: √ The byte from the memory location --> Data bus.
√ Data (78H) into D0-D7 and RD goes high impedance.
CHAPTER: 04
Microprocessor System
MEMORY READ MACHINE CYCLE (EG: SECOND CYCLE OF MVI A, 32H)
(20H)
(01H) (32H)
CHAPTER: 04
Microprocessor System
EXAMPLE: COMPLETE INSTRUCTION CYCLE (MVI B, 43H)
CHAPTER: 04
Microprocessor System
MEMORY WRITE MACHINE CYCLE (EG: LAST CYCLE OF STA 526AH)
(52H)
(6AH) (C7H)
Let Accumulator
contains C7H.
CHAPTER: 04
Microprocessor System
EXAMPLE: COMPLETE INSTRUCTION CYCLE (STA 526AH)
* Here the Instruction stores the content of accumulator in to specified memory location, so
we need to fetch operation code as well as 16-bit memory address.
STEP1: √ Reads opcode by Opcode Fetch Machine Cycle.
STEP2: √ Reads lower byte of address by memory read cycle.
STEP3: √ Reads Higher byte of address by memory read cycle.
STEP4: √ Stores the content of accumulator into the memory location by
memory write cycle.
CHAPTER: 04
Microprocessor System
EXAMPLE: COMPLETE INSTRUCTION CYCLE (IN C0H)
* Here the Instruction reads data to accumulator from port having address C0H.
STEP1: √ Fetching the Opcode DBH from the memory 4125H.
STEP2: √ Read the port address C0H from 4126H.
STEP3: √ Read the content of port C0H and send it to the accumulator.
l Let the content of port is 5EH.
CHAPTER: 04
Microprocessor System
EXAMPLE: COMPLETE INSTRUCTION CYCLE (INR MH)
CHAPTER: 04
Microprocessor System
4.3 MEMORY DEVICE CLASSIFICATION AND HIERARCHY
MEMORY
1) PRIMERY MEMORY:
Primary memory is computer memory that is accessed directly by the CPU. This
includes several types of memory, such as the processor cache and system ROM.
However, in most cases, primary memory refers to system RAM.
CHAPTER: 04
Microprocessor System
iii) Masked ROM: √ A bit pattern is permanently recorded by the manufactures
during production.
l R/W Memory (RAM) : √ Microprocessor can read and write frequently and randomly.
√ Random Access Memory is volatile (i.e. the content will be lost
if the power is turned off.)
√ When the computer is rebooted, the OS and other files are
reloaded into RAM, usually from an HDD or SSD.
i) Dynamic RAM (DRAM): √ Made up of MOS transistor gates and it stores bit as charge.
√ Comprised of 1 Transistor and 1 Capacitor.
√ Has high density, low power consumption.
√ The bit information leaks therefore needs to be rewritten
again every few milliseconds.
√ Slower due to extra refrashing circuit.
ii) Static RAM (SRAM): √ Made up of flip flops and it stores bit as voltage.
√ Each cell (Flip-flop) requires six transistors.
√ Has low density but high speed.
√ Expensive and consumes more power.
1) SECONDARY MEMORY:
i) Access time (Ta ): √ Average time required to read/write the unit of information.
√ Access rate (R a ) = 1/Ta
ii) Cycle time (Tc ): √ Average time that lapses between two successive read operation.
Cycle rate (R c )= bandwidth = 1/Ta
CHAPTER: 04
Microprocessor System
Memory Hierarchy:
√ There is a tradeoff between three characteristics:
l Cost
l Capacity: if greater application will get space to run smoothly.
CHAPTER: 04
Microprocessor System
4.4 INTERFACING I/O AND MEMORY
8085 doesn’t have its internal memory or I/O buffers inside its chip, so we have to
1) 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 8085’s 16-bit address bus permits 64k words to be uniquely addressed.
√ Each cell (which contains data) in main memory has its own unique address.
√ Address decoding selects the required memory location for data read or write.
√ all the address lines on that mapping mode are used for address
CHAPTER: 04
Microprocessor System
i) Non-unique/Partial/Linear Select Address Decoding:
√ all the address lines on that mapping mode are not used for address
conflict.)
√ chip select signal of each device is derived from 16 bit address lines.
CHAPTER: 04
Microprocessor System
Q.N:01 Design an address decoding circuit for two RAM chips each of 256 bytes at
address starting from 5300H.
√ Required address bit for 256 bytes = ( 2 x=256 ), x = log (256)/log (2) = 8bit
MEMORY MAPPING
Block Address A15 A14 A13 A12 A11 A10 A9 A8 A7 A6 A5 A4 A3 A2 A1 A0
1 Start 5300H 0 1 0 1 0 0 1 1 0 0 0 0 0 0 0 0
End 53FFH 0 1 0 1 0 0 1 1 1 1 1 1 1 1 1 1
2 Start 5400H 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0
End 54FFH 0 1 0 1 0 1 0 0 1 1 1 1 1 1 1 1
CHAPTER: 04
Microprocessor System
Q.N. Design a minimum system to interface the following specification:
1. 32kB of ROM using 2 x 16kB ROM IC
2. 32kB of RAM using 2 x 16kB RAM IC
MEMORY MAPPING
Block Address A15 A14 A13 A12 A11 A10 A9 A8 A7 A6 A5 A4 A3 A2 A1 A0
1 Start 0000H 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
End 3FFFH 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1
2 Start 4000H 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
End 7FFFH 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
3 Start 8000H 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
End BFFFH 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1
4 Start C000H 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
End FFFFH 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
CS
ROM1
16 kB
RD
2*4
Decoder CS
ROM2
16 kB
RD
A15
DATA
A14
8085
Microprocessor CS
A13
.
. Address Bus (A13.......A0) RAM1
.
A. 0 16 kB
WR RD
WR
RD
IO/M CS
RAM2
16 kB
WR RD
CHAPTER: 04
Microprocessor System
Q.N. Design a minimum system to interface the following specification:
i). 74LS138: 3 to 8 decoder
ii). 2732 (4k*8) EP-ROM address range should begin at 0000H and
additional 4k memory space should be available for future expansion.
iii). 6116 (2k*8) CMOS R/W Memory
MEMORY MAPPING
Block Address A15 A14 A13 A12 A11 A10 A9 A8 A7 A6 A5 A4 A3 A2 A1 A0
1 Start 0000H 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
End 0FFFH 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1
2 Start 1000H 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0
FOR FUTURE USE
End 1FFFH 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1
3 Start 2000H 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
End 27FFH 0 0 1 0 0 1 1 1 1 1 1 1 1 1 1 1
EN
2732
EP-ROM
4 kB
EN
RD
74LS138
3*8
A15
DATA
A14
Decoder
A13
A12
8085
Microprocessor
A11 EN
A10
.
. Address Bus (A10.......A0) CMOS
A. 0 2 kB
WR RD
WR
RD
IO/M
CHAPTER: 04
Microprocessor System
Q.N. Design a address decoding interface of an input port and output port for 8085 at
82H and 81H address.
EN
A7 OUTPUT
A6 BUFFER
A5
WR
A4
A3
A2
8085 A1
Microprocessor A0
EN
5V
INPUT
BUFFER
RD
5V
WR
RD
IO/M
CHAPTER: 04
Microprocessor System
DATA TRANSMISSION INTERFACE
l Asynchronous
Transmission Format
l Synchronous
PARALLEL INTERFACE:
√ The device which can handle data at higher speed
√ N bits of data are handled simultaneously by the bus.
√ Expensive due to need of multiple wires.
CHAPTER: 04
Microprocessor System
Synchronous : √ Reciever and Transmitter uses same clock pulse.
√ Eg: LED are always connected to the input and output ports.
√ Strobe signal indicates the time at which data is being activated to transmit.
√ Microprocessor should wait until peripheral asserts a active low strobe signal
l Single Handshaking :
√ Peripheral outputs data and send STB signal to MP. “Here is the data for you.”
√ MP detects asserted STB signal, reads the data and sends an acknowledge
signal (ACK) to indicate data has been read and peripheral can send next
data. “I got that one, send me another.”
CHAPTER: 04
Microprocessor System
l Double Handshaking :
√ The peripheral asserts its STB line low to ask MP “Are you ready? ”
√ Peripheral then sends data and raises its STB line low to say “Here is some
valid data for you.”
√ MP then reads the data and drops its ACK line to say, “I have the data, thank
you, and I await your request to send the next byte of data.”
CHAPTER: 04
Microprocessor System
√ 8255A is used to parallel data transfer between processor and slow peripheral devices
like ADC, DAC, keyboard.
l Mode-1 ( Same as Mode 0 but Port C is used for handshaking and control)
- Port A and B is used as 8-bit either input or output ports.
- Each port uses three lines from port C as handshake signals.
- Inputs and outputs are latched.
l Mode-2 ( Port A is bidirectional (both I/O) and Port C is used for handshaking.)
- Port A can be configured as the bidirectional port.
- Port B either in Mode 0 or Mode 1
- Port A uses five signals from Port C as handshake signals for data transfer.
- Other signals from Port-C: either as simple I/O or as handshake for port B.
A0 A1 RD WR CS Input-Output Operation
0 0 0 1 0 PORT A --> Data bus
0 1 0 1 0 PORT B --> Data bus
1 0 0 1 0 PORT C --> Data bus
0 0 1 0 0 Data bus --> PORT A
0 1 1 0 0 Data bus --> PORT B
1 0 1 0 0 Data bus --> PORT C
1 1 1 0 0 Data bus --> Control Word Read
CHAPTER: 04
Microprocessor System
SERIAL INTERFACE
√ Usually one or more SYNC characters are used to indicate the start of each
synchronous data stream.
√ If the data is not ready to be transmitted, the transmitter will send SYNC
character until the data is available.
CHAPTER: 04
Microprocessor System
l Asynchronous serial data transmission
√ Receiving device does not need to be synchronized with transmitting device.
Framing Start and stop bit are sent SYNC characters are sent with
Information with each character. each character.
CHAPTER: 04
Microprocessor System
UNIVERSAL SYNCHRONOUS ASYNCHRONOUS RECEIVER TRANSMITTER (USART) – 5251A
CHAPTER: 04
Microprocessor System
The functional block diagram of 825 1A consists five sections:
l Read/Write control logic
l Transmitter
l Receiver
l Data bus buffer
l Modem control.
√ Transmitter section:
l Parallel data from CPU --> Serial data.
l RxD - Receives serial data from peripheral and buffered.
l Double buffered:
- Buffer register: Holds 8-bit parallel data from CPU.
- Output register: Holds converted serial data for transmission.
l TxRDY: If buffer register is empty.
l TxEMPTY: If output register is empty.
l TxC: Gives clock refrence for reciever.
CHAPTER: 04
Microprocessor System
√ Receiver Section:
l Accepts serial data --> parallel data.
l RxD - Receives serial data from peripheral and buffered.
l Double buffered:
- Input register: Receives and holds serial data.
- Buffer register: Holds the converted parallel data.
l RxRDY: Indicates input register loads a parallel data to buffer register.
l RxC: Inputs clock refrence form transmitter.
l SYNDET/BRKDET: - (Asynchronous mode) Indicates break in data transmission.
- (Synchronous mode) Indicate the reception of SYNC.
√ MODEM Control:
l Allows to interface a MODEM over telephone lines.
l This unit takes care of handshake signals for MODEM interface.
l DTR (Data Terminal Ready) - Tells USART is ready for transmit data to MODEM.
l DSR (Data Set Ready) - Input signal for MODEM condition (ready or not).
l RTS (Request to Send): requests the MODEM prepare to transmit data.
l CTS (Clear to Send): MODEM is ready to accept data from the DTE.
l Bit Rate is how many data bits are transmitted per second.
l A baud Rate is the number of times per second a signal in a communications
channel changes.
RS 232
√ Standard interface to transmit digital information across long distances.
√ Standardize interface between and data
l Data terminal equipment (DTE) - Computer (PC)
l Data communication equipment (DCE) - MODEM
√ Uses 25 pins (DB – 25P) or 9 Pins (DE – 9P) standards.
√ DTE connector - male / DCE connector - female.
√ Transmission capacity: 20KBd
√ Transmission distance 50 ft.
√ The voltage level for RS-232 (Reciever side) are:
l A logic high or 1 , -3V to -15V
l A logic low or 0, +3v to +15
√ For Transmitter: [ 1 => (-5V to -15V ), 1 => (-5V to -15V)]
√ Normally ±12V voltage levels are used.
CHAPTER: 04
Microprocessor System
CHAPTER: 04
Microprocessor System
RS 423A
√ Improved data transmission capacity with longer distances than RS 232.
√ Voltage levels:
l High : (-4V to -6V)
l Low : (4V to 6V)
√ Single ended variable slew rate.
√ Cable length with RS423 is 1200 meter.
√ Transmission rate:
l 100 Kbd over 40 ft
l 1 Kbd over 4000 ft
RS 422A
√ A newer improved standard for serial data transfer.
√ Signal will be send differentially over a ribbon cable or a twisted pair of wires.
√ Uses differential amplifier to reject noise.
√ −6V to +6V (maximum differential Voltage)
l High : ( [B-A] > 0.4V => Negative Voltages)
l Low : ( [B-A] < 0.4V => Positive voltages)
√ Balanced data transmission.
√ These lines produce complementary (opposite) output signals.
√ Maximum Distance: 1500 metres (4,900 ft)
√ Transmission rate:
l 10000 KBd for 40 ft.
l 100 KBd for 4000 ft.
USB
√ Universal Serial Bus
√ Generations of USB :
l USB 1,x (Earlier, -Low Speed: 1.5 Mbit/s -Full Speed: 12 Mbit/s)
l USB 2,0 (Mini-A and Mini-B Connector, -Full Speed: 480 Mbit/s, OTG)
l USB 3,x (-SuperSpeed: 5 Gbit/s, -SuperSpeed+: 10-20 Gbit/s)
l USB4 (impending release)
√ Voltage level: l 5v +0.25v
-0.60v
√ Pins:
l 1: V BUS (+5 V) l 2: Data−
l 3: Data+ l 4: GND
CHAPTER: 04
Microprocessor System
DIRECT MEMORY ACCESS (DMA)
√ One of the system components connected to the system bus is given control of
the bus to perform direct read/write operation over main memory while the
microprocessor is temporarily disabled called direct memory access.
√ The external DMA controller sends a signal on HOLD pin to the microprocessor.
√ After the current bus cycle is completed the CPU will return a bus grant signal
and the component sending the request will become the master.
√ A DMA controller temporarily borrows the system bus from the microprocessor
and transfers the data bytes directly with high speed between an I/O port
and a series of memory locations.
√ Data is transferred between two peripherals directly without the involvement of
the microprocessor.
√ Once the DMA controller is done, it turns off the HOLD signal and the
microprocessor takes back control of the buses.
√ Taking control of the bus for a bus cycle is called cycle stealing.
√ Cycle stealing technique: In this scheme the bytes are divided into several parts
and after transferring every part the control of buses is given back to MPU and
later stolen back when MPU does not need it.
CHAPTER: 04
Microprocessor System
It is a device to transfer the data directly between IO device and memory without the
involvement of the CPU. So it performs a high-speed data transfer between memory and
I/O device.
√ Four channels: it can be used to provide DMA to four I/O devices.
l Each channel can be independently programmable to transfer up to 64kb
of data by DMA.
l Each channel can be independently perform read transfer, write transfer
and verify transfer.