Canon LiDE 90

classic Classic list List threaded Threaded
88 messages Options
12345
Reply | Threaded
Open this post in threaded view
|

Canon LiDE 90

guillaume.gastebois
Hello,

OK, my motor moves !

But, someting doesn't work during initialisation : I get floating point
error !

I modified genesys_gl841.c for instrumentation and genesys_devices.c
(genesys_sensor section) in accordance to my windows usb snoop log (see
attacement).

SANE_DEBUG_GENESYS_GL841=255 scanimage
-device-name=genesys:libusb:001:066 > toto.pnm ends with :

[genesys_gl841] reg[0x86] = 0x00
[genesys_gl841] reg[0x87] = 0x00
[genesys_gl841] gl841_bulk_write_register: wrote 104 registers
[genesys_gl841] gl841_led_calibration: starting first line reading
[genesys_gl841] gl841_begin_scan
[genesys_gl841] gl841_bulk_write_register (elems = 4)
[genesys_gl841] reg[0x03] = 0x5f
[genesys_gl841] reg[0x01] = 0x81
[genesys_gl841] reg[0x0d] = 0x01
[genesys_gl841] reg[0x0f] = 0x01
[genesys_gl841] gl841_bulk_write_register: wrote 4 registers
[genesys_gl841] gl841_begin_scan: completed
[genesys_gl841] gl841_bulk_read_data: requesting 31200 bytes
[genesys_gl841] gl841_bulk_read_data: trying to read 31200 bytes of data
[genesys_gl841] gl841_bulk_read_data read 31200 bytes, 0 remaining
[genesys_gl841] gl841_bulk_read_data: completed
[genesys_gl841] gl841_led_calibration: average: 0,801,302
[genesys_gl841] gl841_led_calibration: avga=367,expr=0,expg=0,expb=0,avge=0
Exception en point flottant (floating point exception)

See sample image toto.jpg too (when commenting zero division in
genesys_gl841.c the scanner scans an image).

Help needed thanks

Guillaume



/* sane - Scanner Access Now Easy.

   Copyright (C) 2003 Oliver Rauch
   Copyright (C) 2003-2005 Henning Meier-Geinitz <[hidden email]>
   Copyright (C) 2004, 2005 Gerhard Jaeger <[hidden email]>
   Copyright (C) 2004-2007 Stephane Voltz <[hidden email]>
   Copyright (C) 2005 Pierre Willenbrock <[hidden email]>
   Copyright (C) 2007 Luke <[hidden email]>
   
   This file is part of the SANE package.
   
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
   published by the Free Software Foundation; either version 2 of the
   License, or (at your option) any later version.
   
   This program is distributed in the hope that it will be useful, but
   WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   General Public License for more details.
   
   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place - Suite 330, Boston,
   MA 02111-1307, USA.
   
   As a special exception, the authors of SANE give permission for
   additional uses of the libraries contained in this release of SANE.
   
   The exception is that, if you link a SANE library with other files
   to produce an executable, this does not by itself cause the
   resulting executable to be covered by the GNU General Public
   License.  Your use of that executable is in no way restricted on
   account of linking the SANE library code into it.
   
   This exception does not, however, invalidate any other reasons why
   the executable file might be covered by the GNU General Public
   License.
   
   If you submit changes to SANE to the maintainers to be included in
   a subsequent release, you agree by submitting the changes that
   those changes may be distributed with this exception intact.
   
   If you write modifications of your own for SANE, it is your choice
   whether to permit this exception to apply to your modifications.
   If you do not wish that, delete this exception notice.
*/

/* ------------------------------------------------------------------------ */
/*                     Some setup DAC and CCD tables                        */
/* ------------------------------------------------------------------------ */

/** Setup table for various scanners using a Wolfson DAC
 */
static Genesys_Frontend Wolfson[] = {
  {{0x00, 0x03, 0x05, 0x11}
   , {0x00, 0x00, 0x00}
   , {0x80, 0x80, 0x80}
   , {0x02, 0x02, 0x02}
   , {0x00, 0x00, 0x00}
   }
  , /* UMAX */
  {{0x00, 0x03, 0x05, 0x03}
   , {0x00, 0x00, 0x00}
   , {0xc8, 0xc8, 0xc8}
   , {0x04, 0x04, 0x04}
   , {0x00, 0x00, 0x00}
   }
  , /* ST12 */
  {{0x00, 0x03, 0x05, 0x21}
   , {0x00, 0x00, 0x00}
   , {0xc8, 0xc8, 0xc8}
   , {0x06, 0x06, 0x06}
   , {0x00, 0x00, 0x00}
   }
  , /* ST24 */
  {{0x00, 0x03, 0x05, 0x12}
   , {0x00, 0x00, 0x00}
   , {0xc8, 0xc8, 0xc8}
   , {0x04, 0x04, 0x04}
   , {0x00, 0x00, 0x00}
   }
  , /* MD6228/MD6471 */
  {{0x00, 0x03, 0x05, 0x02}
   , {0x00, 0x00, 0x00}
   , {0xc0, 0xc0, 0xc0}
   , {0x07, 0x07, 0x07}
   , {0x00, 0x00, 0x00}
   }
  , /* HP2400c */
  {{0x00, 0x03, 0x04, 0x02}
   , {0x00, 0x00, 0x00}
   , {0xb0, 0xb0, 0xb0}
   , {0x04, 0x04, 0x04}
   , {0x00, 0x00, 0x00}
   }
  , /* HP2300c */
  {{0x00, 0x3d, 0x08, 0x00}
   , {0x00, 0x00, 0x00}
   , {0xe1, 0xe1, 0xe1}
   , {0x93, 0x93, 0x93}
   , {0x00, 0x19, 0x06}
   }
  , /* CANONLIDE35 */
};


/** for setting up the sensor-specific settings:
 * Optical Resolution, number of black pixels, number of dummy pixels,
 * CCD_start_xoffset, and overall number of sensor pixels
 * registers 0x08-0x0b, 0x10-0x1d and 0x52-0x59
 */
static Genesys_Sensor Sensor[] = {
  /* UMAX */
  {1200, 48, 64, 0, 10800, 210, 230,
   {0x01, 0x03, 0x05, 0x07}
   ,
   {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x05, 0x31, 0x2a, 0x00, 0x00,
    0x00, 0x02}
   ,
   {0x13, 0x17, 0x03, 0x07, 0x0b, 0x0f, 0x23, 0x00, 0xc1, 0x00, 0x00, 0x00,
    0x00}
   ,
   1.0, 1.0, 1.0,
   NULL, NULL, NULL}
  ,
  /* Plustek OpticPro S12/ST12 */
  {600, 48, 85, 152, 5416, 210, 230,
   {0x02, 0x00, 0x06, 0x04}
   ,
   {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x08, 0x20, 0x2a, 0x00, 0x00,
    0x0c, 0x03}
   ,
   {0x0f, 0x13, 0x17, 0x03, 0x07, 0x0b, 0x83, 0x00, 0xc1, 0x00, 0x00, 0x00,
    0x00}
   ,
   1.0, 1.0, 1.0,
   NULL, NULL, NULL}
  ,
  /* Plustek OpticPro S24/ST24 */
  {1200, 48, 64, 0, 10800, 210, 230,
   {0x0e, 0x0c, 0x00, 0x0c}
   ,
   {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x08, 0x31, 0x2a, 0x00, 0x00,
    0x00, 0x02}
   ,
   {0x17, 0x03, 0x07, 0x0b, 0x0f, 0x13, 0x03, 0x00, 0xc1, 0x00, 0x00, 0x00,
    0x00}
   ,
   1.0, 1.0, 1.0,
   NULL, NULL, NULL}
  ,
  /* MD6471 */
  {1200,
   48,
   16, 0, 10872,
   210, 200,
   {0x0d, 0x0f, 0x11, 0x13}
   ,
   {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x0a, 0x30, 0x2a, 0x00, 0x00,
    0x00, 0x03}
   ,
   {0x0f, 0x13, 0x17, 0x03, 0x07, 0x0b, 0x23, 0x00, 0xc1, 0x00, 0x00, 0x00,
    0x00}
   ,
   2.38, 2.35, 2.34,
   NULL, NULL, NULL}
  ,
  /* HP2400c */
  {1200,
   48,
   15, 0, 10872, 210, 200,
   {0x14, 0x15, 0x00, 0x00}
   ,
   {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbf, 0x08, 0x3f, 0x2a, 0x00, 0x00,
    0x00, 0x02}
   ,
   {0x0b, 0x0f, 0x13, 0x17, 0x03, 0x07, 0x63, 0x00, 0xc1, 0x00, 0x00, 0x00,
    0x00}
   ,
   1.0, 1.0, 1.0,
   NULL, NULL, NULL}
  ,
  /* HP2300c */
  {600,
   48,
   20, 0, 5454, 210, 200,
   {0x16, 0x00, 0x01, 0x03}
   ,
   {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb7, 0x0a, 0x20, 0x2a, 0x6a, 0x8a,
    0x00, 0x05}
   ,
   {0x0f, 0x13, 0x17, 0x03, 0x07, 0x0b, 0x83, 0x00, 0xc1, 0x06, 0x0b, 0x10,
    0x16}
   ,
   2.1, 2.1, 2.1,
   NULL, NULL, NULL}
  ,
  /* CANOLIDE35 */
  {1200,
/*TODO: find a good reason for keeping all three following variables*/
   87, /*(black) */
   87, /* (dummy) */
   0, /* (startxoffset) */
   10400, /*sensor_pixels */
   210,
   200,
   {0x00, 0x21, 0x00, 0x00},
   {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x06, 0x00, 0xFF,
    0x24, 0x00, 0x00, 0x04 /* TODO(these do no harm, but may be neccessery for CCD)*/
   },
   {0x02, 0x04,
    0x02, 0x04, 0x02, 0x04, /*[GB](HI|LOW) not needed for cis*/
    0x0a, 0x71,
    0x55, /*TODO: bit7*/
    0x00, 0x00, 0x20, 0x41 /*TODO (these do no harm, but may be neccessery for CCD)*/
   }
   ,
   1.0, 1.0, 1.0,
   NULL, NULL, NULL}
};

