ADwin-light-16
, manual version 2.2, December 2004
17
Inputs and Outputs
ADwin
Hardware addresses of the control and data registers
If you use the instructions PEEK and POKE ( (see
ADbasic
manual or online
help) you can directly access the control and data registers. This may accel-
erate the processing of the program, e.g.:
ADC
– a measurement can be executed very fast.
DAC
– you can write very quickly into one or more DAC registers, and you can
synchronously start the output.
Please make sure that the calculated analog outputs values are within the
range limits.
The hardware addresses of the registers can be found on the following page,
grouped as analog inputs, analog outputs, digital inputs/outputs and counters.
Please take into account that some registers have an influence on several pro-
cesses.
Address
Function
Bit n
o
Comment
[HEX]
31-16
15-10 9 8 7 6 5 4 3 2 1 0
20 40 00 00
set multiplexer to input channel
(ADC 01... ADC 15)
-
-
- - - - 0 0 0 n n n
"nnn" binary = 0...7 decimal;
selected channel = nnn*2 + 1
20 40 00 10 start conversion: ADC#1
-
-
- - - - - 1 1 1 1 s
s = 0 : start conversion
s = 1 : no effect
20 40 00 20 conversion status(EOC): ADC#1
-
-
- - - - - - - - - e
e = 0 :end conversion
e = 1 : conversion is running
20 40 00 30 read register: ADC#1
-
x
x x x x x x x x x x
x : result of the conversion
20 40 01 00
read register and start conversion:
ADC#1
-
x
x x x x x x x x x x
Fig. 13 – ADC hardware addresses of the control and data registers
Address
Function
Bit n
o
Comment
[HEX]
31-16
15-10 9 8 7 6 5 4 3 2 1 0
20 40 00 10
start conversion: all DAC synchro-
nously
-
-
- - - - - 1 1 s 1 1
s = 0 : start conversion
s = 1 : no effect
20 40 00 50 write only to the register: DAC #1
-
x
x x x x x x x x x x
x : digital value to be converted
20 40 00 60 write only to the register: DAC #2
-
x
x x x x x x x x x x
20 40 02 00
write to the register and start conversion
immediately: DAC #1
-
x
x x x x x x x x x x
20 40 02 10
write to the register and start conversion
immediately: DAC #2
-
x
x x x x x x x x x x
Fig. 14 – DAC hardware addresses of the control and data registers
Address
Function
Bit n
o
Comment
[HEX]
31:16
15:6
5 4 3 2 1 0
20 40 00 B0 input register DIGIN-05...DIGIN-00
-
-
x x x x x x x : digital value read in
20 40 00 C0 output register DIGOUT-05 ... DIGOUT-00
-
-
x x x x x x x : digital value to be output
20 40 00 C4 DIGOUT Bit-SET-Register
-
-
0 0 0 0 0 0 no effect
-
-
1 1 1 1 1 1 set bit
20 40 00 C8 DIGOUT Bit-CLEAR-Register
-
-
0 0 0 0 0 0 no effect
-
-
1 1 1 1 1 1 clear bit
Fig. 15 – DIO hardware addresses of the control and data registers