|
|
|
|
|
|
INTRODUCTION
The 8255 I/O card is
a programmable peripheral interface for PC/XT, PC/AT, 80386, 80486 or
compatible. The interface card contains 8253 chips and 8255 chips, the
8253 chip provides programmable interval timer/counter functions and
the 8255 chips provide programmable input/output functions.
The features of
the 8255 I/O card are:
*Programmable I/O
control functions.
*Up to 48 I/O lines.
*Maximum of 2MHZ
count rate.
*Three independent
16 bits counter.
*Support several
operating modes, which are Programmable.
*Sixteen LED
indicate when I/O is operating.
*Port address
selectable.
PACKAGE CONTENTS:
*8255/8253 I/O card.
*8255/8253 user's
manual.
*8255/8253terminator
board (option).
*Two expansion flat
cables (option).
HARDWARE CONFIGURATION
1.1 Configuration
for DIP Switch
Before you use the
8255 I/O card, you must ensure that the I/O address and the clock are
set correctly. Observe the figure below the proper settings for the
8255 I/O card are described in the following:
|
|
|
JP1-1 = Short (default) :
Select internal
clock to counter 0.
JP1-2 = Short
(default):
Select internal
clock to counter 1.
JP1-3 = Short
(default):
Select internal
clock to counter 2.
JP1-1 = Open:
Select external
clock to counter 0.
JP1-2 = Open:
Select external
clock to counter 1.
JP1-3 = Open:
Select external
clock to counter 2.
2.2 Hardware
Installation
Your 8255 I/O card
is design to be inserted in any available slot in your PC/XT or
compatibles. In order to gain access to the expansion slots and the
program switches on the main board, follow the steps listed below:
1.Set the 8255 I/O
card switch.
2.Turn off all power
of your computer and all peripheral devices before installing your 8255
I/O card.
3.Remove the cover
of the computer.
4.Insert your
pre-configured card into any available slot. Make sure your I/O card is
firmly seated in the chosen slot.
5.Replace the cover
of the computer.
6.You are now ready
to use your 8255 I/O card for several Applications.
2.3 Pin
Assignment
|
|
|
DIAGNOSTIC
The diagnostic
program is list in the following:
1. BASIC version
100 REM 8255 I/O
CARD TESTI
101 NG PROGRAM
110 SCREEN 0,0,0:
WIDTH 80,25: KEY OFF: CLS
120 LOCATE 10,10:
PRINT "8255 I/O CARD
TESTING"
130 LOCATE 12,10:
PRINT "TWO 8255 PORT A,B,C
OUTPUT SQUARE WAVE"
140 LOCATE 14,10:
PRINT "8253 COUNTER 0
DIVIDE BY 2"
150 LOCATE 16,10:
PRINT " COUNTER 1
DIVIDE BY 50"
160 LOCATE 18,10:
PRINT " COUNTER 2 DIVIDE
BY 100"
250 REM 8253 TESTING
255 PORT = &H1B0
260 OUT
PORT+11,&H36
270 OUT
PORT+11,&H76
280 OUT
PORT+11,&HB6
290 OUT
PORT+8,&H2: OUT PORT+8,&H0
300 OUT
PORT+9,&H32: OUT PORT+9,&H0
310 OUT
PORT+10,&H64: OUT PORT+10,&H0
320 PORT=&H1B0
330 OUT
PORT+3,&H80
340 A=0: GOSUB 500
345 FOR K= 0 TO
1000: NEXT K
350 A=&HFF:
GOSUB 500
360 PORT=PORT+4
370 OUT
PORT+3,&H80
380 A=0: GOSUB 500
385 FOR K=0 TO 1000:
NEXT K
390 A=&HFF:
GOSUB 500
400 GOTO 320
500 FOR I=0 TO 2
510 OUT PORT+I,A
520 NEXT I
530 RETURN
2. PASCAL version
Program
diagnostic(input, output);
uses
Crt;
var
a, i, test :
integer;
procedure subtest;
begin
for i := 0 to 2 do
port[test+i] := a;
end;
begin
{ 8255 I/O Card
Testing Program }
clrscr;
gotoxy(10, 10);
writeln('8255 I/O
CARD TESTING');
gotoxy(10, 12);
writeln('TWO 8255
PORT A,B,C OUTPUT SQUARE WAVE');
gotoxy(10, 14);
writeln('8253
COUNTER 0 DIVIDE BY 2');
gotoxy(10, 16);
writeln(' COUNTER 1
DIVIDE BY 50');
gotoxy(10, 18);
writeln(' COUNTER 2
DIVIDE BY 100');
{ 8253 Testing }
test := $1B0;
port[test+11] :=
$36;
port[test+11] :=
$76;
port[test+11] :=
$B6;
port[test+ 8] :=
$02; port[test+ 8] := $0;
port[test+ 9] :=
$32; port[test+ 9] := $0;
port[test+10] :=
$64; port[test+10] := $0;
repeat
test := $1B0;
port[test+3] :=
$80;
a := 0; subtest;
for i := 0 to 1000
do;
a := $ff; subtest;
test := test + 4;
port[test+3] :=
$80;
a := 0; subtest;
for i := 0 to 1000
do;
a := $ff; subtest
until keypressed;
end.
3. C version
#include
<stdio.h>
#include
<conio.h>
int test,i,a;
void subtest()
{
for(i=0;i<=2;i++)
outportb(test+i,a);
}
main()
{
clrscr();
gotoxy(10,10);
puts("8255 I/O CARD
TESTING");
gotoxy(10,12);
puts("TWO 8255 PORT
A,B,C OUTPUT SQUARE WAVE");
gotoxy(10,14);
puts("8253 COUNTER
0 DIVIDE BY 2");
gotoxy(10,16);
puts("8253 COUNTER
1 DIVIDE BY 50");
gotoxy(10,18);
puts("8253 COUNTER
2 DIVIDE BY 100");
test = 0x1b0;
outportb(test+11,0x36);
outportb(test+11,0x76);
outportb(test+11,0xb6);
outportb(test+
8,0x02);
outportb(test+
8,0x00);
outportb(test+
9,0x32);
outportb(test+
9,0x00);
outportb(test+10,0x64);
outportb(test+10,0x00);
do {
test = 0x1b0;
outportb(test+3,0x80);
a = 0;
subtest();
for(i=0;i<=1000;i++);
a = 0xff;
subtest();
} while(!kbhit());
}
|
|
|
|