/** for General Purpose Output specific settings:
 * initial GPO value (registers 0x66-0x67/0x6c-0x6d)
 * GPO enable mask (registers 0x68-0x69/0x6e-0x6f)
 */
static Genesys_Gpo Gpo[] = {
  /* UMAX */
  {
   {0x11, 0x00}
   ,
   {0x51, 0x20}
   ,
   }
  ,
  /* Plustek OpticPro S12/ST12 */
  {
   {0x11, 0x00}
   ,
   {0x51, 0x20}
   ,
   }
  ,
  /* Plustek OpticPro S24/ST24 */
  {
   {0x00, 0x00}
   ,
   {0x51, 0x20}
   ,
   }
  ,
  /* MD5345/MD6471 */
  {
   {0x30, 0x00}
   , /* bits 11-12 are for bipolar V-ref input voltage */
   {0xa0, 0x18}
   ,
   }
  ,
  /* HP2400C */
  {
   {0x30, 0x00}
   ,
   {0x31, 0x00}
   ,
   }
  ,
  /* HP2300C */
  {
   {0x00, 0x00}
   ,
   {0x00, 0x00}
   ,
   }
  ,
  /* CANONLIDE35 */
  {
   {0x81, 0x80}
   ,
   {0xef, 0x80}
   ,
   }
};

#define MOTOR_ST24       2
static Genesys_Motor Motor[] = {
  /* UMAX */
  {
   1200, /* motor base steps */
   2400, /* maximum motor resolution */
   1, /* maximum step mode */
   1,                           /* number of power modes*/
   {{{  
     11000, /* maximum start speed */
     3000, /* maximum end speed */
     128, /* step count */
     1.0, /* nonlinearity */
     },
    {
     11000,
     3000,
     128,
     1.0,
   },},},
  },
  { /* MD5345/6228/6471 */
   1200,
   2400,
   1,
   1,
   {{{  
     2000,
     1375,
     128,
     0.5,
     },
    {
     2000,
     1375,
     128,
     0.5,
    },},},
  },
  { /* ST24 */
   2400,
   2400,
   1,
   1,
   {{{
     2289,
     2100,
     128,
     0.3,
     },
    {
     2289,
     2100,
     128,
     0.3,
    },},},
  },
  { /* HP 2400c */
   1200,
   2400,
   1,
   1,
   {{{
     11000,
     3000,
     128,
     1.0,
     },
    {
     11000,
     3000,
     128,
     1.0,
    },},},
  },
  { /* HP 2300c */
   600,
   1200,
   1,
   1,
   {{{
     3200,
     1200,
     128,
     0.5,
     },
    {
     3200,
     1200,
     128,
     0.5,
   },},},
  },
  { /* Canon LiDE 35 */
   1200,
   2400,
   1,
   1,
   {{{
     3500,
     1300,
     60,
     0.8,
     },
    {
     3500,
     1400,
     60,
     0.8,
    },},},
  },
};

/* here we have the various device settings...
 */
static Genesys_Model umax_astra_4500_model = {
  "umax-astra-4500", /* Name */
  "UMAX", /* Device vendor string */
  "Astra 4500", /* Device model name */
  GENESYS_GL646,
  NULL,

  {1200, 600, 300, 150, 75, 0}, /* possible x-resolutions */
  {2400, 1200, 600, 300, 150, 75, 0}, /* possible y-resolutions */
  {16, 8, 0}, /* possible depths in gray mode */
  {16, 8, 0}, /* possible depths in color mode */

  SANE_FIX (3.5), /* Start of scan area in mm  (x) */
  SANE_FIX (7.5), /* Start of scan area in mm (y) */
  SANE_FIX (218.0), /* Size of scan area in mm (x) */
  SANE_FIX (299.0), /* Size of scan area in mm (y) */

  SANE_FIX (0.0), /* Start of white strip in mm (y) */
  SANE_FIX (1.0), /* Start of black mark in mm (x) */

  SANE_FIX (0.0), /* Start of scan area in TA mode in mm (x) */
  SANE_FIX (0.0), /* Start of scan area in TA mode in mm (y) */
  SANE_FIX (100.0), /* Size of scan area in TA mode in mm (x) */
  SANE_FIX (100.0), /* Size of scan area in TA mode in mm (y) */

  SANE_FIX (0.0), /* Start of white strip in TA mode in mm (y) */

  0, 8, 16, /* RGB CCD Line-distance correction in pixel */

  COLOR_ORDER_BGR, /* Order of the CCD/CIS colors */

  SANE_FALSE, /* Is this a CIS scanner? */
  CCD_UMAX,
  DAC_WOLFSON_UMAX,
  GPO_UMAX,
  MOTOR_UMAX,
  GENESYS_FLAG_UNTESTED, /* Which flags are needed for this scanner? */
  /* untested, values set by hmg */
  20,
  200
};

static Genesys_Model canon_lide_50_model = {
  "canon-lide-50", /* Name */
  "Canon", /* Device vendor string */
  "LiDE 35/40/50", /* Device model name */
  GENESYS_GL841,
  NULL,

  {1200, 600, 300, 150, 75, 0}, /* possible x-resolutions */
  {2400, 1200, 600, 300, 150, 75, 0}, /* possible y-resolutions */
  {16, 8, 0}, /* possible depths in gray mode */
  {16, 8, 0}, /* possible depths in color mode */

  SANE_FIX (0.42), /* Start of scan area in mm  (x) */
  SANE_FIX (7.9), /* Start of scan area in mm (y) */
  SANE_FIX (218.0), /* Size of scan area in mm (x) */
  SANE_FIX (299.0), /* Size of scan area in mm (y) */

  SANE_FIX (3.0), /* Start of white strip in mm (y) */
  SANE_FIX (0.0), /* Start of black mark in mm (x) */

  SANE_FIX (0.0), /* Start of scan area in TA mode in mm (x) */
  SANE_FIX (0.0), /* Start of scan area in TA mode in mm (y) */
  SANE_FIX (100.0), /* Size of scan area in TA mode in mm (x) */
  SANE_FIX (100.0), /* Size of scan area in TA mode in mm (y) */

  SANE_FIX (0.0), /* Start of white strip in TA mode in mm (y) */

  0, 0, 0, /* RGB CCD Line-distance correction in pixel */

  COLOR_ORDER_RGB, /* Order of the CCD/CIS colors */

  SANE_TRUE, /* Is this a CIS scanner? */
  CCD_CANONLIDE35,
  DAC_CANONLIDE35,
  GPO_CANONLIDE35,
  MOTOR_CANONLIDE35,
  GENESYS_FLAG_LAZY_INIT | GENESYS_FLAG_SKIP_WARMUP | GENESYS_FLAG_OFFSET_CALIBRATION | GENESYS_FLAG_DARK_WHITE_CALIBRATION, /* Which flags are needed for this scanner? */
  280,
  400
};

static Genesys_Model canon_lide_60_model = {
  "canon-lide-90", /* Name */
  "Canon", /* Device vendor string */
  "LiDE 90", /* Device model name */
  GENESYS_GL841,
  NULL,

  {1200, 600, 300, 150, 75, 0}, /* possible x-resolutions */
  {2400, 1200, 600, 300, 150, 75, 0}, /* possible y-resolutions */
  {16, 8, 0}, /* possible depths in gray mode */
  {16, 8, 0}, /* possible depths in color mode */

  SANE_FIX (0.42), /* Start of scan area in mm  (x) */
  SANE_FIX (7.9), /* Start of scan area in mm (y) */
  SANE_FIX (218.0), /* Size of scan area in mm (x) */
  SANE_FIX (299.0), /* Size of scan area in mm (y) */

  SANE_FIX (3.0), /* Start of white strip in mm (y) */
  SANE_FIX (0.0), /* Start of black mark in mm (x) */

  SANE_FIX (0.0), /* Start of scan area in TA mode in mm (x) */
  SANE_FIX (0.0), /* Start of scan area in TA mode in mm (y) */
  SANE_FIX (100.0), /* Size of scan area in TA mode in mm (x) */
  SANE_FIX (100.0), /* Size of scan area in TA mode in mm (y) */

  SANE_FIX (0.0), /* Start of white strip in TA mode in mm (y) */

  0, 0, 0, /* RGB CCD Line-distance correction in pixel */

  COLOR_ORDER_RGB, /* Order of the CCD/CIS colors */

  SANE_TRUE, /* Is this a CIS scanner? */
  CCD_CANONLIDE35,
  DAC_CANONLIDE35,
  GPO_CANONLIDE35,
  MOTOR_CANONLIDE35,
  GENESYS_FLAG_LAZY_INIT | GENESYS_FLAG_SKIP_WARMUP | GENESYS_FLAG_OFFSET_CALIBRATION | GENESYS_FLAG_DARK_WHITE_CALIBRATION, /* Which flags are needed for this scanner? */
  300,
  400
}; /* this is completely untested -- hmg */

static Genesys_Model hp2300c_model = {
  "hewlett-packard-scanjet-2300c", /* Name */
  "Hewlett Packard", /* Device vendor string */
  "ScanJet 2300c", /* Device model name */
  GENESYS_GL646,
  NULL,

  {600, 300, 150, 75, 0}, /* possible x-resolutions */
  {1200, 600, 300, 150, 75, 0}, /* possible y-resolutions, motor can go up to 1200 dpi */
  {16, 8, 0}, /* possible depths in gray mode */
  {16, 8, 0}, /* possible depths in color mode */

  SANE_FIX (-2.0), /* Start of scan area in mm (x_offset) */
  SANE_FIX (0.0), /* Start of scan area in mm (y_offset) */
  SANE_FIX (215.9), /* Size of scan area in mm (x) */
  SANE_FIX (295.0), /* Size of scan area in mm (y) */

  SANE_FIX (0.0), /* Start of white strip in mm (y) */
  SANE_FIX (1.0), /* Start of black mark in mm (x) */

  SANE_FIX (0.0), /* Start of scan area in TA mode in mm (x) */
  SANE_FIX (0.0), /* Start of scan area in TA mode in mm (y) */
  SANE_FIX (100.0), /* Size of scan area in TA mode in mm (x) */
  SANE_FIX (100.0), /* Size of scan area in TA mode in mm (y) */

  SANE_FIX (0.0), /* Start of white strip in TA mode in mm (y) */

  16, 8, 0, /* RGB CCD Line-distance correction in pixel */

  COLOR_ORDER_RGB, /* Order of the CCD/CIS colors */

  SANE_FALSE, /* Is this a CIS scanner? */
  CCD_HP2300,
  DAC_WOLFSON_HP2300,
  GPO_HP2300,
  MOTOR_HP2300,
  GENESYS_FLAG_REPARK
    | GENESYS_FLAG_14BIT_GAMMA
    | GENESYS_FLAG_SEARCH_START
    | GENESYS_FLAG_MUST_WAIT
    | GENESYS_FLAG_DARK_CALIBRATION | GENESYS_FLAG_OFFSET_CALIBRATION,
  9,
  132
};

