
Inputs and Outputs
ADwin
16
ADwin-light-16
, manual version 2.2, December 2004
Circle
Fig. 12 – Circle model for interpretation of counter values
5.4 Time-critical tasks
Time-critical tasks
For extremely time-critical tasks you can use instructions with which you have
direct access to control and data registers of the hardware (see
ADbasic
man-
ual or online help). These registers can be found in the memory address area
of the ADSP (memory mapped). These instructions also allow to optimize the
program structure.
Contrary to the standard instructions
ADC()
and
DAC()
the instructions for
direct access do not have any test routines. Before you use them you should
have good knowlegde about programming and time and function sequences in
an analog-to-digital converter, because you are now programming closely to
the hardware.
Analog inputs and outputs
ADC()
Execute the following
ADbasic
instructions instead of the standard instruction
ADC()
according to the following order:
Program structure
SET_MUX()
...
'
wait for settling time
START_CONV()
WAIT_EOC()
'
wait for end of conversion
READADC()
It is important to set a sufficient time-delay using additional programming
instructions between the instructions
START_CONV()
and
SET_MUX()
, in
order to consider the multiplexer settling time (see also
ADbasic
manual:
"Instruction Reference").
Use the waiting times shown below for instance for computing operations and
thus, save computing time:
– Settling time of the multiplexer: At a maximum voltage jump of 20 V it is
6.5 µs.
– Conversion time of the 16 bit ADC: 10 µs.
0000 0000h
FFFF FFFFh
7FFF FFFFh
8000 0000h
4000 0000h
3FFF FFFFh
BFFF FF
FFh
C000 00
00h
-1,073,741,824
-1,073,741,825
1,073,741,823 1,073,741,824
2,147,483,647
-2,147,483,648
0
-1
inside:
value of the
binary counter
outside: decimal number
in
ADbasic