Manual 104-AIO16A and 104-AIO16E
23
Base A 19
(write)
Calibration access
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
data
X X X X X X
SClk
The board contains 4 digital potentiometers used to calibrate the device. The four calibration corrections
provided are: A/D Offset (00), A/D Gain (01), Gain for DAC0 (10), and DAC1 (11). These four corrections
are internally addressed 0, 1, 2, and 3. Each calibration correction consists of a value from 0 - 255 (8 bits)
corresponding to the internal value of the digital potentiometer.
A/D Offset corresponds to the “B” in a Y=mX+B equation. A/D Gain is the “m” term of the same equation.
DAC Gain represents “m” in the equation Y=mX. The nature of the DAC circuitry eliminates the need to
provide offset (B) calibration.
The value you load into these calibration potentiometers is normally read from the EEPROM and written
here only during program initialization, and only needs to be written once per power-on cycle.
To load one of the calibration correction values you must write the address (0-3) of the correction you
wish to load, the 8-bit value you wish to load, and an End byte.
Similar to the operation of the EEPROM, the calibration correction values are loaded serially into the
digital potentiometers in the board. Therefore, to load a value of 4F into the A/D Gain potentiometer, the
following writes are performed:
Write
Value
Description
1 1xxxxxx0=80
Enable code. Always write 80 as the 1
st
byte
2
0
xxxxxx1=
0
1
3
1
xxxxxx1=
8
1
These two bits are the address of the potentiometer to write. 00 is A/D offset,
01 is gain, 10 is DAC0 gain, 11 is DAC1 gain. Write 2 is MSB, Write 3 is LSB.
4
0
xxxxxx1=
0
1
MSB of data. Bit D7 of Write 4 should be the D7 bit of the calibration
correction value you are loading.
5
1
xxxxxx1=
8
1
D7 should be bit D6 of the calibration value
6
0
xxxxxx1=
0
1
D7 should be bit D5 of the calibration value
7
0
xxxxxx1=
0
1
D7 should be bit D4 of the calibration value
8
1
xxxxxx1=
8
1
D7 should be bit D3 of the calibration value
9
1
xxxxxx1=
8
1
D7 should be bit D2 of the calibration value
10
1
xxxxxx1=
8
1
D7 should be bit D1 of the calibration value
11
1
xxxxxx1=
8
1
D7 should be bit D0 of the calibration value
12
0xxxxxx1=01
End. Always Write 00 as the last step
For ease of reference the bits which can change are typeset in
bold
.
For details on the operation of the Digital Potentiometer, refer to the Analog Devices AD8403 datasheet.
Base A 1A
Unused
Base A 1B
(write)
Reset Register
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
X X X
masterReset
dacReset
dioReset
digPotReset
fifoReset
Writing to this address will reset the following:
fifoReset
Æ
‘0’ = N/A
‘1’ = reset the A/D Data FIFO
digPotReset
Æ
‘0’ = N/A
‘1’ = reset the digital calibration potentiometers
dioReset
Æ
‘0’ = N/A
‘1’ = reset the 8255 Port A and Port B
dacReset
Æ
‘0’ = N/A
‘1’ = reset the DACs back to zero
masterReset
Æ
‘0’ = N/A
‘1’ = reset all of the above + all configuration addresses