This page describes the legacy mk3 disting. For the current product, please see here.
If in doubt, ask.
Calibration
Here you will find details of- How a disting is calibrated.
- How to use the calibration data in your own code.
Calibration Procedure
Calibration requires a 3V voltage reference. Any stable and accurate voltage source can be used. It's a good idea to let the whole system warm up for 5 minutes before calibrating to stabilise any temperature-dependent factors.The procedure is as follows:
- With the board powered up and with nothing connected to it, use the menu to select option 4, calibration. LEDs 1-3 & a-c will flash twice.
- Wait a few seconds for LED 'a' to light and LED ‘1’ to flash rapidly.
- Using patch cables (as short as possible), connect output A to input X, and output B to input Y.
- Press the encoder.
- After a short delay, all four jack sockets should light up red. After another short delay, LED ‘1’ will flash rapidly.
- Remove the patch cables. Connect the 3V voltage reference to input X.
- Verify the reference voltage, and press the encoder.
- Wait a few seconds for LED ‘1’ to flash rapidly.
- Connect the 3V voltage reference to input Y.
- Verify the reference voltage, and press the encoder.
- After a short pause, the board will reboot, at which point the reference can be removed.
Calibration Data
The disting's calibration data is stored in eight 32 bit words from address 0xBD01FE00 (disting mk1) or 0xBD03FE00 (disting mk2/mk3). The first four refer to the left channel (input X/output A); the second four refer to the right channel (input Y/output B).Each value is a sample of the relevant input under certain conditions. These conditions are
- Input disconnected (and therefore grounded)
- Input connected to output, output outputting a nominal zero level
- Input connected to output, output outputting a nominal half full range level
- Input connected to known 3V reference
int vL = ( ( inL - A[0] ) * Br[0] ) >> 24; int vR = ( ( inR - A[1] ) * Br[1] ) >> 24; int cL = ( ( vOutL - D[0] ) * Er[0] ) >> 24; int cR = ( ( vOutR - D[1] ) * Er[1] ) >> 24;where inL/inR are the values read directly from the audio codec, cL/cR are the codes written directly to the audio codec, and vL/vR/vOutL/vOutR are .19 format voltages.
The derivation of A, Br, D, Er is as follows:
Let the four input samples be zeroIn, zeroOut, halfOut, threeVolt. A = zeroIn B = ( threeVolt - zeroIn )/3 Br = 0x80000000000LL / B D = ( zeroOut - zeroIn )/B E = ( halfOut - zeroOut )/( B * 0x400000 ) Er = 0x80000000000LL / EThe above is pseudo-code - a real C implementation is left as an exercise for the reader.