DIO48S/AT-P Manual
Page 6-4
Manual 00650-526-1
Programming Example (Basic)
The following example in BASIC is provided as a guide to assist you in developing your working
software. In this example, the card base address is 2D0 hex and the I/O lines of group 0 are to be
setup as follows:
Port A = Input
Port C Hi = Input
Port B = Output
Port C Lo = Output
The first step is to configure the control register. Configure bits of the control register as:
D7
D6
D5
D4
D3
D2
D1
D0
1
0
0
1
1
0
0
0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|_Port C Lo= output
|
|
|
|
|
|
|
|
|
|
|
|
|
|______ Port B= output
|
|
|
|
|
|
|
|
|
|
|
|___________ Mode 0
|
|
|
|
|
|
|
|
|
|________________ Port C Hi= input
|
|
|
|
|
|
|
|_____________________ Port A= input
|
|
|
|
|
|__________________________ Mode 0
|
|
|
|_______________________________ Mode 0
|
|___________________________________ Active Mode Set
This corresponds to 98 hex. If the card address is 2D0 hex, use the BASIC OUT command to
write to the control register as follows:
10
BASEADDR=&H2D0
20
OUT B3,&H98
To read the inputs at Port A and the upper nybble of Port C:
30
X=INP(BASEADDR)
'Read Port A
40
Y=INP(B2)/16
'Read Port C Hi
To set outputs high (1) at Port B and the lower nybble of Port C:
50
OUT B1,&HFF
'Turn on all Port B bits
60
OUT B2,&HF
'Turn on all bits of Port C lower nybble
Summary of Contents for DIO48S/AT-P Series
Page 1: ...DIO48S AT P Series Product Manual MANUAL NUMBER 00650 526 1B...
Page 3: ...Page iv This page intentionally left blank...
Page 7: ...Page viii This page intentionally left blank...
Page 13: ...DIO48S AT P Manual Page 1 4 Manual 00650 526 1 Figure 1 1 DIO48S AT P Block Diagram...
Page 20: ...DIO48S AT P Manual Page 3 2 Manual 00650 526 1 Figure 3 1 DIO48S AT P Option Selection Map...