Chapter 4 Microprocessor System
Chapter 4 Microprocessor System
Chapter-4
Microprocessor System
A microcomputer consists of a set of components or modules of three basic types CPU
memory
and I/O units which communicate with each other.
PIN Configuration of 8085
Fig (a) - Pin Diagram of 8085 & Fig(b) - logical schematic of Pin diagram
Email: [email protected]
1
Microprocessors
The microprocessor is in many ways similar to the CPU, but includes the logic
circuitry,
including the control unit, on one chip.
The microprocessor can be divided into three segments for the sake clarity,
arithmetic/logic unit (ALU), register array, and control unit.
8085 is a 40 pin IC, DIP package. The signals from the pins can be grouped as
follows
1.
2.
3.
4.
5.
6.
Email: [email protected]
2
Microprocessors
Email: [email protected]
3
Microprocessors
Hold (Input)
This indicates peripheral controller requesting the bus.
HLDA (Output)
This indicates the acknowledgement for the Hold request.
READY (Input)
It is used to delay the microprocessor read and write cycles until a slow
responding
peripheral is ready to send or accept data.
Memory and I/O devices will have slower response compared to microprocessors.
Before completing the present job such a slow peripheral may not be able to
handle
further data or control signal from CPU.
The processor sets the READY signal after completing the present job to access
the data.
The microprocessor enters into WAIT state while the READY pin is disabled.
Reset In (input, active low)
This signal is used to reset the microprocessor.
The program counter inside the microprocessor is set to zero.
The buses are tri-stated.
Reset Out (Output)
It indicates CPU is being reset.
Used to reset all the connected devices when the microprocessor is reset.
7. Single Bit Serial I/O ports:
SID (input)
- Serial input data line
SOD (output)
- Serial output data line
These signals are used for serial communication.
Email: [email protected]
4
Microprocessors
Email: [email protected]
5
Microprocessors
The Microprocessor 8086 is a 16-bit CPU available in different clock rates and
packaged
in a 40 pin CERDIP or plastic package.
The 8086 operates in single processor or multiprocessor configuration to achieve
high
performance. The pins serve a particular function in minimum mode (single processor
mode) and other function in maximum mode configuration (multiprocessor mode).
The 8086 signals can be categorized in three groups.
o The first are the signal having common functions in minimum as well as
maximum mode.
o The second are the signals which have special functions for minimum mode
o The third are the signals having special functions for maximum mode.
Email: [email protected]
6
Microprocessors
AD15-AD0 : These are the time multiplexed memory I/O address and data lines.
A19/S6,A18/S5,A17/S4,A16/S3 : These are the time multiplexed address and status
lines. The address bits are separated from the status bit using latches controlled
by the
ALE signal.
BHE/S7 : The bus high enable is used to indicate the transfer of data over the
higher
order ( D15-D8 ) data bus.
RD – Read : This signal on low indicates the peripheral that the processor is
performing
memory or I/O read operation.
READY : This is the acknowledgement from the slow device or memory that they have
completed the data transfer.
INTR-Interrupt Request : This is to determine the availability of the request from
external devices. If any interrupt request is pending, the processor enters the
interrupt
acknowledge cycle.
TEST : This input is examined by a ‘WAIT’ instruction. If the TEST pin goes low,
execution will continue, else the processor remains in an idle state.
CLK- Clock Input : The clock input provides the basic timing for processor
operation
and bus control activity.
The following pin functions are for the minimum mode operation of 8086.
M/IO – Memory/IO : When it is low, it indicates the CPU is having an I/O operation,
and when it is high, it indicates that the CPU is having a memory operation.
INTA – Interrupt Acknowledge: This signal is used for interrupt acknowledge i.e.
when it goes low; the processor has accepted the interrupt.
ALE – Address Latch Enable: This output signal indicates the availability of the
valid
address on the address/data lines.
DT/R – Data Transmit/Receive: This output is used to decide the direction of data
flow
through the trans-receivers (bidirectional buffers). When the processor sends out
data,
this signal is high and when the processor is receiving data, this signal is low.
DEN – Data Enable: This signal indicates the availability of valid data over the
address/data lines. It is used to enable the trans-receivers (bidirectional
buffers) to
separate the data from the multiplexed address/data signal.
HOLD, HLDA- Acknowledge: When the HOLD line goes high, it indicates to the
processor that another master is requesting the bus access. The processor, after
receiving
the HOLD request, issues the hold acknowledge signal on.
Email: [email protected]
7
Microprocessors
The following pin functions are applicable for maximum mode operation of 8086.
S2, S1, S0 – Status Lines: These are the status lines which reflect the type of
operation,
being carried out by the processor.
S2
S1
S0
Indication
Interrupt Acknowledge
Halt
0
Code Access
Read Memory
Write Memory
Passive
LOCK : This output pin indicates that other system bus master will be prevented
from
gaining the system bus, while the LOCK signal is low.
RQ/GT0, RQ/GT1 – Request/Grant : These pins are used by the other local bus master
in maximum mode, to force the processor to release the local bus at the end of the
processor current bus cycle.
BUS STRUCTURE:
A microcomputer consists of a set of components or modules of three basic types CPU
memory
and I/O units which communicate with each other. A bus is a communication pathway
between
two or more such components. A bus actually consists of multiple communication
pathway or
lines. Each line is capable of transmitting signals representing binary 1 and 0.
Several lines of the
bus can be used to transmit binary data simultaneously. The bus that connects major
microcomputer components such as CPU, memory or I/O is called the system bus.
System bus
consists of number of separate lines. Each line assigned a particular function.
Fundamentally in
any system bus the lines can be classified into three group buses.
1. Data Bus:
Data bus provides the path for monitoring data between the system modules. The bus
has various
numbers of separate lines like 8, 16, 32, or 64. Which referred as the width of
data bus .These
number represents the no. of bits they can carry because each carry 1 bit.
Email: [email protected]
Reference: R. S. Gaonkar & D, V. Hall |
8
Microprocessors
2. Address Bus:
Each Lines of address bus are used to designate the source or destination of the
data on data bus.
For example, if the CPU requires reading a word (8, 16, 32) bits of data from
memory, it puts the
address of desired word on address bus. The address bus is also used to address I/O
ports. Bus
width determines the total memory the up can handle.
3. Control Bus:
The control bus is a group of lines used to control the access to control signals
and the use of the
data and address bus. The control signals transmit both command and timing
information
between the system modules. The timing signals indicate the validity of data and
address
information, where as command signals specify operations to be performed. Some of
the control
signals are:
Memory Write (MEMW): It causes data on the bus to be loaded in to the address
location.
Memory Read (MEMR): It causes data from the addressed location to be placed on the
data bus.
I/O Write (IOW): It causes the data on the bus to be output to the addressed I/O
port.
I/O Read (IOR): It causes the data from the addressed I/O port to be placed on the
bus.
Transfer Acknowledge: This signal indicates that data have been accepted from or
placed on
the bus.
Bus Request: It is used to indicate that a module wants to gain control of the bus.
Bus Grant: It indicates that a requesting module has been granted for the control
of bus.
Interrupt
Request:
It
indicates
that
an
interrupt
has
been
pending.
Interrupt Acknowledge: it indicates that the pending interrupt has been recognized.
Bus Types
1. Synchronous Bus:
In a synchronous bus, The Occurrence of the events on the bus is determined by a
clock . The
clock transmits a regular sequence of 0’s & 1’s of equal duration. All the events
start at
beginning of the clock cycle.
Here the CPU issues a START signal to indicate the presence of address and
control
information on the bus.
Compiled by: Er. Hari Aryal
Email: [email protected]
9
Microprocessors
Then it issues the memory read signal and places the memory address on the
address bus.
The addressed memory module recognizes the address and after a delay of one clock
cycle it places the data and acknowledgment signal on the buses.
In synchronous bus, all devices are tied to a fixed rate, and hence the system can
not take
advantage of device performance but it is easy to implement.
2. Asynchronous Bus:
In an asynchronous bus, the timing is maintained in such way that occurrence of one
event on the bus follows and depends on the occurrence of previous event.
Here the CPU places Memory Read (Control) and address signals on the bus.
Then it issues master synchronous signal (MSYNC) to indicate the presence of
valid address and control signals on the bus.
The addressed memory module responds with the data and the slave synchronous
signal (SSYNC)
Machine cycles and bus timing diagrams:
Operation of a microprocessor can be classified in to following four groups
according to their
nature.
- Op- Code fetch
- Memory Read /Write
- I/O Read/ Write
- Request acknowledgement
Here Op-Code fetch is an internal operation and other three are external
operations.
During three operations, microprocessor generates and receives different signals.
These
all operations are terms as machine cycle.
- Clock Cycle (T state): It is defined as one subdivision of the operation
performed in one
clock period.
- 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.
Compiled by: Er. Hari Aryal
Email: [email protected]
10
Microprocessors
Email: [email protected]
11
Microprocessors
Here two machine cycles are presented, first is Op-Code fetch which consists of 4
clock cycles
and second is memory read consist of 4 clock cycle.
The memory write machine cycle is executed by the processor to write a data byte in
a
memory location.
Email: [email protected]
12
Microprocessors
The I/O Read cycle is executed by the processor to read a data byte from I/O port
or from
the peripheral, which is I/O, mapped in the system.
The processor takes 3T states to execute this machine cycle.
The IN instruction uses this machine cycle during the execution.
Email: [email protected]
13
Microprocessors
4T
3T
3T
Email: [email protected]
14
Microprocessors
Step 1: In Machine Cycle M1, the microprocessor sends RD control signal which is
combined
with IO/ M to generate the MEMR signal and processor fetches instruction code D3
using the
data bus.
Step 2: In 2nd Machine Cycle M2, the 8085 microprocessor places the next address
2051 on the
address bus and gets the device address 01H via data bus.
Step 3: In machine Cycle M3, the 8085 places device address 01H on low order as
well as high
order address bus. IO/ M goes high for IO and accumulator content are placed on
Data bus which
are to be written into the selected output port.
Timing diagram for STA 526AH
STA means Store Accumulator -The contents of the accumulator is stored in the
specified
address(526A).
The opcode of the STA instruction is said to be 32H. It is fetched from the memory
41FFH(see fig). - OF machine cycle
Then the lower order memory address is read(6A). - Memory Read Machine Cycle
Read the higher order memory address (52).- Memory Read Machine Cycle
The combination of both the addresses are considered and the content from
accumulator
is written in 526A. - Memory Write Machine Cycle
Assume the memory address for the instruction and let the content of accumulator is
C7H. So, C7H from accumulator is now stored in 526A.
Email: [email protected]
15
Microprocessors
Email: [email protected]
16
Microprocessors
Email: [email protected]
17
Microprocessors
Fetching the Opcode 06H from the memory 2000H. (OF machine cycle)
Read (move) the data 43H from memory 2001H. (memory read)
Fetching the Opcode 34H from the memory 4105H. (OF cycle)
Let the memory address (M) be 4250H. (MR cycle -To read Memory address and data)
Let the content of that memory is 12H.
Increment the memory content from 12H to 13H. (MW machine cycle)
Email: [email protected]
18
Microprocessors
Email: [email protected]
19
Microprocessors
Email: [email protected]
20
Microprocessors
Email: [email protected]
21
Microprocessors
Memory devices:
Email: [email protected]
22
Microprocessors
Email: [email protected]
23
Microprocessors
violet radiation. It is reusable. The disadvantages are :(i) it must be taken out
off circuit
to erase it (ii). The entire chip must be erased (iii) the erasing process takes 15
to 20
minutes.
D. Electrically Erasable PROM(EEPROM):
It is functionally same as EPROM except that information can be altered by using
electrical signal at the register level rather than erasing all the information. It
is
expensive compared to EPROM and flash and can be erased in 10 ms.
E. Flash Memory:
It is variation of EPROM. The difference is that EPROM can be erased in register
level but flash memory must be erased in register level but flash memory must be
erased in its entirety or at block level.
2.
Secondary memory
The devices that provide backup storage are called secondary memory. It includes
serial access type such as magnetic disks and random access type such as magnetic
disks. It is nonvolatile memory.
Performance of memory:
1. Access time (ta):
Read access time: It is the average time required to read the unit of information
from memory.
Write access time: It is the average time required to write the unit of information
on memory.
Access rate (ra) = /ta
2. Cycle time (tc):
It is the average time that lapses between two successive read operation .
Cycle rate (rc)= bandwidth = 1/tc
Email: [email protected]
24
Microprocessors
If capacity increases, access time increases (slower) and due to which cost per bit
decreases.
If access time decreases (faster), capacity decreases and due to which cost per
bit
increases.
The designer tries to increase capacity because cost per bit decreases and the more
application program can be accommodated. But at the same time, access time
increases
and hence decreases the performance.
So the best idea will be to use memory hierarchy.
Memory Hierarchy is to obtain the highest possible access speed while minimizing
the
total cost of the memory system.
Not all accumulated information is needed by the CPU at the same time.
Therefore, it is more economical to use low-cost storage devices to serve as a
backup for
storing the information that is not currently used by CPU
The memory unit that directly communicate with CPU is called the main memory
Devices that provide backup storage are called auxiliary memory
The memory hierarchy system consists of all storage devices employed in a computer
system from the slow by high-capacity auxiliary memory to a relatively faster main
memory, to an even smaller and faster cache memory
The main memory occupies a central position by being able to communicate directly
with
the CPU and with auxiliary memory devices through an I/O processor
A special very-high-speed memory called cache is used to increase the speed of
processing by making current programs and data available to the CPU at a rapid rate
CPU logic is usually faster than main memory access time, with the result that
processing
speed is limited primarily by the speed of main memory
The cache is used for storing segments of programs currently being executed in the
CPU
and temporary data frequently needed in the present calculations
The memory hierarchy system consists of all storage devices employed in a computer
system from slow but high capacity auxiliary memory to a relatively faster cache
memory
accessible to high speed processing logic. The figure below illustrates memory
hierarchy.
Compiled by: Er. Hari Aryal
Email: [email protected]
25
Microprocessors
Email: [email protected]
26
Microprocessors
Address decoding:
Microprocessor is connected with memory and I/O devices via common address
and data bus. Only one device can send data at a time and other devices can only
receive
that data. If more than one device sends data at the same time, the data gets
garbled. In
order to avoid this situation, ensuring that the proper device gets addressed at
proper
time, the technique called address decoding is used.
In address decoding method, all devices like memory blocks, I/O units etc. are
assigned with a specific address. The address of the device is determined from the
way in
which the address lines are used to derive a special device selection signal k/a
chip select
(CS). If the microprocessor has to write or to read from a device, the CS signal to
that
block should be enabled and the address decoding circuit must ensure that CS signal
to
other devices are not activated.
Depending upon the no. of address lines used to generate chip select signal for the
device, the address decoding is classified as:
1. I/O mapped I/O
In this method, a device is identified with an 8 bit address and operated by I/O
related
functions IN and OUT for that IO/M =1. Since only 8bit address is used, at most 256
bytes can be identified uniquely. Generally low order address bits A0-A7 are used
and
upper bits A8-A15 are considered don’t care. Usually I/O mapped I/O is used to map
devices like 8255A, 8251A etc.
2. Memory mapped I/O
In this method , a device is identified with 16 bit address and enabled memory
related
functions such as STA , LDA for which IO/M =0, here chip select signal of each
device is derived from 16 bit address lines thus total addressing capability is 64K
bytes . Usually memory mapped I/O is used to map memories like RAM, ROM etc.
Depending on the address that are allocated to the device the address decoding are
categorized in the following two groups.
Email: [email protected]
27
Microprocessors
If A0 is high and A1- A7 are low and if IOW becomes low, the latch gets enabled.
The data to the LED can be transferred in only one case and hence the device has
unique
address of 01H.
Eight I/P switch interfacing at 53H. (01010011)
Email: [email protected]
28
Microprocessors
If A0 is low and
is low. Then latch gets enabled.
Here A1-A7 is neglected that is any even address can enable the latch.
Q) Design an address decoding circuit for two RAM chips each of 256 bytes at
address
5300H.
- 256 bytes requires 8 address lines.
2x=256, x=8
So to address one of 256 bytes in each RAM requires 8 address lines A0-A7
Block
1
Start
End
2
Start
End
A9
1
1
0
1
A8 A7 A6 A5 A4 A3
1 0 0 0 0 0 0
1 1 1 1 1 1 1
0 0 0 0 0 0 0
1 1 1 1 1 1 1
A2
0
1
0
1
A1 A0
0
1
0
1
Address Decoding Circuit:
Email: [email protected]
29
Microprocessors
Q. Draw a circuit diagram to interface two 256 Byte memory chips at address
starting at
2050H and 3050H.
Q. Two 4 KB ROM at starting address 0000H
4 KB= 4X1KB = 22 X 210 =212 therefore we need 12 address lines
Address Decoding with 8086 Microprocessor
The 8086 microprocessor provides a 20 bit memory address that allows up to 1 MB
main
memory. Out of these several address lines are unused, but these extra lines
determine the range
of addresses the memory interface occupies. Address decoder circuit determines
these extra
address lines and enables the memory for a specific range of addresses. Depending
up on number
of lines used for decoder, we get
Full Decoding (Absolute Decoding): All the unused lines (zero lines) are used.
Partial Decoding (Linear Decoding): All the unused lines (zero lines) are not used.
Block Decoding: Same as full decoding except that in this case blocks of memory is
enabled using the unused lines.
Important Points to be considered for Memory Interfacing
After reset CS contains FFFFH and IP contains 0000H. Therefore, the physical
address is
FFFF0H. Here instruction execution starts from FFFF0H which is normally a jump from
some other location where a longer program resides. This program always resides in
a
ROM. For example, we want to interface 4 chips of 2K memory that means 8K bytes of
Compiled by: Er. Hari Aryal
Email: [email protected]
30
Microprocessors
memory requires 13 address lines A0 to A12. So, 8K means 01FFFH bytes, therefore
EPROM address starts from FFFFFH – 01FFFH = FE000H.
Since ROMs and EPROMs are read-only devices, A0 and BHE’ are not required to be
part of the chip enable/select decoding. The 8086 address lines must be connected
to the
ROM/EPROM chip starting with A1 and higher to all the address lines of the
ROM/EPROM chips. The 8086 unused address lines can be used as chip enable/select
decoding.
Since static RAMs are read/write memories, both A0 and BHE’ must be included in the
chip select/enable decoding of the devices and write timing must be considered in
the
compatibility analysis.
End:
1 1 1 1 1 1
Used for Chip Select
0
0
1 1 1 1 1 1 1
Address within the 16KB
Email: [email protected]
31
Microprocessors
A0 and BHE’ is not used for interfacing of EPROM. Both the 8 KB EPROM chips are
selected
whenever any address in the range FC000H – FFFFFH comes on the address bus.
Static RAM Interfacing with 8086
The general procedure of static memory interfacing with 8086 is briefly described
as follows.
Arrange the available memory chips so as to obtain 16 bits data bus with the upper
8 bit
bank is called “Odd address memory bank” and the lower 8 bit bank is called “Even
address memory bank”.
Connect available memory address lines of memory chips with those of the
microprocessor and also connect the memory RD’ and WR’ inputs to the corresponding
processor control signals. Connect the 16 bit data bus of the memory bank was that
of
microprocessor 8086.
The remaining address lines of the microprocessor, BHE’ and A0 are used for loading
the
required chip select signals for the odd and even memory banks. The CS’ of the
memory
is derived from the O/P of the decoding.
End:
Start:
End:
0
1
1 1 1
Block A
0
0
1 1 1
Block B
Email: [email protected]
32
Microprocessors
As a good and efficient interfacing practice, the address map of the system should
be continuous
as far as possible i.e. these should be no windows and no feedback space should be
allowed. A
memory location should have a single address corresponding to it i.e. absolute
decoding should
be preferred.
Q) Interface two 4K X 8 EPROMs and two 4K X 8 RAM chips with 8086, select suitable
maps.
We know that, after reset, the IP and CS are initiated to from address FFFF0H.
Hence this
address must lie in the EPROM. The address of RAM may be selected anywhere in the
1MB
space of 8086, but we will select the RAM address such that the address map of the
system is
continuous as shown in table below.
Address
FFFFFH
FE000H
A
A
19 18
1
1
EPROM
1
1
FDFFFH 1
1
RAM
FC000H 1
1
A
17
1
A
16
1
A
15
1
A
A
14 13
1
1
8K X 8
1
1
A
12
1
A
11
1
A
10
1
A A A A A A A A A A
9 8 7 6 5 4 3 2 1 0
1 1 1 1 1 1 1 1 1 1
0 0 0 0 0 0 0 0 0 0
0
1
8K X 8
1
0
0
1 1 1 1 1 1 1 1 1 1
0
0
0 0 0 0 0 0 0 0 0 0
Total 8K of EPROM need 13 address lines A0-A13 (Since 213 = 8K). Address lines A13-
A19 are
used for decoding to generate the chip select. The BHE’ signal goes low when a
transfer is at odd
address or higher byte of data is to be accessed, let us assume that the latched
address, BHE’ and
de-multiplexed data lines are readily available for interfacing.
The two 4K X 8 chips of RAM and EPROM are arranged in parallel to obtain 16-bit
data bus
width. If A0 is 0 i.e. the address is even and is in RAM, then the lower RAM chip
is selected
Compiled by: Er. Hari Aryal
Email: [email protected]
33
Microprocessors
indicating 8-bit transfer at even address. If A0 is 1 i.e. the address is odd and
is in RAM, the
BHE’ goes low, the upper RAM chip is selected further indicating that the 8 bit
transfer is at an
odd address. If the selected addresses are in ROM, the respective ROM chips are
selected. If at a
time A0 and BHE’ both are zero, both the RAM or ROM chips are selected i.e. the
data transfer
is of 16 bits. The selection of chips takes place as shown in table below.
Decoder I/P
Address / BHE’
Word transfer on
D0-D15
Byte transfer on
D0-D7
Byte transfer on
D8-D15
Word transfer on
D0-D15
Byte transfer on
D0-D7
Byte transfer on
D8-D15
A2
A13
0
A1
A0
0
A0
BHE’
0
1
0
Email: [email protected]
Selection /
Comment
Even and Odd
address in RAM
Only even
address in RAM
Only odd address
in RAM
Even and Odd
address in ROM
Only even
address in ROM
Only odd address
in ROM
34
Microprocessors
35
Microprocessors
2. Parallel Interface
The device which can handle data at higher speed cannot support with
serial interface.
N bits of data are handled simultaneously by the bus and the links to the
device directly.
Achieves faster communication but becomes expensive due to need of
multiple wires.
Synchronizing the computer with peripherals:
The information exchanged between a microprocessor and an I/O interface circuit
consists of input or output data and control information. The status information
enable the
microprocessor monitor the device and when it is ready then send or receive data.
Control
information is the command by microprocessor to cause I/O device to take some
action.
If the device operates at different speeds, then microprocessor can be used to
select a
particular speed of operation of the device. The techniques used to transfer data
between
different speed devices and computer is called synchronizing. Different techniques
under
synchronizing are:
Email: [email protected]
36
Microprocessors
1) Simple I/O
For simple I/O, the buffer switch and latch switches i. e. LED are always connected
to
the input and output ports. The devices are always ready to send or receive data.
Here cross line indicate the time for new valid data.
2) Wait Interface( Simple strobe I/O)
In this technique, MP need to wait until the device is ready for the operation.
Used to convert analog to digital data which can be read by I/O unit of MP
When SOC appears 1, I/O unit should ready for reading binary data/digital data.
When EOC’s status is 1, then I/O unit should stop to read data.
Strobe signal indicates the time at which data is being activated to transmit.
Email: [email protected]
37
Microprocessors
3) Single Handshaking:
Email: [email protected]
38
Microprocessors
Port-C (8-pins) has different assignments depending on the mode of port-A and port-
B.
If port-A and B are programmed in mode-0, then the port-C can perform any one of
the
following functions.
As 8-bit parallel port in mode-0 for input or output.
As two numbers of 4-bit parallel ports in mode-0 for input or output.
The individual pins of port-C can be set or reset for various control
applications.
If port-A is programmed in mode- 1/mode-2 and port-B is programmed in mode-1 then
some of the pins of port-C are used for handshake signals and the remaining pins
can be
used as input/ output lines or individually set/reset for control application.
Email: [email protected]
39
Microprocessors
3. RESET: This is an active high signal. It clears the control register and set all
ports
in the input mode.
4. CS (low), A0 and A1: These are device select signals. They are,
Email: [email protected]
40
Microprocessors
Each data unit must contain start and stop bits for indicating beginning and the
end of
data unit. And also one parity bit to identify odd or even parity data.
For e.g. To send ASCII character (7 bit)
We need:
1 start bit: beginning of data
1 stop bit: End of data
1 Parity bit: even or odd parity
7 or 8 bit character: actual data transferred
Email: [email protected]
41
Microprocessors
Receiver
Data bus buffer
Modem control.
Email: [email protected]
42
Microprocessors
The transmitter section is double buffered, i.e., it has a buffer register to hold
an 8-bit
parallel data and another register called output register to convert the parallel
data into
serial bits.
When output register is empty, the data is transferred from buffer to output
register. Now
the processor can again load another data in buffer register.
If buffer register is empty, then TxRDY is goes to high.
If output register is empty then TxEMPTY goes to high.
The clock signal, TxC (low) controls the rate at which the bits are transmitted by
the
USART.
The clock frequency can be 1,16 or 64 times the baud rate.
Receiver Section:
The receiver section accepts serial data and convert them into parallel data.
The receiver section is double buffered, i.e., it has an input register to
receive serial data
and convert to parallel, and a buffer register to hold the parallel data.
When the RxD line goes low, the control logic assumes it as a START bit, waits
for half
a bit time and samples the line again.
If the line is still low, then the input register accepts the following bits,
forms a character
and loads it into the buffer register.
The CPU reads the parallel data from the buffer register.
When the input register loads a parallel data to buffer register, the RxRDY line
goes high.
The clock signal RxC (low) controls the rate at which bits are received by the
USART.
During asynchronous mode, the signal SYNDET/BRKDET will indicate the break in the
data transmission.
During synchronous mode, the signal SYNDET/BRKDET will indicate the reception of
synchronous character.
MODEM Control:
The MODEM control unit allows to interface a MODEM to 8251A and to establish data
communication through MODEM over telephone lines.
This unit takes care of handshake signals for MODEM interface.
Email: [email protected]
43
Microprocessors
second. The term “change state” means that it can change from 0 to 1 or from 1 to 0
up to X (in
this case, 2400) times per second. It also refers to the actual state of the
connection, such as
voltage, frequency, or phase level).
The main difference between the two is that one change of state can transmit one
bit, or slightly
more or less than one bit, that depends on the modulation technique used. So the
bit rate (bps)
and baud rate (baud per second) have this connection:
If signal is changing every 10/3 ns then,
Baud rate = 1/10/3ns
= 3/10*109
= 3*108
= 300 mbd
Note:
If 1 frame of data is coded with 1 bit then band rate and bit rate are same.
Sometimes frame of data are coded with two of three bits then baud rate and bit
rate are
not same.
RS -232
Serial transmission of data is used as an efficient means for transmitting digital
information across long distances, the existing communication lines usually the
telephone
lines can be used to transfer information which saves a lot of hardware.
RS-232C is an interface developed to standardize the interface between data
terminal
equipment (DTE) and data communication equipment (DCE) employing serial binary
data exchange. Modem and other devices used to send serial data are called data
communication equipment (DCE). The computers or terminals that are sending or
receiving the data are called data terminal.
Equipment (DTE) RS- 232C is the interface standard developed by electronic
industries
Association (EIA) in response to the need for the signal and handshake standards
between the DTE and DCE.
It uses 25 pins (DB – 25P) or 9 Pins (DE – 9P) standard where 9 pin standard does
not
use all signals i. e. data, control, timing and ground.
It describes the voltage levels, impendence levels, rise and fall times, maximum
bit rate
and maximum capacitance for all signal lines.
It also specifies that DTE connector should be male and DCE connector should be
female.
It can send 20kBd for a distance of 50 ft.
The voltage level for RS-232 are:
o A logic high or 1 ,
3V to -15V
o A logic low or 0,
+3v to +15v
Normally ±12V voltage levels are used
Email: [email protected]
44
Microprocessors
Flow
DTE to DCE
DCE to DTE
DTE to DCE
DCE to DTE
DCE to DTE
Common ref
DCE to DTE
DTE to DCE
DE-9P
3
2
7
8
6
5
1
4
DB-25P
2
3
4
5
6
7
8
20
Signal
TxD
RxD
GND
Email: [email protected]
Description
Transmitted data
Received data
Request to send
Clear to send
Data set ready
Signal ground
Data carrer detect
Data terminal ready
45
Microprocessors
DTE asserts
to tell the modem it is ready.
Then DCE asserts
signal to the terminal and dials up.
DTE asserts
signal to the modem.
Modem then asserts
signal to indicate that it has established connection with the
computer.
DCE asserts
signals, then DTE sends serial data.
When sending completed, DTE asserts
high, this causes modem to unassert its
signal and stop transmitting similar handshake taken between DCE and DTE other
side.
To communicate from serial port of a computer to serial port of another computer
without
modem, null-modem is used.
Email: [email protected]
46
Microprocessors
RS 422A
- A newer standard for serial data transfer.
- It specifies that can signal will be send differentially over two adjancent wires
in a ribbon
cable or a twisted pair of wires uses differential amplifier to reject noise.
Email: [email protected]
47
Microprocessors
The direct memory access (DMA) technique provides direct access to the memory while
the microprocessor is temporarily disabled.
A DMA controller temporarily borrows the address bus, data bus, and control bus
from
the microprocessor and transfers the data bytes directly between an I/O port and a
series
of memory locations.
The DMA transfer is also used to do high-speed memory-to memory transfers.
Two control signals are used to request and acknowledge a DMA transfer in the
microprocessor-based system.
The HOLD signal is a bus request signal which asks the microprocessor to release
control
of the buses after the current bus cycle.
Email: [email protected]
48
Microprocessors
The HLDA signal is a bus grant signal which indicates that the microprocessor has
indeed released control of its buses by placing the buses at their high-impedance
states.
The HOLD input has a higher priority than the INTR or NMI interrupt inputs.
Email: [email protected]
49
Microprocessors
It is a device to transfer the data directly between IO device and memory without
through the
CPU. So it performs a high-speed data transfer between memory and I/O device.
The features of 8257 is,
The 8257 has four channels and so it can be used to provide DMA to four I/O
devices.
Each channel can be independently programmable to transfer up to 64kb of data by
DMA.
Each channel can be independently perform read transfer, write transfer and verify
transfer.
The functional blocks of 8257 as shown in the above figure are data bus buffer,
read/write logic,
control logic, priority resolver and four numbers of DMA channels.
Operation of 8257 DMA Controller
Each channel of 8257 has two programmable 16-bit registers named as address
register
and count register.
Address register is used to store the starting address of memory location for DMA
data
transfer.
The address in the address register is automatically incremented after every
read/write/verify transfer.
The count register is used to count the number of byte or word transferred by DMA.
In read transfer the data is transferred from memory to I/O device.
In write transfer the data is transferred from I/O device to memory.
Verification operations generate the DMA addresses without generating the DMA
memory and I/O control signals.
The 8257 has two eight bit registers called mode set register and status register.
Email: [email protected]
50