static Genesys_Model hp2400c_model = {
  "hewlett-packard-scanjet-2400c", /* Name */
  "Hewlett Packard", /* Device vendor string */
  "ScanJet 2400c", /* Device model name */
  GENESYS_GL646,
  NULL,

  {1200, 600, 300, 150, 75, 0}, /* possible x-resolutions */
  {2400, 1200, 600, 300, 150, 75, 0}, /* possible y-resolutions */
  {16, 8, 0}, /* possible depths in gray mode */
  {16, 8, 0}, /* possible depths in color mode */

  SANE_FIX (3.5), /* Start of scan area in mm  (x) */
  SANE_FIX (7.5), /* Start of scan area in mm (y) */
  SANE_FIX (215.9), /* Size of scan area in mm (x) */
  SANE_FIX (297.2), /* Size of scan area in mm (y) */

  SANE_FIX (0.0), /* Start of white strip in mm (y) */
  SANE_FIX (1.0), /* Start of black mark in mm (x) */

  SANE_FIX (0.0), /* Start of scan area in TA mode in mm (x) */
  SANE_FIX (0.0), /* Start of scan area in TA mode in mm (y) */
  SANE_FIX (100.0), /* Size of scan area in TA mode in mm (x) */
  SANE_FIX (100.0), /* Size of scan area in TA mode in mm (y) */

  SANE_FIX (0.0), /* Start of white strip in TA mode in mm (y) */

  0, 8, 16, /* RGB CCD Line-distance correction in pixel */

  COLOR_ORDER_BGR, /* Order of the CCD/CIS colors */

  SANE_FALSE, /* Is this a CIS scanner? */
  CCD_HP2400,
  DAC_WOLFSON_HP2400,
  GPO_HP2400,
  MOTOR_HP2400,
  GENESYS_FLAG_UNTESTED /* not fully working yet */
    | GENESYS_FLAG_REPARK
    | GENESYS_FLAG_14BIT_GAMMA
    | GENESYS_FLAG_SEARCH_START
    | GENESYS_FLAG_MUST_WAIT
    | GENESYS_FLAG_DARK_CALIBRATION | GENESYS_FLAG_OFFSET_CALIBRATION,
  20,
  132
};

static Genesys_Model hp3670c_model = {
  "hewlett-packard-scanjet-3670c", /* Name */
  "Hewlett Packard", /* Device vendor string */
  "ScanJet 3670c", /* Device model name */
  GENESYS_GL646,
  NULL,

  {1200, 600, 300, 150, 75, 0}, /* possible x-resolutions */
  {2400, 1200, 600, 300, 150, 75, 0}, /* possible y-resolutions */
  {16, 8, 0}, /* possible depths in gray mode */
  {16, 8, 0}, /* possible depths in color mode */

  SANE_FIX (3.5), /* Start of scan area in mm  (x) */
  SANE_FIX (7.5), /* Start of scan area in mm (y) */
  SANE_FIX (215.9), /* Size of scan area in mm (x) */
  SANE_FIX (297.2), /* Size of scan area in mm (y) */

  SANE_FIX (0.0), /* Start of white strip in mm (y) */
  SANE_FIX (1.0), /* Start of black mark in mm (x) */

  SANE_FIX (0.0), /* Start of scan area in TA mode in mm (x) */
  SANE_FIX (0.0), /* Start of scan area in TA mode in mm (y) */
  SANE_FIX (100.0), /* Size of scan area in TA mode in mm (x) */
  SANE_FIX (100.0), /* Size of scan area in TA mode in mm (y) */

  SANE_FIX (0.0), /* Start of white strip in TA mode in mm (y) */

  0, 8, 16, /* RGB CCD Line-distance correction in pixel */

  COLOR_ORDER_BGR, /* Order of the CCD/CIS colors */

  SANE_FALSE, /* Is this a CIS scanner? */
  CCD_UMAX,
  DAC_WOLFSON_UMAX,
  GPO_UMAX,
  MOTOR_UMAX,
  GENESYS_FLAG_UNTESTED, /* Which flags are needed for this scanner? */
  /* untested, values set by mike p. according to vendor's datasheet. */
  20,
  200
};

static Genesys_Model plustek_st12_model = {
  "plustek-opticpro-st12", /* Name */
  "Plustek", /* Device vendor string */
  "OpticPro ST12", /* Device model name */
  GENESYS_GL646,
  NULL,

  {600, 300, 150, 75, 0}, /* possible x-resolutions */
  {1200, 600, 300, 150, 75, 0}, /* possible y-resolutions */
  {16, 8, 0}, /* possible depths in gray mode */
  {16, 8, 0}, /* possible depths in color mode */

  SANE_FIX (3.5), /* Start of scan area in mm  (x) */
  SANE_FIX (7.5), /* Start of scan area in mm (y) */
  SANE_FIX (218.0), /* Size of scan area in mm (x) */
  SANE_FIX (299.0), /* Size of scan area in mm (y) */

  SANE_FIX (0.0), /* Start of white strip in mm (y) */
  SANE_FIX (1.0), /* Start of black mark in mm (x) */

  SANE_FIX (0.0), /* Start of scan area in TA mode in mm (x) */
  SANE_FIX (0.0), /* Start of scan area in TA mode in mm (y) */
  SANE_FIX (100.0), /* Size of scan area in TA mode in mm (x) */
  SANE_FIX (100.0), /* Size of scan area in TA mode in mm (y) */

  SANE_FIX (0.0), /* Start of white strip in TA mode in mm (y) */

  0, 8, 16, /* RGB CCD Line-distance correction in pixel */

  COLOR_ORDER_BGR, /* Order of the CCD/CIS colors */

  SANE_FALSE, /* Is this a CIS scanner? */
  CCD_ST12,
  DAC_WOLFSON_ST12,
  GPO_ST12,
  MOTOR_UMAX,
  GENESYS_FLAG_UNTESTED | GENESYS_FLAG_14BIT_GAMMA, /* Which flags are needed for this scanner? */
  20,
  200
};

static Genesys_Model plustek_st24_model = {
  "plustek-opticpro-st24", /* Name */
  "Plustek", /* Device vendor string */
  "OpticPro ST24", /* Device model name */
  GENESYS_GL646,
  NULL,

  {1200, 600, 300, 150, 75, 0}, /* possible x-resolutions */
  {2400, 1200, 600, 300, 150, 75, 0}, /* possible y-resolutions */
  {16, 8, 0}, /* possible depths in gray mode */
  {16, 8, 0}, /* possible depths in color mode */

  SANE_FIX (3.5), /* Start of scan area in mm  (x) */
  SANE_FIX (7.5), /* Start of scan area in mm (y) */
  SANE_FIX (218.0), /* Size of scan area in mm (x) */
  SANE_FIX (299.0), /* Size of scan area in mm (y) */

  SANE_FIX (0.0), /* Start of white strip in mm (y) */
  SANE_FIX (1.0), /* Start of black mark in mm (x) */

  SANE_FIX (0.0), /* Start of scan area in TA mode in mm (x) */
  SANE_FIX (0.0), /* Start of scan area in TA mode in mm (y) */
  SANE_FIX (100.0), /* Size of scan area in TA mode in mm (x) */
  SANE_FIX (100.0), /* Size of scan area in TA mode in mm (y) */

  SANE_FIX (0.0), /* Start of white strip in TA mode in mm (y) */

  0, 8, 16, /* RGB CCD Line-distance correction in pixel */

  COLOR_ORDER_BGR, /* Order of the CCD/CIS colors */

  SANE_FALSE, /* Is this a CIS scanner? */
  CCD_ST24,
  DAC_WOLFSON_ST24,
  GPO_ST24,
  MOTOR_ST24,
  GENESYS_FLAG_UNTESTED
    | GENESYS_FLAG_14BIT_GAMMA
    | GENESYS_FLAG_LAZY_INIT
    | GENESYS_FLAG_USE_PARK
    | GENESYS_FLAG_SKIP_WARMUP
    | GENESYS_FLAG_SEARCH_START | GENESYS_FLAG_OFFSET_CALIBRATION,
  20,
  200
};

static Genesys_Model medion_md5345_model = {
  "medion-md5345-model", /* Name */
  "Medion", /* Device vendor string */
  "MD5345/MD6228/MD6471", /* Device model name */
  GENESYS_GL646,
  NULL,

  {1200, 600, 300, 200, 150, 100, 75, 50, 0}, /* possible x-resolutions */
  {2400, 1200, 600, 500, 400, 300, 250, 200, 150, 100, 50, 0}, /* possible y-resolutions */
  {16, 8, 0}, /* possible depths in gray mode */
  {16, 8, 0}, /* possible depths in color mode */

  SANE_FIX (1.00), /* Start of scan area in mm  (x) */
  SANE_FIX (5.00), /* 2.79 < Start of scan area in mm (y) */
  SANE_FIX (215.9), /* Size of scan area in mm (x) */
  SANE_FIX (296.4), /* Size of scan area in mm (y) */

  SANE_FIX (0.00), /* Start of white strip in mm (y) */
  SANE_FIX (0.00), /* Start of black mark in mm (x) */

  SANE_FIX (0.00), /* Start of scan area in TA mode in mm (x) */
  SANE_FIX (0.00), /* Start of scan area in TA mode in mm (y) */
  SANE_FIX (0.00), /* Size of scan area in TA mode in mm (x) */
  SANE_FIX (0.00), /* Size of scan area in TA mode in mm (y) */

  SANE_FIX (0.00), /* Start of white strip in TA mode in mm (y) */

  48, 24, 0, /* RGB CCD Line-distance correction in pixel */

  COLOR_ORDER_RGB, /* Order of the CCD/CIS colors */

  SANE_FALSE, /* Is this a CIS scanner? */
  CCD_5345,
  DAC_WOLFSON_5345,
  GPO_5345,
  MOTOR_5345,
  GENESYS_FLAG_14BIT_GAMMA
    | GENESYS_FLAG_LAZY_INIT
    | GENESYS_FLAG_USE_PARK
    | GENESYS_FLAG_SKIP_WARMUP
    | GENESYS_FLAG_SEARCH_START
    | GENESYS_FLAG_DARK_CALIBRATION
    | GENESYS_FLAG_STAGGERED_LINE | GENESYS_FLAG_OFFSET_CALIBRATION,
  32,
  200
};

