[sane-devel] Canon LiDE 90

Pierre Willenbrock pierre at pirsoft.dnsalias.org
Wed Jan 30 22:27:25 UTC 2008

Guillaume Gastebois schrieb:
>  >But you can ignore led-calibration for now, that is not essential when
>  >debugging the backend. Just make sure the exposure settings in
>  >Genesys_Sensor.regs_0x10_0x1d are good, for example from an usb log the
>  >last register write to 0x10-0x15 before receiving actual scanned data.
>  >If those stay all zero, the rgb-leds in your scanner are very probably
>  >not controlled using the rgb-led-control-feature of the gl84x.
>  >
>  >You can disable led calibration by commenting out the code in
>  >genesys_flatbed_calibration. Offset/Gain calibration can be commented
>  >out when the values in Genesys_Frontend are good, Shading calibration
>  >can be disabled when you add OPTICAL_FLAG_DISABLE_SHADING to the flags
>  >for gl841_init_optical_regs_scan. When shading calibration is disabled,
>  >you get vertical stripes, the others lead to too dark/bright r/g/b 
>  >channels.
>  >
>  >Things that may be missing:
>  >* leds need to be controlled correctly
>  >* cis-sensor needs to get the correct clock signals(line toggle+pixel
>  >  clock, half-resolution signal is optional for now)
>  >* the analog frontend registers need to be setup correctly in
>  >  Genesys_Frontend
>  >* the readout position in the data stream from the analog frontend may
>  >  need tweaking(registers 0x52,0x53)
>  >
>  >When that is done, you should be able to get an image from your
>  >scanner, although calibration may be lacking.
>  >
>  >Regards,
>  >  Pierre
> OK, i see some image (very far to end result...). But can you explain to 
> me how to know the correct values for genesys_frontend ????
> These parameter have big influence on resulting image.

genesys_frontend contains the settings for the analog frontend.

the canon lide 35/40/50 seem to be all using the wm8199(afair) or a
compatible chip, so that datasheet may be helpful.

Datasheets for the wolfson analog frontends can be found on their website:

gl841_set_fe and the calibration functions are currently setup to handle
a wm8199.

The reg, reg2 and sign entries need to be obtained from an usb log. I
don't know the actual register mapping, but it should be easy to figure
that out from gl841_set_fe.

gain and offset will be calibrated by one of the calibration functions.
The values depend heavily on the LED and Sensor characteristics. For
now, when the LED exposure time is constant, you can get away with
constant values.

There seems to be no way to find the exact analog frontend chip without
looking at the pcb, but that is hopefully not needed.

Simplified, you get the result of this equation from the analog
frontend(The datasheet has the details):

v: proportional to input voltage from sensor
o: offset(not necessarily the value from the register)
g: gain-factor(not necessarily the value from the register)
d: digital output value

d = (o + v) * g

The behaviour of the sensor can be described by this equation:

i: proportional to the light intensity, which is proportional to led
exposure time and shade on your original
v_o: offset voltage
s: sensitivity of sensor(voltage per intensity)

v = v_o + i * s

The offset/gain calibration optimizes offset and gain such that maximum
and minimum v fall in the range between maximum and minimum d, but
trying to maximize the range used in d(this requires at least one led
exposure time to be setup reasonably).

The LED calibration tries to get all LED colors to result in a similar
value into the analog frontend, by adjusting the exposure time(this
requires analog frontend offset/gain values to be setup reasonably).	

Sorry for the lengthy mail, but i hope the information is helpful.


More information about the sane-devel mailing list