94 www.amctechcorp.com
As shipped, each ADC channel has a divide by 4 attenuator stage and a multiply by 2 amplifier stage. Thus for
a signal applied to analog input pins on the backplane, a count of 4095 will correspond to a voltage of 8.192V.
For the DAC, analog output 0 has a multiply by 2 gain stage, so a count of 4095 corresponds to a voltage of
8.192V. Analog output 1 has a 4-20 current output circuit, with a count of 0 corresponding to approximately
3.5mA and 4095 corresponding to about 25mA.
Sample Programs
The sample program fir.c demonstrates the use of the ADC and DAC of the IOdimm. The digital I/O functions
are demonstrated by the sample programs xor_iodimm.c and even_parity_iodimm.c.
fir.c will read analog input from a channel on the ADC. This input will be fed into a FIR filter, and then the output
is written to the DAC. The source code for fir.c is available in /opt/samples/card_specific/
iodimm/fir.
There are 29 coefficients h(k) used to calculate the digital output values, y(n), given the digitised input x(n)
using the summation
() () ( )
knxkhny
k
=
=
28
0
The filter is prototyped using a Hamming window given N=29, the finite impulse response given by:
() ()()()
=28
2cos46.054.0
14
1433.0sin n
n
n
nh
π
π
π
Note that:
(
)
k
x
kx
x
sin
lim
0
as shown by the Taylor expansion of sine

()

Κ++!7!5!3
sin
753 xxx
xx

() () () ()

Κ+
+
!7!5!3
sin 753
x
kx
x
kx
x
kx
x
kx
x
kx