PA 358
Technical description Chapter 8
26
8.2 Programming
The board occupies the following addresses in the I/O space:
PA 358-4
8 bytes
PA 358-4C
8 bytes
PA 358-6
12 bytes
PA 358-6C
12 bytes
PA 358-8
16 bytes
PA 358-8C
16 bytes
Each analog output channel occupies 2 addresses, the first address for the lowbyte
and the second for the highbyte.
The values cannot be read back.
It is useful to store the last written value in a shadow register.
It does not matter whether you first write the highbyte or the lowbyte.
When the analog output value has to be changed, then the new digital value has to be
changed in both addresses.
The value is then written on the base address with a dummy I/O read command in the
DAC register.
1
st
example:
the value 2048 decimal should be written out on channel 0:
Program
SET_DAC_OUTPUT;
Const
Base = $390;
(*Base address of PA 358*)
Var
Dummy:Byte;
Value:Word;
Begin
Value
:= 2048;
Portw[Base] := Value;
(*Writes value on channel 0*)
Dummy
:= Port[Base];
(*Actualizes channel 0*)
End
2
nd
example:
A 0-10 V ramp should be written out on all 8 channels.
Program
Rampe;
CONST
Base = $390;
VAR
Value: Word;
Dummy,I:byte;
Begin
For Value:0 to 4095 DO
Begin
For I: = 0 to 7 DO
Begin
PortW[Base + 2*I]:=Value;
End;
Dummy: = Port[Base];
End