static Genesys_USB_Device_Entry genesys_usb_device_list[] = {
  {0x0638, 0x0a10, &umax_astra_4500_model},
  {0x04a9, 0x2213, &canon_lide_50_model},
  {0x04a9, 0x1900, &canon_lide_60_model},
  {0x03f0, 0x0901, &hp2300c_model},
  {0x03f0, 0x0a01, &hp2400c_model},
  {0x03f0, 0x1405, &hp3670c_model},
  {0x07b3, 0x0600, &plustek_st12_model},
  {0x07b3, 0x0601, &plustek_st24_model},
  {0x0461, 0x0377, &medion_md5345_model},
  {0, 0, NULL}
};

--
sane-devel mailing list: [hidden email]
http://lists.alioth.debian.org/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to [hidden email]

toto.jpg (10K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Canon LiDE 90

Pierre Willenbrock-2
Guillaume Gastebois schrieb:
> Hello,
>
> OK, my motor moves !

Cool.

>
> But, someting doesn't work during initialisation : I get floating point
> error !
>
> I modified genesys_gl841.c for instrumentation and genesys_devices.c
> (genesys_sensor section) in accordance to my windows usb snoop log (see
> attacement).
>
> SANE_DEBUG_GENESYS_GL841=255 scanimage
> -device-name=genesys:libusb:001:066 > toto.pnm ends with :

(please use both SANE_DEBUG_GENESYS_GL841=255 and
SANE_DEBUG_GENESYS=255, the device specific code calls back into the
unspecific code)

>
> [genesys_gl841] reg[0x86] = 0x00
> [genesys_gl841] reg[0x87] = 0x00
> [genesys_gl841] gl841_bulk_write_register: wrote 104 registers
> [genesys_gl841] gl841_led_calibration: starting first line reading
> [genesys_gl841] gl841_begin_scan
> [genesys_gl841] gl841_bulk_write_register (elems = 4)
> [genesys_gl841] reg[0x03] = 0x5f
> [genesys_gl841] reg[0x01] = 0x81
> [genesys_gl841] reg[0x0d] = 0x01
> [genesys_gl841] reg[0x0f] = 0x01
> [genesys_gl841] gl841_bulk_write_register: wrote 4 registers
> [genesys_gl841] gl841_begin_scan: completed
> [genesys_gl841] gl841_bulk_read_data: requesting 31200 bytes
> [genesys_gl841] gl841_bulk_read_data: trying to read 31200 bytes of data
> [genesys_gl841] gl841_bulk_read_data read 31200 bytes, 0 remaining
> [genesys_gl841] gl841_bulk_read_data: completed
> [genesys_gl841] gl841_led_calibration: average: 0,801,302
> [genesys_gl841] gl841_led_calibration: avga=367,expr=0,expg=0,expb=0,avge=0
> Exception en point flottant (floating point exception)

that line above should be more like this:
[genesys_gl841] gl841_led_calibration: average: 43901,43865,43387

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.

The data stream inside gl84x based cis-scanners(at least the LiDE
35/50/60) looks like this:
-----+
gl84x!
-----+
  ! r,g,b led control line, selects colors r, g, b in turn,
  ! controls exposure for each color
+---------+
!r,g,b led!
+---------+
  ! r,g,b light
+--------+
!original!
+--------+
  ! r,g,b component
+----------+
!cis sensor!
+----------+
  ! voltages proportional to light intensity
+---------------+
!analog frontend!
+---------------+
  ! 16bit intensity, multiplexed on 8bit data bus
-----+
gl84x!
-----+

> See sample image toto.jpg too (when commenting zero division in
> genesys_gl841.c the scanner scans an image).
>
> Help needed thanks
>
> Guillaume

Regards,
  Pierre


--
sane-devel mailing list: [hidden email]
http://lists.alioth.debian.org/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Canon LiDE 90

guillaume.gastebois
In reply to this post by guillaume.gastebois
Hello,

Thank you Pierre.
I did all what you do : commenting the code in
genesys_flatbed_calibration (Offset/Gain calibration commented out too),
added OPTICAL_FLAG_DISABLE_SHADING to the flags in
gl841_init_optical_regs_scan

analog frontend is so :
    {0x00, 0x21, 0x00, 0x00},
    {0x02, 0x8b, 0x02, 0x8b, 0x02, 0x8b, 0x20, 0x06, 0x00, 0xff,
     0x24, 0x00, 0x00, 0x04},
    {0x02, 0x04,
     0x02, 0x04, 0x02, 0x04,
     0x0a, 0x71,
     0x55,
     0x00, 0x00, 0x20, 0x41}

I can now see my dinosaure ! See picture attached (colored dinosaure on
a white page). It's far from perfect !

 >Guillaume Gastebois schrieb:
 >> Hello,
 >>
 >> OK, my motor moves !
 >
 >Cool.
 >
 >>
 >> But, someting doesn't work during initialisation : I get floating >point
 >> error !
 >>
 >> I modified genesys_gl841.c for instrumentation and genesys_devices.c
 >> (genesys_sensor section) in accordance to my windows usb snoop log >(see
 >> attacement).
 >>
 >> SANE_DEBUG_GENESYS_GL841=255 scanimage
 >> -device-name=genesys:libusb:001:066 > toto.pnm ends with :
 >
 >(please use both SANE_DEBUG_GENESYS_GL841=255 and
 >SANE_DEBUG_GENESYS=255, the device specific code calls back into the
 >unspecific code)
 >
 >>
 >> [genesys_gl841] reg[0x86] = 0x00
 >> [genesys_gl841] reg[0x87] = 0x00
 >> [genesys_gl841] gl841_bulk_write_register: wrote 104 registers
 >> [genesys_gl841] gl841_led_calibration: starting first line reading
 >> [genesys_gl841] gl841_begin_scan
 >> [genesys_gl841] gl841_bulk_write_register (elems = 4)
 >> [genesys_gl841] reg[0x03] = 0x5f
 >> [genesys_gl841] reg[0x01] = 0x81
 >> [genesys_gl841] reg[0x0d] = 0x01
 >> [genesys_gl841] reg[0x0f] = 0x01
 >> [genesys_gl841] gl841_bulk_write_register: wrote 4 registers
 >> [genesys_gl841] gl841_begin_scan: completed
 >> [genesys_gl841] gl841_bulk_read_data: requesting 31200 bytes
 >> [genesys_gl841] gl841_bulk_read_data: trying to read 31200 bytes of
 >>data
 >> [genesys_gl841] gl841_bulk_read_data read 31200 bytes, 0 remaining
 >> [genesys_gl841] gl841_bulk_read_data: completed
 >> [genesys_gl841] gl841_led_calibration: average: 0,801,302
 >> [genesys_gl841] gl841_led_calibration:
 >>avga=367,expr=0,expg=0,expb=0,avge=0
 >> Exception en point flottant (floating point exception)
 >
 >that line above should be more like this:
 >[genesys_gl841] gl841_led_calibration: average: 43901,43865,43387
 >
 >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.
 >
 >The data stream inside gl84x based cis-scanners(at least the LiDE
 >35/50/60) looks like this:
 >-----+
 >gl84x!
 >-----+
 >  ! r,g,b led control line, selects colors r, g, b in turn,
 >  ! controls exposure for each color
 >+---------+
 >!r,g,b led!
 >+---------+
 >  ! r,g,b light
 >+--------+
 >!original!
 >+--------+
 >  ! r,g,b component
 >+----------+
 >!cis sensor!
 >+----------+
 >  ! voltages proportional to light intensity
 >+---------------+
 >!analog frontend!
 >+---------------+
 >  ! 16bit intensity, multiplexed on 8bit data bus
 >-----+
 >gl84x!
 >-----+
 >
 >> See sample image toto.jpg too (when commenting zero division in
 >> genesys_gl841.c the scanner scans an image).
 >>
 >> Help needed thanks
 >>
 >> Guillaume
 >
 >Regards,
 >  Pierre

--
sane-devel mailing list: [hidden email]
http://lists.alioth.debian.org/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to [hidden email]

toto.jpg (41K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Canon LiDE 90

guillaume.gastebois
In reply to this post by guillaume.gastebois
 >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.

Thank you.
Guillaume

--
sane-devel mailing list: [hidden email]
http://lists.alioth.debian.org/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Canon LiDE 90

Pierre Willenbrock-2
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:
http://www.wolfsonmicro.com/productListings/imaging_sensor_adcs/

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.

Regards,
  Pierre

--
sane-devel mailing list: [hidden email]
http://lists.alioth.debian.org/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Canon LiDE 90

guillaume.gastebois
Hello,

OK,
I open my LiDE 90 (very hard not all to destroy...).
I find these IC's :

        GL842 (Genesys well known scanner chip)
        GLT44016P (SO40 RAM)
        BU6574 (TSSOP20 ????????????)
        VHC175 (TSSOP16 quad flip flop)
        VHC08 (TSSOP16 quad and)
        LB1940 (TSSOP20 constant current driver)
        LM324 (SO14 quad op amp)
        1733 (TO-263 regularor)

Appart the BU6574 (I dont find what it is) I dont find any analog
frontend. Is it possible that this chip is located with leds (seems very
hard to open.....)

regards
Guillaume

Pierre Willenbrock a écrit :

> 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:
> http://www.wolfsonmicro.com/productListings/imaging_sensor_adcs/
>
> 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.
>
> Regards,
>   Pierre
>
>

--
sane-devel mailing list: [hidden email]
http://lists.alioth.debian.org/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Canon LiDE 90

Pierre Willenbrock-2
Guillaume Gastebois schrieb:

> Hello,
>
> OK,
> I open my LiDE 90 (very hard not all to destroy...).
> I find these IC's :
>
> GL842 (Genesys well known scanner chip)
> GLT44016P (SO40 RAM)
> BU6574 (TSSOP20 ????????????)
> VHC175 (TSSOP16 quad flip flop)
> VHC08 (TSSOP16 quad and)
> LB1940 (TSSOP20 constant current driver)
> LM324 (SO14 quad op amp)
> 1733 (TO-263 regularor)
>
> Appart the BU6574 (I dont find what it is) I dont find any analog
> frontend. Is it possible that this chip is located with leds (seems very
> hard to open.....)
>

I don't know where the analog frontend may be found. There are arguments
for both positions.

The BU6574 has enough pins for the job. Did you look at the back of the
pcb?

In the documentation i found for one cis sensor, the glassy sensor
itself contains just the ccd row and the leds. There may be a small pcb
on the sensor bar, carrying the analog frontend.

But you really don't need to look for the chip and possibly destroy your
scanner on the way.. Let's first try to figure out how it is configured
from an usb log.

Regards,
  Pierre

--
sane-devel mailing list: [hidden email]
http://lists.alioth.debian.org/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Canon LiDE 90

guillaume.gastebois
OK, but via which register is it programmed. I find nothing in GL842 datasheet
for frontend.

regards
Guillaume

Selon Pierre Willenbrock <[hidden email]>:

> Guillaume Gastebois schrieb:
> > Hello,
> >
> > OK,
> > I open my LiDE 90 (very hard not all to destroy...).
> > I find these IC's :
> >
> > GL842 (Genesys well known scanner chip)
> > GLT44016P (SO40 RAM)
> > BU6574 (TSSOP20 ????????????)
> > VHC175 (TSSOP16 quad flip flop)
> > VHC08 (TSSOP16 quad and)
> > LB1940 (TSSOP20 constant current driver)
> > LM324 (SO14 quad op amp)
> > 1733 (TO-263 regularor)
> >
> > Appart the BU6574 (I dont find what it is) I dont find any analog
> > frontend. Is it possible that this chip is located with leds (seems very
> > hard to open.....)
> >
>
> I don't know where the analog frontend may be found. There are arguments
> for both positions.
>
> The BU6574 has enough pins for the job. Did you look at the back of the
> pcb?
>
> In the documentation i found for one cis sensor, the glassy sensor
> itself contains just the ccd row and the leds. There may be a small pcb
> on the sensor bar, carrying the analog frontend.
>
> But you really don't need to look for the chip and possibly destroy your
> scanner on the way.. Let's first try to figure out how it is configured
> from an usb log.
>
> Regards,
>   Pierre
>



--
sane-devel mailing list: [hidden email]
http://lists.alioth.debian.org/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Canon LiDE 90

Gerhard Jäger
On Friday 01 February 2008 09:18:20 Guillaume Gastebois wrote:
> OK, but via which register is it programmed. I find nothing in GL842 datasheet
> for frontend.
>
check for register 0x04
Layout:
Bit 7   |Bit 6  |Bit 5 Bit 4 |Bit 3 Bit 2 |Bit 1 Bit 0
LINEART |BITSET |AFEMOD[1:0] |FILTER[1:0] |FESET[1:0]

HTH
Gerhard

--
sane-devel mailing list: [hidden email]
http://lists.alioth.debian.org/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Canon LiDE 90

Pierre Willenbrock-2
In reply to this post by guillaume.gastebois
Guillaume Gastebois schrieb:
> OK, but via which register is it programmed. I find nothing in GL842 datasheet
> for frontend.
>
> regards
> Guillaume
>

the analog frontend is programmed through the serial interface accessed
by address registers 0x50(FERDA)/0x51(FEWRA) and data registers
0x46/0x47(FERDDATA)/0x3a/0x3b(FEWRDATA).

I find this sequence in your log:

R/W ! addr ! data  ! WM8199 register
----+------+-------+-----------------
 W  ! 0x04 ! 0x000 ! reset
 R  ! 0x07 ! 0x041 ! revision number, ==0x41
 W  ! 0x04 ! 0x000 ! reset
 W  ! 0x01 ! 0x02f ! Setup reg 1: mode4==0, pgafs=2, selpd=1, mono=1,
cds=1, en=1
 W  ! 0x02 ! 0x007 ! Setup reg 2: del=0, rlcdacrng=0, 0=0, vrlcext=0,
invop=1, muxop=3
 W  ! 0x03 ! 0x026 ! Setup reg 3: chan=0, cdsref=2, rlcv=6
 W  ! 0x06 ! 0x00d ! Setup reg 4: fm=0, intm=0, rlcint=1, fme=1,
acycnrlc=0, linebyline=1
 W  ! 0x08 ! 0x000 ! Setup reg 5: 0=0, posnneg=0, vdel=0, vsmpdet=0
 W  ! 0x20 ! 0x050 ! dac value red(offset value)
 W  ! 0x21 ! 0x050 ! dac value green(offset value)
 W  ! 0x22 ! 0x050 ! dac value blue(offset value)
 W  ! 0x23 ! 0x050 ! dac value rgb(offset value)
 W  ! 0x28 ! 0x028 ! pga gain red(0x28 is a factor of 0.85)
 W  ! 0x29 ! 0x028 ! pga gain green
 W  ! 0x2a ! 0x028 ! pga gain blue
 W  ! 0x2b ! 0x028 ! pga gain rgb


all WM81xx(at least where datasheets are available) share a similar
register layout, with revision 0x41 at address 7. writing to the rgb
variant of pga gain/dac value results in writes to all the color
specific registers, so it is not needed.

So, you have in Genesys_Frontend: reg[1]=0x2f, reg[2]=0x07, reg[3]=0x26,
reg2[0]=0x0d, reg2[1]=0x00, the rest of reg/reg2 =0, all sign[x]=0,
offset[x]=0x50, gain[x]=0x28.

this does not match anything currently in genesys_devices.c. Just add
one entry to the Wolfson array, #define a DAC_xxxx to 7 in genesys_low.h
and put that in your Genesys_Model.

The gain/offset setting should be good for led calibration and will be
replaced by gain/offset calibration.

After that, get a scan of the calibration area(the area under the
housing at the parking position). For this, put 0 into the x_offset and
y_offset in your Genesys_Model. If this turns out to be similar to the
calibration area of the lide 50, led/offset/gain-calibration should work
with only minor changes.

Regards,
  Pierre

--
sane-devel mailing list: [hidden email]
http://lists.alioth.debian.org/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Plustek 7200 log (another GL842 device)

robert w hall
Seeing that people now 'have their eye in' for the GL842, I've taken a
quick log using Benoit's sniffer on a win2k system from my Plustek 7200.

According to the sane-devl page this uses a GL842 ASIC and a AD9826 CCD.

The zipped log is on my demon homepages

http://www.n-cantrell.demon.co.uk/7200logs/usbsnoop.log.gz

Hope someone can see something useful in it

Bob

'Those who like this sort of thing, will find this the sort of thing
they like' (Abe Lincoln's rumoured review of a mediocre book)
--
robert w hall

--
sane-devel mailing list: [hidden email]
http://lists.alioth.debian.org/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Canon LiDE 90

guillaume.gastebois
In reply to this post by Pierre Willenbrock-2
Hello,

It's a little bit better with these values.
In Genesys_Sensor I have :
regs_0x08_0x0b : {0x00, 0x21, 0x00, 0x00}
regs_0x10_0x1d : {0x02, 0x8b, 0x02, 0x8b, 0x02, 0x8b, 0x20, 0x06, 0x00,
0xff, 0x24, 0x00, 0x00, 0x04}
regs_0x52_0x5e : {0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x0a, 0x71, 0x55,
0x00, 0x00, 0x20, 0x41}

In Genesys_Gpo I have :
{0x02, 0x80}{0x7f, 0xe0}

and now in Genesys_Frontend :
{{0x00, 0x2f, 0x07, 0x26}
    , {0x00, 0x00, 0x00}
    , {0x50, 0x50, 0x50}
    , {0x28, 0x28, 0x28}
    , {0x0d, 0x00, 0x00}
    }

Are these value acceptable regarding my log
(http://ggastebois.free.fr/lide90_snoop/UsbSnoop_a4_200dpi.log) ?

I very appreciate your help.

Regards
Guillaume

P.S : attached a sample image with my values.

Pierre Willenbrock a écrit :

> Guillaume Gastebois schrieb:
>> OK, but via which register is it programmed. I find nothing in GL842 datasheet
>> for frontend.
>>
>> regards
>> Guillaume
>>
>
> the analog frontend is programmed through the serial interface accessed
> by address registers 0x50(FERDA)/0x51(FEWRA) and data registers
> 0x46/0x47(FERDDATA)/0x3a/0x3b(FEWRDATA).
>
> I find this sequence in your log:
>
> R/W ! addr ! data  ! WM8199 register
> ----+------+-------+-----------------
>  W  ! 0x04 ! 0x000 ! reset
>  R  ! 0x07 ! 0x041 ! revision number, ==0x41
>  W  ! 0x04 ! 0x000 ! reset
>  W  ! 0x01 ! 0x02f ! Setup reg 1: mode4==0, pgafs=2, selpd=1, mono=1,
> cds=1, en=1
>  W  ! 0x02 ! 0x007 ! Setup reg 2: del=0, rlcdacrng=0, 0=0, vrlcext=0,
> invop=1, muxop=3
>  W  ! 0x03 ! 0x026 ! Setup reg 3: chan=0, cdsref=2, rlcv=6
>  W  ! 0x06 ! 0x00d ! Setup reg 4: fm=0, intm=0, rlcint=1, fme=1,
> acycnrlc=0, linebyline=1
>  W  ! 0x08 ! 0x000 ! Setup reg 5: 0=0, posnneg=0, vdel=0, vsmpdet=0
>  W  ! 0x20 ! 0x050 ! dac value red(offset value)
>  W  ! 0x21 ! 0x050 ! dac value green(offset value)
>  W  ! 0x22 ! 0x050 ! dac value blue(offset value)
>  W  ! 0x23 ! 0x050 ! dac value rgb(offset value)
>  W  ! 0x28 ! 0x028 ! pga gain red(0x28 is a factor of 0.85)
>  W  ! 0x29 ! 0x028 ! pga gain green
>  W  ! 0x2a ! 0x028 ! pga gain blue
>  W  ! 0x2b ! 0x028 ! pga gain rgb
>
>
> all WM81xx(at least where datasheets are available) share a similar
> register layout, with revision 0x41 at address 7. writing to the rgb
> variant of pga gain/dac value results in writes to all the color
> specific registers, so it is not needed.
>
> So, you have in Genesys_Frontend: reg[1]=0x2f, reg[2]=0x07, reg[3]=0x26,
> reg2[0]=0x0d, reg2[1]=0x00, the rest of reg/reg2 =0, all sign[x]=0,
> offset[x]=0x50, gain[x]=0x28.
>
> this does not match anything currently in genesys_devices.c. Just add
> one entry to the Wolfson array, #define a DAC_xxxx to 7 in genesys_low.h
> and put that in your Genesys_Model.
>
> The gain/offset setting should be good for led calibration and will be
> replaced by gain/offset calibration.
>
> After that, get a scan of the calibration area(the area under the
> housing at the parking position). For this, put 0 into the x_offset and
> y_offset in your Genesys_Model. If this turns out to be similar to the
> calibration area of the lide 50, led/offset/gain-calibration should work
> with only minor changes.
>
> Regards,
>   Pierre
>
>

--
sane-devel mailing list: [hidden email]
http://lists.alioth.debian.org/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to [hidden email]

toto.jpg (19K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Canon LiDE 90

Pierre Willenbrock-2
Guillaume Gastebois schrieb:
> Hello,
>
> It's a little bit better with these values.
> In Genesys_Sensor I have :
> regs_0x08_0x0b : {0x00, 0x21, 0x00, 0x00}
> regs_0x10_0x1d : {0x02, 0x8b, 0x02, 0x8b, 0x02, 0x8b, 0x20, 0x06, 0x00,
> 0xff, 0x24, 0x00, 0x00, 0x04}
> regs_0x52_0x5e : {0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x0a, 0x71, 0x55,
> 0x00, 0x00, 0x20, 0x41}

looks good so far(very few of these can be found in the log after my
scripts processed them(bug in my scripts), but then they must be okay
when you are able to scan)

> In Genesys_Gpo I have :
> {0x02, 0x80}{0x7f, 0xe0}

i found these differing settings in your log for register 0x6c:
0x00
0x02
0x0a
0x0e
0x10
0x12
0x18
0x1a
0x38
0x3a
0x3e
0x3c

it may be interesting to find out what the effects of these are.

> and now in Genesys_Frontend :
> {{0x00, 0x2f, 0x07, 0x26}
>    , {0x00, 0x00, 0x00}
>    , {0x50, 0x50, 0x50}
>    , {0x28, 0x28, 0x28}
>    , {0x0d, 0x00, 0x00}
>    }

Looks good.

>
> Are these value acceptable regarding my log
> (http://ggastebois.free.fr/lide90_snoop/UsbSnoop_a4_200dpi.log) ?
>
> I very appreciate your help.
>
> Regards
> Guillaume
>
> P.S : attached a sample image with my values.

Regarding the image: is this with x|y_offset == 0? and are the
horizontal bright lines original?

Regards,
  Pierre

>
> Pierre Willenbrock a écrit :
>> Guillaume Gastebois schrieb:
>>> OK, but via which register is it programmed. I find nothing in GL842
>>> datasheet
>>> for frontend.
>>>
>>> regards
>>> Guillaume
>>>
>>
>> the analog frontend is programmed through the serial interface accessed
>> by address registers 0x50(FERDA)/0x51(FEWRA) and data registers
>> 0x46/0x47(FERDDATA)/0x3a/0x3b(FEWRDATA).
>>
>> I find this sequence in your log:
>>
>> R/W ! addr ! data  ! WM8199 register
>> ----+------+-------+-----------------
>>  W  ! 0x04 ! 0x000 ! reset
>>  R  ! 0x07 ! 0x041 ! revision number, ==0x41
>>  W  ! 0x04 ! 0x000 ! reset
>>  W  ! 0x01 ! 0x02f ! Setup reg 1: mode4==0, pgafs=2, selpd=1, mono=1,
>> cds=1, en=1
>>  W  ! 0x02 ! 0x007 ! Setup reg 2: del=0, rlcdacrng=0, 0=0, vrlcext=0,
>> invop=1, muxop=3
>>  W  ! 0x03 ! 0x026 ! Setup reg 3: chan=0, cdsref=2, rlcv=6
>>  W  ! 0x06 ! 0x00d ! Setup reg 4: fm=0, intm=0, rlcint=1, fme=1,
>> acycnrlc=0, linebyline=1
>>  W  ! 0x08 ! 0x000 ! Setup reg 5: 0=0, posnneg=0, vdel=0, vsmpdet=0
>>  W  ! 0x20 ! 0x050 ! dac value red(offset value)
>>  W  ! 0x21 ! 0x050 ! dac value green(offset value)
>>  W  ! 0x22 ! 0x050 ! dac value blue(offset value)
>>  W  ! 0x23 ! 0x050 ! dac value rgb(offset value)
>>  W  ! 0x28 ! 0x028 ! pga gain red(0x28 is a factor of 0.85)
>>  W  ! 0x29 ! 0x028 ! pga gain green
>>  W  ! 0x2a ! 0x028 ! pga gain blue
>>  W  ! 0x2b ! 0x028 ! pga gain rgb
>>
>>
>> all WM81xx(at least where datasheets are available) share a similar
>> register layout, with revision 0x41 at address 7. writing to the rgb
>> variant of pga gain/dac value results in writes to all the color
>> specific registers, so it is not needed.
>>
>> So, you have in Genesys_Frontend: reg[1]=0x2f, reg[2]=0x07, reg[3]=0x26,
>> reg2[0]=0x0d, reg2[1]=0x00, the rest of reg/reg2 =0, all sign[x]=0,
>> offset[x]=0x50, gain[x]=0x28.
>>
>> this does not match anything currently in genesys_devices.c. Just add
>> one entry to the Wolfson array, #define a DAC_xxxx to 7 in genesys_low.h
>> and put that in your Genesys_Model.
>>
>> The gain/offset setting should be good for led calibration and will be
>> replaced by gain/offset calibration.
>>
>> After that, get a scan of the calibration area(the area under the
>> housing at the parking position). For this, put 0 into the x_offset and
>> y_offset in your Genesys_Model. If this turns out to be similar to the
>> calibration area of the lide 50, led/offset/gain-calibration should work
>> with only minor changes.
>>
>> Regards,
>>   Pierre
>>
>>
>
> ------------------------------------------------------------------------
>


--
sane-devel mailing list: [hidden email]
http://lists.alioth.debian.org/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Canon LiDE 90

guillaume.gastebois
Hello,

Pierre Willenbrock a écrit :

> Guillaume Gastebois schrieb:
>> Hello,
>>
>> It's a little bit better with these values.
>> In Genesys_Sensor I have :
>> regs_0x08_0x0b : {0x00, 0x21, 0x00, 0x00}
>> regs_0x10_0x1d : {0x02, 0x8b, 0x02, 0x8b, 0x02, 0x8b, 0x20, 0x06, 0x00,
>> 0xff, 0x24, 0x00, 0x00, 0x04}
>> regs_0x52_0x5e : {0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x0a, 0x71, 0x55,
>> 0x00, 0x00, 0x20, 0x41}
>
> looks good so far(very few of these can be found in the log after my
> scripts processed them(bug in my scripts), but then they must be okay
> when you are able to scan)
>
>> In Genesys_Gpo I have :
>> {0x02, 0x80}{0x7f, 0xe0}
>
> i found these differing settings in your log for register 0x6c:
> 0x00
> 0x02
> 0x0a
> 0x0e
> 0x10
> 0x12
> 0x18
> 0x1a
> 0x38
> 0x3a
> 0x3e
> 0x3c
>
I tryed all these values :
02 : revert video image with a lot of vertical lines
0a : revert video image with a lot of vertical lines and motor doesn't
stop at the end of the page
0e, 3e : don't know home position anymore
10, 12, 18, 1a : revert video image seems to be in black and white (no
grayscale) but no more vertical images
38, 3a : revert video image in grayscale but take only half of the
screen in height.
3c : motor make noise but don't move

You can find sample at :
http://ggastebois.free.fr/lide90_snoop/toto_18_0_0.jpg
http://ggastebois.free.fr/lide90_snoop/toto_38_0_0.jpg

these two image are original (just saved in jpg) with x y offset set to 0.

How can we explain that images are in reverse video and that with 38 and
3a the image takes only half the place ?

Subsidary question : what is the small white (perhaps black) rectangle
in the middle up off page (for calibration) ?

Regards
Guillaume

> it may be interesting to find out what the effects of these are.
>
>> and now in Genesys_Frontend :
>> {{0x00, 0x2f, 0x07, 0x26}
>>    , {0x00, 0x00, 0x00}
>>    , {0x50, 0x50, 0x50}
>>    , {0x28, 0x28, 0x28}
>>    , {0x0d, 0x00, 0x00}
>>    }
>
> Looks good.
>
>> Are these value acceptable regarding my log
>> (http://ggastebois.free.fr/lide90_snoop/UsbSnoop_a4_200dpi.log) ?
>>
>> I very appreciate your help.
>>
>> Regards
>> Guillaume
>>
>> P.S : attached a sample image with my values.
>
> Regarding the image: is this with x|y_offset == 0? and are the
> horizontal bright lines original?
>
> Regards,
>   Pierre
>
>> Pierre Willenbrock a écrit :
>>> Guillaume Gastebois schrieb:
>>>> OK, but via which register is it programmed. I find nothing in GL842
>>>> datasheet
>>>> for frontend.
>>>>
>>>> regards
>>>> Guillaume
>>>>
>>> the analog frontend is programmed through the serial interface accessed
>>> by address registers 0x50(FERDA)/0x51(FEWRA) and data registers
>>> 0x46/0x47(FERDDATA)/0x3a/0x3b(FEWRDATA).
>>>
>>> I find this sequence in your log:
>>>
>>> R/W ! addr ! data  ! WM8199 register
>>> ----+------+-------+-----------------
>>>  W  ! 0x04 ! 0x000 ! reset
>>>  R  ! 0x07 ! 0x041 ! revision number, ==0x41
>>>  W  ! 0x04 ! 0x000 ! reset
>>>  W  ! 0x01 ! 0x02f ! Setup reg 1: mode4==0, pgafs=2, selpd=1, mono=1,
>>> cds=1, en=1
>>>  W  ! 0x02 ! 0x007 ! Setup reg 2: del=0, rlcdacrng=0, 0=0, vrlcext=0,
>>> invop=1, muxop=3
>>>  W  ! 0x03 ! 0x026 ! Setup reg 3: chan=0, cdsref=2, rlcv=6
>>>  W  ! 0x06 ! 0x00d ! Setup reg 4: fm=0, intm=0, rlcint=1, fme=1,
>>> acycnrlc=0, linebyline=1
>>>  W  ! 0x08 ! 0x000 ! Setup reg 5: 0=0, posnneg=0, vdel=0, vsmpdet=0
>>>  W  ! 0x20 ! 0x050 ! dac value red(offset value)
>>>  W  ! 0x21 ! 0x050 ! dac value green(offset value)
>>>  W  ! 0x22 ! 0x050 ! dac value blue(offset value)
>>>  W  ! 0x23 ! 0x050 ! dac value rgb(offset value)
>>>  W  ! 0x28 ! 0x028 ! pga gain red(0x28 is a factor of 0.85)
>>>  W  ! 0x29 ! 0x028 ! pga gain green
>>>  W  ! 0x2a ! 0x028 ! pga gain blue
>>>  W  ! 0x2b ! 0x028 ! pga gain rgb
>>>
>>>
>>> all WM81xx(at least where datasheets are available) share a similar
>>> register layout, with revision 0x41 at address 7. writing to the rgb
>>> variant of pga gain/dac value results in writes to all the color
>>> specific registers, so it is not needed.
>>>
>>> So, you have in Genesys_Frontend: reg[1]=0x2f, reg[2]=0x07, reg[3]=0x26,
>>> reg2[0]=0x0d, reg2[1]=0x00, the rest of reg/reg2 =0, all sign[x]=0,
>>> offset[x]=0x50, gain[x]=0x28.
>>>
>>> this does not match anything currently in genesys_devices.c. Just add
>>> one entry to the Wolfson array, #define a DAC_xxxx to 7 in genesys_low.h
>>> and put that in your Genesys_Model.
>>>
>>> The gain/offset setting should be good for led calibration and will be
>>> replaced by gain/offset calibration.
>>>
>>> After that, get a scan of the calibration area(the area under the
>>> housing at the parking position). For this, put 0 into the x_offset and
>>> y_offset in your Genesys_Model. If this turns out to be similar to the
>>> calibration area of the lide 50, led/offset/gain-calibration should work
>>> with only minor changes.
>>>
>>> Regards,
>>>   Pierre
>>>
>>>
>> ------------------------------------------------------------------------
>>
>
>
>

--
sane-devel mailing list: [hidden email]
http://lists.alioth.debian.org/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Canon LiDE 90

Pierre Willenbrock-2
Guillaume Gastebois schrieb:

> Hello,
>
> Pierre Willenbrock a écrit :
>> Guillaume Gastebois schrieb:
>>> Hello,
>>>
>>> It's a little bit better with these values.
>>> In Genesys_Sensor I have :
>>> regs_0x08_0x0b : {0x00, 0x21, 0x00, 0x00}
>>> regs_0x10_0x1d : {0x02, 0x8b, 0x02, 0x8b, 0x02, 0x8b, 0x20, 0x06, 0x00,
>>> 0xff, 0x24, 0x00, 0x00, 0x04}
>>> regs_0x52_0x5e : {0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x0a, 0x71, 0x55,
>>> 0x00, 0x00, 0x20, 0x41}
>> looks good so far(very few of these can be found in the log after my
>> scripts processed them(bug in my scripts), but then they must be okay
>> when you are able to scan)
>>
>>> In Genesys_Gpo I have :
>>> {0x02, 0x80}{0x7f, 0xe0}
>> i found these differing settings in your log for register 0x6c:
>> 0x00
>> 0x02
>> 0x0a
>> 0x0e
>> 0x10
>> 0x12
>> 0x18
>> 0x1a
>> 0x38
>> 0x3a
>> 0x3e
>> 0x3c
>>
> I tryed all these values :
> 02 : revert video image with a lot of vertical lines
> 0a : revert video image with a lot of vertical lines and motor doesn't
> stop at the end of the page
> 0e, 3e : don't know home position anymore
> 10, 12, 18, 1a : revert video image seems to be in black and white (no
> grayscale) but no more vertical images
> 38, 3a : revert video image in grayscale but take only half of the
> screen in height.
> 3c : motor make noise but don't move
>
> You can find sample at :
> http://ggastebois.free.fr/lide90_snoop/toto_18_0_0.jpg
> http://ggastebois.free.fr/lide90_snoop/toto_38_0_0.jpg
>
> these two image are original (just saved in jpg) with x y offset set to 0.
>
> How can we explain that images are in reverse video and that with 38 and
> 3a the image takes only half the place ?

I don't know why the image colors are reversed, but it may be worth
trying to flip the sign bits in Genesys_Frontend. If that does nothing,
we need to handle that in code(or i am missing some setting of the gl841).
The other thing you have seen is the half-resolution mode, used for
greater speed when doing lower(i.E. not full) resolutions.

> Subsidary question : what is the small white (perhaps black) rectangle
> in the middle up off page (for calibration) ?

That may be a small metal clamp holding the glass or the calibration
strip. That is the black(i.E. white) part at the very top.

To summarize, it is a good idea to have bit 4 on, bit 5 is the half
resolution switch. I'd put 0x10 into the 0x6c gpio register.

As for the calibration area, you will need to change some code:
* comment out genesys_gl841.c:4220:(line numbers may differ)
  status = gl841_feed(dev, 280);/*feed to white strip. canon lide 35 only.*/
* the same for genesys_gl841.c:4821:
  status = gl841_feed(dev, 280);/*feed to white strip. canon lide 35 only.*/

then you can try what happens when you turn on the led_calibration and
the coarse_gain_calibration. offset_calibration needs a bit more
changes. i think i am having the code needed lying around somewhere.
essentially, the offset calibration needs to be done with leds off.
the shading calibration does need even more changes.

Additionally, if you can't get the afe to switch the sign, you need to
do that in the calibration functions(i.E. 65535-value).

Regards,
  Pierre

>
> Regards
> Guillaume
>
>> it may be interesting to find out what the effects of these are.
>>
>>> and now in Genesys_Frontend :
>>> {{0x00, 0x2f, 0x07, 0x26}
>>>    , {0x00, 0x00, 0x00}
>>>    , {0x50, 0x50, 0x50}
>>>    , {0x28, 0x28, 0x28}
>>>    , {0x0d, 0x00, 0x00}
>>>    }
>> Looks good.
>>
>>> Are these value acceptable regarding my log
>>> (http://ggastebois.free.fr/lide90_snoop/UsbSnoop_a4_200dpi.log) ?
>>>
>>> I very appreciate your help.
>>>
>>> Regards
>>> Guillaume
>>>
>>> P.S : attached a sample image with my values.
>> Regarding the image: is this with x|y_offset == 0? and are the
>> horizontal bright lines original?
>>
>> Regards,
>>   Pierre
>>


--
sane-devel mailing list: [hidden email]
http://lists.alioth.debian.org/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Canon LiDE 90

guillaume.gastebois
Hello,

I need a little bit more informations befor testing (sorry for my poor knowledge
in scanner)

Selon Pierre Willenbrock <[hidden email]>:

> I don't know why the image colors are reversed, but it may be worth
> trying to flip the sign bits in Genesys_Frontend. If that does nothing,
> we need to handle that in code(or i am missing some setting of the gl841).
> The other thing you have seen is the half-resolution mode, used for
> greater speed when doing lower(i.E. not full) resolutions.
>

How do you explain yhat with half resolution the image seems to be grayscale and
without it seems to be lineart ?

> > Subsidary question : what is the small white (perhaps black) rectangle
> > in the middle up off page (for calibration) ?
>
> That may be a small metal clamp holding the glass or the calibration
> strip. That is the black(i.E. white) part at the very top.
>
Under this small rectangle I have a vertical more clear line(same height). Is it
because I need to tweek calibration area (without this small rectangle) ?

> To summarize, it is a good idea to have bit 4 on, bit 5 is the half
> resolution switch. I'd put 0x10 into the 0x6c gpio register.
>
> As for the calibration area, you will need to change some code:
> * comment out genesys_gl841.c:4220:(line numbers may differ)
>   status = gl841_feed(dev, 280);/*feed to white strip. canon lide 35 only.*/
> * the same for genesys_gl841.c:4821:
>   status = gl841_feed(dev, 280);/*feed to white strip. canon lide 35 only.*/
>
> then you can try what happens when you turn on the led_calibration and
> the coarse_gain_calibration. offset_calibration needs a bit more
> changes. i think i am having the code needed lying around somewhere.
> essentially, the offset calibration needs to be done with leds off.
> the shading calibration does need even more changes.
>
Where to find led_calibration, coarse_gain_calibration ? How to turn them on ?
For personnal information : what is shading calibration ????

> Additionally, if you can't get the afe to switch the sign, you need to
> do that in the calibration functions(i.E. 65535-value).
>

Only in calibration function ?

Regards
Guillaume

> Regards,
>   Pierre
>

--
sane-devel mailing list: [hidden email]
http://lists.alioth.debian.org/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Canon LiDE 90

Pierre Willenbrock-2
Guillaume Gastebois schrieb:

> Hello,
>
> I need a little bit more informations befor testing (sorry for my poor knowledge
> in scanner)
>
> Selon Pierre Willenbrock <[hidden email]>:
>
>> I don't know why the image colors are reversed, but it may be worth
>> trying to flip the sign bits in Genesys_Frontend. If that does nothing,
>> we need to handle that in code(or i am missing some setting of the gl841).
>> The other thing you have seen is the half-resolution mode, used for
>> greater speed when doing lower(i.E. not full) resolutions.
>>
>
> How do you explain yhat with half resolution the image seems to be grayscale and
> without it seems to be lineart ?

If you look closely, you see that the image is not exactly lineart. When
doing half resolution, the sensitivity of the scanner sensor changes,
and thus needs a different afe setup. That should be handled gracefully
by the offset/gain calibration, once those are working.

>>> Subsidary question : what is the small white (perhaps black) rectangle
>>> in the middle up off page (for calibration) ?
>> That may be a small metal clamp holding the glass or the calibration
>> strip. That is the black(i.E. white) part at the very top.
>>
> Under this small rectangle I have a vertical more clear line(same height). Is it
> because I need to tweek calibration area (without this small rectangle) ?
>
>> To summarize, it is a good idea to have bit 4 on, bit 5 is the half
>> resolution switch. I'd put 0x10 into the 0x6c gpio register.
>>
>> As for the calibration area, you will need to change some code:
>> * comment out genesys_gl841.c:4220:(line numbers may differ)
>>   status = gl841_feed(dev, 280);/*feed to white strip. canon lide 35 only.*/
>> * the same for genesys_gl841.c:4821:
>>   status = gl841_feed(dev, 280);/*feed to white strip. canon lide 35 only.*/
>>
>> then you can try what happens when you turn on the led_calibration and
>> the coarse_gain_calibration. offset_calibration needs a bit more
>> changes. i think i am having the code needed lying around somewhere.
>> essentially, the offset calibration needs to be done with leds off.
>> the shading calibration does need even more changes.
>>
> Where to find led_calibration, coarse_gain_calibration ? How to turn them on ?
> For personnal information : what is shading calibration ????

They are called by genesys_flatbed_calibration, i think i requested to
comment them out earlier.

There are three things to calibrate for:
1) the mapping from sensor voltages to numbers, to not lose color space
by clipping lower brightness to 0 or higher brightness to 65535.
ideally, you don't ever see 0 or 65535 from the afe. This is mainly the
job of offset/gain calibration, but the led-exposure is a factor to this.
2) the color intensities relative to each other. We try to get each
colored LED to lead to similar voltages in the sensor during its
exposure. This is calibrated by led_calibration
3) Variations between the sensor cells. each sensor cell has it's own
sensitivity and black voltage, so there needs to be a
per-pixel-correction. This is done by shading_calibration.

Additionally, the shading_calibration is by-color, so this is the place
where we map each color channel to the correct range, as the
led_calibration is not that exact.

>
>> Additionally, if you can't get the afe to switch the sign, you need to
>> do that in the calibration functions(i.E. 65535-value).
>>
>
> Only in calibration function ?

For now, that should be enough. We are not interested in the actual
output image, yet.

Regards,
  Pierre

>
> Regards
> Guillaume
>
>> Regards,
>>   Pierre
>>
>


--
sane-devel mailing list: [hidden email]
http://lists.alioth.debian.org/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Canon LiDE 90

guillaume.gastebois
Hello,

Why calibration is so long (~50/60s) ?

What are /* Start of white strip in mm (y) */ and /* Start of black mark
in mm (x) */ in genesys_devices.c ?

Regarding the log file you said :
W  ! 0x23 ! 0x050 ! dac value rgb(offset value)
W  ! 0x2b ! 0x028 ! pga gain rgb
But on debug, I see that these two registers are never written.

Another thing : when scaning in color the leds are blue ????

Pierre Willenbrock a écrit :

> Guillaume Gastebois schrieb:
>> Hello,
>>
>> I need a little bit more informations befor testing (sorry for my poor knowledge
>> in scanner)
>>
>> Selon Pierre Willenbrock <[hidden email]>:
>>
>>> I don't know why the image colors are reversed, but it may be worth
>>> trying to flip the sign bits in Genesys_Frontend. If that does nothing,
>>> we need to handle that in code(or i am missing some setting of the gl841).
>>> The other thing you have seen is the half-resolution mode, used for
>>> greater speed when doing lower(i.E. not full) resolutions.
>>>
>> How do you explain yhat with half resolution the image seems to be grayscale and
>> without it seems to be lineart ?
>
> If you look closely, you see that the image is not exactly lineart. When
> doing half resolution, the sensitivity of the scanner sensor changes,
> and thus needs a different afe setup. That should be handled gracefully
> by the offset/gain calibration, once those are working.
>
>>>> Subsidary question : what is the small white (perhaps black) rectangle
>>>> in the middle up off page (for calibration) ?
>>> That may be a small metal clamp holding the glass or the calibration
>>> strip. That is the black(i.E. white) part at the very top.
>>>
>> Under this small rectangle I have a vertical more clear line(same height). Is it
>> because I need to tweek calibration area (without this small rectangle) ?
>>
>>> To summarize, it is a good idea to have bit 4 on, bit 5 is the half
>>> resolution switch. I'd put 0x10 into the 0x6c gpio register.
>>>
>>> As for the calibration area, you will need to change some code:
>>> * comment out genesys_gl841.c:4220:(line numbers may differ)
>>>   status = gl841_feed(dev, 280);/*feed to white strip. canon lide 35 only.*/
>>> * the same for genesys_gl841.c:4821:
>>>   status = gl841_feed(dev, 280);/*feed to white strip. canon lide 35 only.*/

When I comment out these lines the result is very bad (sample
http://ggastebois.free.fr/lide90_snoop/toto_10_0_0_comment.jpg)

>>>
>>> then you can try what happens when you turn on the led_calibration and
>>> the coarse_gain_calibration. offset_calibration needs a bit more
>>> changes. i think i am having the code needed lying around somewhere.
>>> essentially, the offset calibration needs to be done with leds off.
>>> the shading calibration does need even more changes.
>>>
>> Where to find led_calibration, coarse_gain_calibration ? How to turn them on ?
>> For personnal information : what is shading calibration ????
>
> They are called by genesys_flatbed_calibration, i think i requested to
> comment them out earlier.

OK, sorry, I did that some days ago. My last mail and sample images were
WITH led_calibration and coarse_gain_calibration.

>
> There are three things to calibrate for:
> 1) the mapping from sensor voltages to numbers, to not lose color space
> by clipping lower brightness to 0 or higher brightness to 65535.
> ideally, you don't ever see 0 or 65535 from the afe. This is mainly the
> job of offset/gain calibration, but the led-exposure is a factor to this.
> 2) the color intensities relative to each other. We try to get each
> colored LED to lead to similar voltages in the sensor during its
> exposure. This is calibrated by led_calibration
> 3) Variations between the sensor cells. each sensor cell has it's own
> sensitivity and black voltage, so there needs to be a
> per-pixel-correction. This is done by shading_calibration.
>
> Additionally, the shading_calibration is by-color, so this is the place
> where we map each color channel to the correct range, as the
> led_calibration is not that exact.
>
>>> Additionally, if you can't get the afe to switch the sign, you need to
>>> do that in the calibration functions(i.E. 65535-value).
>>>
>> Only in calibration function ?
>
> For now, that should be enough. We are not interested in the actual
> output image, yet.
>
> Regards,
>   Pierre
>
>> Regards
>> Guillaume
>>
>>> Regards,
>>>   Pierre
>>>
>
>
>
Regards
Guillaume


--
sane-devel mailing list: [hidden email]
http://lists.alioth.debian.org/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Canon LiDE 90

Pierre Willenbrock-2
Hi Guillaume,

Guillaume Gastebois schrieb:
> Hello,
>
> Why calibration is so long (~50/60s) ?

It is probably failing. Should take about 3-5 seconds. Look at the logs,
the calculated averages and calibration are dumped there.

> What are /* Start of white strip in mm (y) */ and /* Start of black mark
> in mm (x) */ in genesys_devices.c ?

Those are configuration values for calibration steps. I don't know if
any of these are currently used or if the values are hardcoded.

I think the start-of-black-mark is used to detect the beginning of the
document area for some gl646 scanners. The start-of-white-strip was once
used in shading calibration. Currently, the shading calibration is setup
for a calibration area looking like this:

home position
+--------------------------------
!   black area
+--------------------------------
!   white area
+--------------------------------

The border between black area and white area is autodetected per pixel,
as the border is usually not straight.

You scanner seems to offer only a white area, so we will need to do
shading calibration differently. My current idea is this:
* always gather data on a white area
* for black data, reduce the led exposure time to the minimum(0x101,
those registers cannot be set to 0. per byte.).
* for white data, use the normal exposure times
I tried something like this for offset calibration, to see if there is
any difference between white area+0x101 exposure time and black
area+normal exposure time. There was no difference in the final images,
and i think the resulting calibration was the same as well.

> Regarding the log file you said :
> W  ! 0x23 ! 0x050 ! dac value rgb(offset value)
> W  ! 0x2b ! 0x028 ! pga gain rgb
> But on debug, I see that these two registers are never written.

0x23 and 0x2b are merely convenience registers. Writing to 0x23 and 0x2b
is equivalent to a write to each of 0x20-0x22 and 0x28-0x2a. For
cis-sensors, there is only one channel used, so we could get away with
only two registers writes(for the correct channel or 0x23/0x2b), but
this won't work for ccd-sensors.

> Another thing : when scaning in color the leds are blue ????

I'd expect a shade of white, perhaps blueish. my scanner does a
magentaish white. You may also see the single colors when quickly moving
your eyes relatively to the scanner.

Regards,
  Pierre

--
sane-devel mailing list: [hidden email]
http://lists.alioth.debian.org/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Canon LiDE 90

sane-4
Hi guys,

I gess I have an answer of my question ;)
> I just bought a Canon LiDE 90 and can't make it work ... I will try to
> make a backend, but I wanted to be sure that nobody was doing it ...
>
> Is there anybody working on it ?
>  
Do you think I could help for anything ? Can I download anywhere what
you did until now ?

I'd really like to make my new scan to work ;)

Thanks for your job.

--
sane-devel mailing list: [hidden email]
http://lists.alioth.debian.org/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
             to [hidden email]
12345