UNIT 6
OBJECTIVE
General Objective:
Specific Objectives:
INPUT-6A
6.0 INTRODUCTION
Main Program
1. Maskable Interrupt
- interrupt signals that can be received or not by
microprocessor, depends on priority.
2. Nonmaskable Interrupt
- interrupt signal that must be received by the
microprocessor.
The 8085A has two pins used for DMA. These are the HOLD
and HLDA (hold acknowledge). The HOLD signal is recived by
the 8085A from an external source.
6.1.4 Hand-shaking
For the MCS-85 system, the 8155 can be used for handshake
transfer of data. The three ports of 8155 as an example were
configured as simple input or output ports; figure 6.3 shows the
block of the 8155 RAM. Port C can also be used for control and
status signals when a port A and B are used in the handshake
mode.
IO/M
PORT A
AD0-7 8 PA0-7
256 x 8 A
STATIC
RAM
*
ALE PORT B
8 PB0-7
B
RD
WR
TIMER
C 8 PC0-5
RESET
ACTIVITY – 6A
6A-1. Under the unconditional I/O transfers, how can data be transfered
between MPU and I/O devices.
6a-4. Describe about the Hardware interrupt and software interrupt and how
is software interrupt initiated.
1. Maskable Interrupt
- Interrupt signals that been receive or not by
microprocessor.
3. Nonmaskable Interrupt
- interrupt signal that must be recive by the
microprocessor.
FEEDBACK TO ACTIVITY – 6A
6A-1. Under the unconditional I/O transfers, how can data be transfered
between MPU and I/O devices.
MPU and I/O can be initiated either by the MPU or by the devices.
6a-4. Describe the Hardware interrupt and software intrrupt and how
software interrupt initiated.
1. Maskable Interrupt
- interrupt signals that has been recived or not by
microprocessor.
4. Nonmaskable Interrupt
- interrupt signal that must be recived by the
microprocessor.
INPUT-6B
Series technique
Computer of transfer
Computer B
A
- Every data bit have its own line and been transfered
simultaneously.
- Data transfer in synchronous either in form of byte,
word or longword.
- Much faster data transfer.
- Usually used if the speed are count.
- This transfer methods used to transfer data in the
computer between;
Disadvantage
Parallel data
transfer (4 bit)
Computer
Printer
Parellel Interface
PORT A (output)
Data Bus
Consist of two part which are the “CPU Side” and “peripheral
Side"
- CPU and PIA are connected through data bus, address bus
and control bus.
Serial Interface
- ACIA are the main source for series data, the function is to
interface between series and parellal data.
- The data which came through ACIA are in series, this data
will be store in data register before synchronously sent in
parallel as shown below,
Data series 7 6 5 4 3 2 1 0
input
Peripheral
Computer UART
Devices
In time
Figure 6.5 A serial data signal is divided into serialintervals
data called
bit times communication, the
terms mark and space
are often used to
(Source: Ronald J. Tocci; page 422; figure 9.6)
represent logic 1 and 0,
respectively. This
terminology is a carry-
over from the use of
Morse code in
telegraphy.
E3165 / UNIT 6 / 15
INPUT/OUTPUT AND INTERFCE
For given a system, the number of data bits, the parity-bit option,
and the number of STOP bit are fixed by the design. Figure 6.6B
shows ans example of a serial data word that uses 7 data bits,
an even parity bit, and 2 STOP bits. This is the format used by
most terminals, where the 7 data bits are the ASCII code for the
alphanumaric character being transmitted.The completed serial
data word in figure 6.6B begins with a START bit of 0.
• The signal line is assumed to be transmitted a constant
HIGH level prior to the START bit. This is called marking or
idling. Whenever data word is not being trnasmitted, the
signal line will always be marking.
• Thus, the beginning of each transmitted data word is
characterized by a I to 0 transition when the START bit
occurs.
• Here the Start bit is followed by 7 bits of data, beginning
with the LSB and ending with the MSB, thus, the actual data
transmitted here are read as 1001011, which happens to be
the ASCII code for the letter K.
• The data bits are followed by an even-parity bit; in this case
it is a 0, since the 7 bits of data contain an even number of
1s. the parity bit is followed by 2 STOP bits, which are
always 1s.
E3165 / UNIT 6 / 16
INPUT/OUTPUT AND INTERFCE
Baud Rate
The term baud is use to identify the rate at which the data signal
is changing in a serial communication system. In general, the
the baud is given by
If, for instance, the signal is changing every 1 ms, the baud rate
would be 1/1ms = 100 Baud.
E3165 / UNIT 6 / 17
INPUT/OUTPUT AND INTERFCE
Data Rate = 1
(bita/s)
TB
If TB = 1 ms, the data rate becomes 1000 bits/s. the baud rate
ia also 1000 because the time between signal transition is equal
to 1 ms. Thus, in this simple serial data format the baud rate and
data rate are the same, although they are expressed in different
units – 1000 bits/s versus 1000 Baud.
Example 1
A certain video display terminal is operating at a baud rate of
9600 using the standard asynchronous serial format. What is the
time duration of one bit in the serial data going to and from from
this terminal?
Solution;
For this situation the baud rate and data rate are the same.
Thus, since data rate = 9600 bits/s, the bit time will be 1/9600 =
104.17 µ s.
E3165 / UNIT 6 / 18
INPUT/OUTPUT AND INTERFCE
ACTIVITY – 6B
6B-4. Named two example of parallel interface chip that you know
6B-5. Named two example of serial interface chip that you know
6B-8. In serial data communication, the term mark and space are represent
logic?
6B-9 .Describe three or four parts which took place as a format during data
transmite?
6B-10. show/draw the block diagram and labeled which, stop bit, data bit,
even bit and 2 stop bit – example of a serial data words that uses 7
data bits.
6B-11. Create or show the start bits, data bits, even bits and 2 stop bits for
letter A – refer the ASCII
E3165 / UNIT / 21
INPUT/OUTPUT AND INTERFACE
6B-13. What is the Baund Rate if Time Between Transition is 0.5 ms.
FEEDBACK TO ACTIVITY – 6B
- every data bit has its own line and been transfer
simultaneously.
- Data transfer in synchronous either in form of byte,
word or longword.
- Much faster data transfer.
- Usually used if the speed are counted.
- This transfer methods used to transfer data in the
computer between;
Disadvantage
Parellel data
transfer (4 bit)
Computer
Printer
E3165 / UNIT / 23
INPUT/OUTPUT AND INTERFACE
6B-5. Named two example parallel interface chip that you know
6B-6. Name two examples of serial interface chip that you know
6B-9. In serial data communication, the term mark and space are represent
logic?
6B-10 .Describe three or four parts which took place as a format during data
transmite?
6B-11. Show/draw the block diagram and lebeled which, stop bit, data bit,
even bit and 2 stop bit – example of a serial data words that uses 7
data bits.
6B-12. Create or show the start bits, data bits, even bits and 2 stop bits for
letter A – refer the ASCII
6B-14. What is the Baund Rate if Time Between Transition is 0.5 ms.
INPUT-6C
This allows the choice then of the communicating with one of six
different registers; two data direction registers, two control
registers, and two output registers. The REGISTER SELECT and
CHIP SELECT input operate in the same manner as those of the
6850 UART.
PPI 8255A
(CS)
Chip Select. A “low’ on this input pin enables the
communication between the 8255A, and the CPU.
(RD)
Read. A “low” on this Input pin enables the 8255A to send
the data or status information to the CPU on the data bus.
In essence, it allows the CPU to “read from the 8255A.
(WR)
Write. A. “ low” on the input pin enables the CPU to write
data or control words into the 8255A.
INPUT OPERATION
A1 A0 RD WR CS (READ)
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
OUTPUT OPERATION
(WRITE)
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
DISABLE FUNCTION
X X X X 1 DATA BUS - 3 STATE
1 1 0 1 0 ILLEGAL CONDITION
X X 1 1 0 DATA BUS - 3 STATE
(RESET)
Reset. A “high” on this Input clears the control register
and all ports (A, B, C) are set to the Input mode.
Ports A, B, and C
The 8255A contains three 8-bit ports (A , B, and C). All
can be configured in a wide variety of functional
characteristics by the system software but each has its
own special features or personally to further enhance the
power and flexibility of the 8255A.
6c-3. How can the data transfer take place by using the 6821 for
conditional transfer.
6C-4. In PPI 8255A, define the function READ/WRITE and Control logic
E3165 / UNIT / 31
INPUT/OUTPUT AND INTERFACE
FEEDBACK TO ACTIVITY – 6C
6c-3. How can the data transfer take place by using the 6821 for
conditional transfer.
6C-4. In PPI 8255A, define the function READ/WRITE and Control logic
The function of this block is to manage all of the Internal and External
transfers of both Data and Control or Status words. It accepts inputs
from the CPU Address and Control business and in turn, issues
commands to both of the Control Groups.
E3165 / UNIT / 32
INPUT/OUTPUT AND INTERFACE
INPUT-6D
6.4.1 ADC/DAC
We can use this to calculate Vout for any value of digital input. For
example, with a digital input of 11002 = 1210 we obtain
Vout = 1 v X 12 = 12 v
Example 2
Solution
Iout = (0.5 mA ) x 29
= 14.5 mA
You may have already figured out the resolution (step size) is
the same as the proportionality factor in the Dac input/output
relationship.
Solution
The motor speed will range from 0 to 1000 rpm as the DAC goes from
zero to full scale. Each step in the DAC output will produce a
step in the motor speed. We want the step size to be no greater
than 2 rpm. Thus we need at least 500 steps (1000/2). Now we
must determine how many bits are required so that there are at
least 500 steps from zero to full scale. We know that the
number of steps is 2N – 1, and so we can say
2N - 1 ≥ 500
or
2N - 1 ≥ 501
ACTIVITY – 6D
6D-6. Using the analog output formula,assuming K 1v, what is the Vout for
digital input 0110?
E3165 / UNIT / 40
INPUT/OUTPUT AND INTERFACE
FEEDBACK TO ACTIVITY – 6D
The analog signal from the DAC is often connected to some device
or circuit that serves as an actuator to control the physical variable.
6D-6. Using the analog output formula,assuming K 1v, what is the Vout for
digital input 0110?
V out = 1 v X 6 ( 0110 ) = 6 v.
E3165 / UNIT / 41
INPUT/OUTPUT AND INTERFACE
SELF-ASSESSMENT 1
U1
You are approaching success. Try all the questions in this self-
assessment section and check your answers with those given in the
Feedback on Self-Assessment 1 given on the next page. If you face
any problem, discuss it with your lecturer.
Good Luck
Question 1:
1. With the help of diagram, derive point by point on how interrupt is
initiated?
1. When a microprocessor receive interrupt request signal, the
process will proceed until it end cycle before entertain the interrupt
signal.
Main Program
3. In digital data transferring, explain what is serial data transfer with the
help of a diagram
Series technique
Computer of transfer
Computer B
A
E3165 / UNIT / 43
INPUT/OUTPUT AND INTERFACE
1. Takes an 8-bit parellel data word from the MPU data bus
and converts it to a serial data word to be sent to the serial
device
2. Takes a serial data from the serial device and converts it to
an 8-bit parellel data word that is transferred to the MPU via
data bus.
7. What is the largest value of output voltage from an 8-bit DAC that
produce 1 v for a digital input of 00110010?
001100102 = 5010
1v = K x 50
therefore = 20 mv
the largest o/p will occur for an i/p of 111111112 = 25510