
PIO-D144 User’s Manual
Version: 2.1 Date: 1999/10 Page 37
/* 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 a DB-24C
into CN1 ~ CN6 of PIO-D144. This demo will request the user to input a number K as
following:
If the DB-24C is installed in CN1
!
!
!
!
key in 0
If the DB-24C is installed in CN2
!
!
!
!
key in 3
If the DB-24C is installed in CN3
!
!
!
!
key in 6
If the DB-24C is installed in CN4
!
!
!
!
key in 9
If the DB-24C is installed in CN5
!
!
!
!
key in 12
If the DB-24C is installed in CN6
!
!
!
!
key in 15
Then this demo program will test D/O of PA, PB, PC sequentially.
ГК
Атлант
Инжиниринг
–
официальный
представитель
в
РФ
и
СНГ
+7(495)109-02-08 [email protected] www.bbrc.ru