
Applications Information
(Continued)
There are several conditions that can cause the VGA gain
calibration routine to fail. Result 2, ‘‘Signal is too strong:
Decrease light intensity or integration time’’ is shown inFig-
ure 9. This condition indicates that the amplitude of one or
more of the white pixels coming from the CCD is greater
than the maximum input voltage that the LM9801 is capable
of accepting (about 1.2Vp-p). In this case the amplitude of
the analog CCD output must be reduced before it enters the
LM9801’s OS input to prevent clipping. This can be done by
reducing the intensity of the light source or shortening the
integration time of the CCD.
TL/H/12814–36
FIGURE 9. CCD Input Signal Too Strong
The second possible failure mode of the VGA calibration
(Result 3) occurs if there is ‘‘Too much variation’’ in the
amplitude of the pixels coming from the CCD (Figure 10).
The LM9801 can correct for up to a 2.8 to 1 variation in pixel
amplitude. If the variation is greater than this than it must be
reduced before it can perform shading correction on all the
pixels. Typically this is done by using a better light source
that has more uniform illumination, higher quality lenses, or
other opto-mechanical techniques to reduce variation
across all the active pixels.
TL/H/12814–37
FIGURE 10. CCD Input Signal Range Too Wide
TL/H/12814–38
FIGURE 11. CCD Input Signal Too Weak
The final problem that can occur during VGA calibration
(Result 4) is the ‘‘Signal too weak: increase light intensity or
integration time’’ condition, shown inFigure 11. In this case,
even with the VGA gain set to a maximum of 2.8, the ampli-
tude of one or more pixels is less than the minimum required
for shading correction. The solution is to increase the inten-
sity of the light source or lengthen the integration time of the
CCD to increase the CCD’s output amplitude.
To ensure that a scanner system is manufacturable, the re-
sult of the VGA calibration must always be State 1. States 2,
3, and 4 must be eliminated either by ensuring that the total
variation in light intensity (from all sources) from system to
system to a maximum of 9 dB, or by being able to adjust the
light source’s intensity and/or the CCD’s light integration
time.
5.3 PGA Correction Coefficients (Shading Calibration)
Once the input signal has been centered inside the range
the LM9801 can correct for, correction coefficients must be
generated for each pixel to compensate for the gain error of
that pixel.
1. Set Offset DAC and Add Bit as determined in Section
5.1.
2. Set the VGA gain to the value determined in Section 5.2.
3. Set the PGA gain to 0 dB.
4. Scan a reference line corresponding to all white or light
grey and store it in memory.
5. Calculate the required gain correction coefficients for
each pixel using the formula:
Correction Coefficient
n
e
256
1.95
#
Target Code
Uncorrected Code
n
b
1
J
Where
Uncorrected Code
n
is the ADC output code for pix-
el n with the PGA gain
e
0 dB,
Target Code
is the number
that corresponds to the desired output from the ADC with
the given reference line input, and
Correction Coefficient
n
is the gain correction number that is sent to the CD0–CD7
correction databus to provide gain correction for pixel n
when digitizing a line with the LM9801’s PGA gain correc-
tion operating.
If it is difficult or undesirable to do the division, subtraction,
and multiplication operations shown above for every pixel,
then a lookup table can be generated in advance that will
return the Correction Coefficient for any Uncorrected Code.
This table can be stored in ROM or RAM and can speed up
the calibration process. The disadvantage of this technique
is that the Target Code must be fixed when the table is
generated, so only one Target Code can be used (unless
multiple tables are generated).
All the Correction Coefficients must be stored and sent to
the LM9801 through the CD0–CD7 databus for every line
scanned.
http://www.national.com
26