ADwin-Gold
USB / ENET, manual version 3.8, October 2005
17
Inputs and Outputs
ADwin
5.3.2 Digital Inputs and Outputs
After power-up of the device all 4 connection groups are configured as inputs;
this corresponds to the instruction
CONF_DIO(0)
. The following table shows
how the inputs and outputs (IN, OUT) are configured when you use the value
of the first column as instruction argument.
Please pay attention to the following restriction:
Only if the inputs/outputs are configured with
CONF_DIO(12)
(see pin assign-
menton page 14) will you be able to fully access the inputs/outputs with the
instructions
DIGOUT_WORD
,
SET_DIGOUT
,
CLEAR_DIGOUT
,
DIGIN_WORD
,
DIGIN
.
For any other configuration you have to read out or write into the corresponding
hardware register (see instructions
PEEK
and
POKE
in the
ADbasic
manual).
CONF_DIO()
DIO31:24
DIO23:16
DIO15:08
DIO07:00
0
IN
IN
IN
IN
1
IN
IN
IN
OUT
2
IN
IN
OUT
IN
3
IN
IN
OUT
OUT
4
IN
OUT
IN
IN
5
IN
OUT
IN
OUT
6
IN
OUT
OUT
IN
7
IN
OUT
OUT
OUT
8
OUT
IN
IN
IN
9
OUT
IN
IN
OUT
19
OUT
IN
OUT
IN
11
OUT
IN
OUT
OUT
12
OUT
OUT
IN
IN
13
OUT
OUT
IN
OUT
14
OUT
OUT
OUT
IN
15
OUT
OUT
OUT
OUT
Applicable
instructions:
DIGOUT_WORD
,
CLEAR_DIGOUT
,
SET_DIGOUT
DIGIN_WORD
,
DIGIN
Instruction is
applicable for
DIOnn
, at
Configuration "OUT"
Configuration "IN"
At configuration "OUT" the register
contents of this byte is returned
Fig. 13 – Overview of the configuration with
CONF_DIO
Address
[HEX]
Function
Bit
Commentary
31:16 15:10 9 8 7 6 5 4 3 2 1 0
204001E0
Configure DIO07:00
0
0
0 0 0 0 0 0 -
-
- c
c = 0 : inputs
c = 1 : outputs
Configure DIO15:08
0
0
0 0 0 0 0 0 -
- c -
Configure DIO23:16
0
0
0 0 0 0 0 0 - c -
-
Configure DIO31:24
0
0
0 0 0 0 0 0 c -
-
-
204000B0 Input registers DIO15:00
-
x
x x x x x x x x x x
x : digital value read in
204001B0 Input registers DIO31:16
-
x
x x x x x x x x x x
204001C0 Output registers DIO15:00
-
x
x x x x x x x x x x
x : digital value to be output
204000C0 Output registers DIO31:16
-
x
x x x x x x x x x x
Fig. 14 – Hardware addresses of the control and data registers for the digital inputs / outputs