Operations Manual
PCI bus multi-8255/8254 adapter
6.2 C Programming
#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();
頁碼
DECISION Computer International
頁
碼