Professional Documents
Culture Documents
8 8
Data Port A
RD 8
Port B
WR
RESET 4
{
CH
Port
CS 4
C CL
A1
A0
Addressing the 8255
From IO.EQU
PORT2A = 0224h ;Port A externally available
PORT2B = 0225h ;Port B externally available
PORT2C = 0226h ;Port C externally available
STAT2 = 0227h ;8255-5 # 2A / Status Register
Interfacing the 8255
20
8088
Address Only
A19
A18 Address/Data
A17 AD7
A16 AD6
A15 AD5
Address and Data lines
A14 + AD4
are multiplexed in the
A13 AD3
8088
A11 AD1
A10 AD0
A9
A8
Address and Data Buses
20
8088 Address 20-bit address bus
Latch
ALE
8
{
A15 CH
Logic Port
-A2 CS 4
Circuit C
A1 CL
A1
A0
A0
Logic Circuit
• Inputs to the Logic Circuit
– address lines A15 - A2
(the I/0 address space is 216 addresses, and A1 and A0 are
used for the chip’s address lines)
– the 8088’s IO/M line
HIGH denotes an IO instruction (IN, OUT)
LOW denotes a memory access instruction (i.e., MOV)
IO/M
RD and WR
Minimum mode
• In minimum mode, the 8088 is the only microprocessor in
the circuit. It can assume that it has control of memory,
address, and data buses
• In maximum mode, the 8088 is configured for multiple
microprocessors. The function of pins is changed to
provide processor-to-processor communication
8255 PPI
(Programmable Peripheral Interface)
(Parallel Port Interface)
8 8
Data Port A
RD 8
Port B
WR
RESET 4
{
CH
Port
CS 4
C CL
A1
A0
Reset
• A single reset line is connected to all chips in the system
(8088, 8255, 8253, etc.)
• Reset puts the chip in a known state
• Pushing the reset button on your computer generally
activates a 555 timer circuit that outputs a high pulse for a
short period of time
• On Reset, the 8088 goes to fixed addresses (ROM chips)
where boot sequence instructions are stored.
A/D
• Step 1: Call SetupAD
• Step 2: Mov al, channel#
Mov dx, WRTCH1
Out dx, al
• Step 3: Mov dx, STBAD1
Out dx, al ; or IN dx, al
• Step 4: Mov CX, delaycount
L1: Loop L1
• Step 5: Mov dx, RDCH1
IN al, dx
A/D #2
• After an A/D value is read, many algorithms will need to
compare the analog voltage to some target analog voltage
• For the computers in Anderson 307, the conversion is 18
mv per 1-bit change.
• If Vtarget is the target voltage in volts, it must be
converted to a target count
Multiply Vtarget * 1000 ; target in millivolts
Divide target by 18 ; equivalent count
• Careful use of word-wide vs. byte-wide multiply and
divide is essential
• For critical applications may need to investigate remainder
to round count to nearest integer.
D/A
• A voltage proportional to the count appears on the D/A
output
Mov dx, DAC#
Mov al, dacount
Out dx,al