Omega OME-PIO-D144 User Manual

Page 40

Advertising
background image

/* CN1 : K=0/1/2 --> key in 0 */

/* CN2 : K=3/4/5 --> key in 3 */

/* CN3 : K=6/7/8 --> key in 6 */

/* CN4 : K=9/10/11 --> key in 9 */

/* CN5 : K=12/13/14 --> key in 12 */

/* CN6 : K=15/16/17 --> key in 15 */

printf("\nk="); scanf("%d",&k);

for (jj=k; jj<(3+k); jj++) /* PA/PB/PC */

{

outp(wBase+0xc4,jj); /* select the active port */

printf("\nSelect Port-%d",jj);

outp(wBase+0xc0,0x55); /* D/O=0x55 */

printf(", D/O=0x55"); getch();

outp(wBase+0xc0,0xAA); /* D/O=0xAA */

printf(", D/O=0xAA"); getch();

outp(wBase+0xc0,0x1); getch(); /* PA0/PB0/PC0 */

outp(wBase+0xc0,0x2); getch(); /* PA1/PB1/PC1 */

outp(wBase+0xc0,0x4); getch(); /* PA2/PB2/PC2 */

outp(wBase+0xc0,0x8); getch(); /* PA3/PB3/PC3 */

outp(wBase+0xc0,0x10); getch(); /* PA4/PB4/PC4 */

outp(wBase+0xc0,0x20); getch(); /* PA5/PB5/PC5 */

outp(wBase+0xc0,0x40); getch(); /* PA6/PB6/PC6 */

outp(wBase+0xc0,0x80); getch(); /* PA7/PB7/PC7 */

}

PIO_DriverClose();

}



This demo program is designed for CN1 ~ CN6. The user can install an OME-

DB-24C into CN1 ~ CN6 of OME-PIO-D144. This demo will request the user to
input a number K as following:

If the OME-DB-24C is installed in CN1 Æ key in 0
If the OME-DB-24C is installed in CN2
Æ key in 3
If the OME-DB-24C is installed in CN3
Æ key in 6
If the OME-DB-24C is installed in CN4
Æ key in 9
If the OME-DB-24C is installed in CN5
Æ key in 12
If the OME-DB-24C is installed in CN6
Æ key in 15
Then this demo program will test D/O of PA, PB and PC sequentially.

OME-PIO-D144 User’s Manual (Ver.2.1, Sep/2001)

---- 38

Advertising