[sane-devel] Pulstek OpticBook 3800

ibu ☉ radempa ䷰ ibu at radempa.de
Thu Apr 25 18:45:28 UTC 2013


On 2013-04-25 18:53, ibu ☉ radempa ䷰ wrote:
> On 2013-04-24 07:05, Stef wrote:
>> On 23/04/2013 10:23, Nikolay Shaplov wrote:
>>>>       the first step is to find the exact ASIC used in your scanner.
>>>> Can
>>>> you post an USB log of a preview done with the windows driver ?
>>> http://lj.shaplov.ru/2013/UsbSnoop.log.gz
>>> http://lj.shaplov.ru/2013/UsbSnoop.parsed.log.gz  (parsed with usbsnoop-
>>> gl847.pl as I found in this mail list)
>>>
>>> This log is sniffed right from the point of when scanner were turned on.
>>>
>>>> And also the result of lsusb -v ?
>>> lsusb.log in attach
>>>
>>>> Is there a chance you can IC through the glass when the scanning
>>>> head is
>>>> moving ?
>>> IC is for microchip? Then there are
>>>
>>> 27ANG9K G4 \n ACT 04
>>>
>>> and
>>>
>>> UTC \n 78D  05L \n 01 PGT0
>>>
>>> The first one has about 14 legs, the second one only two.
>>>
>>> There are two chips with first sign  and two chips with second sign
>>> on the
>>> board that attached to the head.
>>>
>>>>       Then adding this scanner will be like you started it, but you'll
>>>> also have to add specific entries for sensor, motor and gpio which
>>>> change from device to device. The needed values will have to be deduced
>>>> from USB logs.
>>> I've already started to view USB log and found matches with GL646
>>> spec, but I
>>> am still not really good with it, and also I still do not understand
>>> how does
>>> such simple operations, as writing some bits into LAMPPWM (for
>>> example) from
>>> USB log corresponds with the code from genesys_gl847.c
>>>
>>>
>>>> The code path will had to be modified for the new defines.
>>>>       BTW there is no CCD sensor support currently in gl847 code, only
>>>> CIS sensors are handled. That would need to be changed firt.
>>> What is CCD and CIS? :-)
>>>
>>>
>>     Hello,
>>
>>     to my knowledge, regarding bdcDevice, we currently have:
>>
>> GL843 devices bcdDevice 5.00
>> GL846 devices bcdDevice 6.01
>> GL847 devices bcdDevice 6.03
>> GL124 devices bcdDevice 7.01
>>
>>     So the the 6.05 value you have is a hint that your scanner doesn't
>> use a supported genesys ASIC, probably a GL848 or GL123. By comparing
>> the datasheet of these ASIC, you'll find register that aren't shared,
>> and if you find the use of such registers in log, you'll be able to
>> identify the ASIc used.
>>     Or find a 38x26 pins IC, labeled xxxx GLnnn, where nnn will be the
>> ASIC version. 
> Hi Nikolay and Stef,
>
> opening an OpticBook 3800 (bottom metal plate and metal shield) I found
> a chip with roughly 2x38x26 pins labeled:
>
> GL845
> 1023H5508401-01G
>
> This is no typo, it really reads GL845. Here is the datasheet for this chip:
> http://www.genesyslogic.com/manage/upfile/12416597621.pdf
>
> I would very much appreciate having a working linux driver for OpticBook
> 3800, since to my knowledge this would be the first (affordable) flatbed
> scanner having a book edge and working with linux. Maybe I can
> contribute a bit during the next two weeks.
>
> Does anybody on the list know which chip is used in OpticBook 4800? That
> device seems roughly twice as fast (and expensive).
>
> Regards,
> ibu
I've annotated the init phase from UsbSnoop.parsed.log using the
datasheet to get an idea of what's going on (attached).
-------------- next part --------------
unknown8e(33) = 0x00
set_write_register(0x01, 0x22)	# enable shading fucntion, select area-shading
unknown8e(32) = 0x55
set_write_register(0x25, 0x00)	# reset lines count (4 most significant bits), LINCNT [19:16]
unknown8e(32) = 0x55
set_write_register(0x68, 0x7f)	# PWM duty cycle selection, default value
unknown8e(32) = 0x55
set_write_register(0x9d, 0x04)	# Do not force the trigger position of motor trigger. Select two-pin type control for COM1 & COM2 of LCD (GPO29&30). Select the multiplier of slope table. For Reg 21, 24, 5F, 69, 6A, the real slope steps are register values multiplied by 4. Select data writing for LCM.
unknown8e(32) = 0x55
unknown8e(0) = 0x00
read_register(0x41) = 0xdc	# mixed status bits (power, img buf, motor, lamp, ...)
set_write_register(0x03, 0x10)
unknown8e(32) = 0x55
read_register(0xa6) = 0x1c	# GPIO[24:17]
set_write_register(0xa6, 0x1c)	# ?
unknown8e(32) = 0x55
read_register(0xa6) = 0x1c	# again?
set_write_register(0xa6, 0x1c)
unknown8e(32) = 0x55
unknown8e(33) = 0x00
unknown8e(0) = 0x00
read_register(0x06) = 0xf0	# scan mode: 16 clocks/pixel; PWRBIT: ...; GAIN4: ...; ASIC operation type: normal mode to capture AFE image
set_write_register(0x02, 0x78)	# auto-go-home and motor control (power on, forward, ...)
unknown8e(32) = 0x55
set_write_register(0x20, 0x10)	# set buffer condition. When buffer is full, scanner will stop and wait for host to read out image data from SDRAM.
unknown8e(32) = 0x55
set_write_register(0x68, 0x7f)	# again, default value
unknown8e(32) = 0x55
set_write_register(0x9d, 0x04)	# again
unknown8e(32) = 0x55
unknown8e(32) = 0x55
unknown8e(32) = 0x55
set_write_register(0x0b, 0x22)	# system clock: 30MHz; auto-refresh SDRAM; SDRAM size: 64M bits
unknown8e(32) = 0x55
set_write_register(0xa2, 0x0f)	# SDRAM refresh time: 30us
unknown8e(32) = 0x55
set_write_register(0x0b, 0x2a)	# system clock: 30MHz; start power on sequence of SDRAM; SDRAM size: 64M bits
unknown8e(32) = 0x55
read_register(0x41) = 0xdc	# mixed status bits
read_register(0x41) = 0xdc	# mixed status bits
set_write_register(0x03, 0x10)	# disable sleep mode of lamp; Select dpi deletion function; Select flatbed lamp on; Turn on LAMP power; sleep mode of lamp: 0 minutes
unknown8e(32) = 0x55
set_write_register(0x51, 0x04)	# Address of control register of front-end in write operation ... Cf. reg. 3A,3B
unknown8e(32) = 0x55
set_write_register(0x51, 0x01)  # ?
unknown8e(32) = 0x55
set_write_register(0x51, 0x02)	# ?
unknown8e(32) = 0x55
set_write_register(0x51, 0x03)	# ?
unknown8e(32) = 0x55
set_write_register(0x51, 0x05)	# ?
unknown8e(32) = 0x55
set_write_register(0x51, 0x20)	# ?
unknown8e(32) = 0x55
set_write_register(0x51, 0x21)	# ?
unknown8e(32) = 0x55
set_write_register(0x51, 0x22)	# ?
unknown8e(32) = 0x55
set_write_register(0x51, 0x24)	# ?
unknown8e(32) = 0x55
set_write_register(0x51, 0x25)	# ?
unknown8e(32) = 0x55
set_write_register(0x51, 0x26)	# ?
unknown8e(32) = 0x55
set_write_register(0x51, 0x28)	# ?
unknown8e(32) = 0x55
set_write_register(0x51, 0x29)	# ?
unknown8e(32) = 0x55
set_write_register(0x51, 0x2a)	# ?
unknown8e(32) = 0x55
unknown8e(33) = 0x00
read_register(0xa6) = 0x1c	# GPIO[24:17]
read_register(0xa6) = 0x1c	# GPIO[24:17]
read_register(0x41) = 0xdc	# mixed status bits
unknown8e(32) = 0x55
unknown8e(32) = 0x55
read_register(0x41) = 0xdc	# mixed status bits
read_register(0x41) = 0xdc	# mixed status bits
read_register(0x41) = 0xdc	# mixed status bits
set_write_register(0x03, 0x1f)	# disable sleep mode of lamp; Select dpi deletion function; Select flatbed lamp on; Turn on LAMP power; sleep mode of lamp: 15 minutes
unknown8e(32) = 0x55
read_register(0xa6) = 0x1c	# GPIO[24:17]
set_write_register(0xa6, 0x1c)	# GPIO[24:17]
unknown8e(32) = 0x55
read_register(0xa6) = 0x1c	# GPIO[24:17]
set_write_register(0xa6, 0x1c)	# ?
unknown8e(32) = 0x55
unknown8e(32) = 0x55
unknown8e(32) = 0x55
set_write_register(0x01, 0x22)	# CCD scan type; Disable watchdog function; Enable shading function; Disable double shading; Disable data compression; Disable true gray function; Select area-shading; Disable scanning process
unknown8e(32) = 0x55
set_write_register(0x26, 0x00)	# reset lines count bits, LINCNT [15:8]
unknown8e(32) = 0x55
set_write_register(0x69, 0x01)	# Deceleration steps after scanning finished (table three)
unknown8e(32) = 0x55
set_write_register(0xa7, 0x8f)	# GPOE [24:17]
unknown8e(32) = 0x55
set_write_register(0x51, 0x01)	# again
unknown8e(32) = 0x55
set_write_register(0x51, 0x02)
unknown8e(32) = 0x55
set_write_register(0x51, 0x03)
unknown8e(32) = 0x55
set_write_register(0x51, 0x05)
unknown8e(32) = 0x55
set_write_register(0x51, 0x20)
unknown8e(32) = 0x55
set_write_register(0x51, 0x21)
unknown8e(32) = 0x55
set_write_register(0x51, 0x22)
unknown8e(32) = 0x55
set_write_register(0x51, 0x24)
unknown8e(32) = 0x55
set_write_register(0x51, 0x25)
unknown8e(32) = 0x55
set_write_register(0x51, 0x26)
unknown8e(32) = 0x55
set_write_register(0x51, 0x28)
unknown8e(32) = 0x55
set_write_register(0x51, 0x29)
unknown8e(32) = 0x55
set_write_register(0x51, 0x2a)
unknown8e(32) = 0x55
read_register(0x41) = 0xdc
set_write_register(0xd0, 0x0a)	# Shading bank0 address setting for CCD. Unit is in 4k words. SH0DWN [7:0]
unknown8e(32) = 0x55
set_write_register(0xd1, 0x0a)  # Shading bank1 address setting for CCD. Unit is in 4k words. SH1DWN [7:0]
unknown8e(32) = 0x55
set_write_register(0xd2, 0x0a)	# Shading bank2 address setting for CCD. Unit is in 4k words. SH2DWN [7:0]
unknown8e(32) = 0x55
set_write_register(0xe0, 0x00)	# Bit15~8 Registers setting for R-Channel ODD image buffer start-address. R1DWN [15:8]
unknown8e(32) = 0x55
set_write_register(0xe2, 0x03)	# R1UP[15:8]
unknown8e(32) = 0x55
set_write_register(0xe4, 0x03)	# R2DWN [15:8]
unknown8e(32) = 0x55
set_write_register(0xe6, 0x05)	# R2UP[15:8]
unknown8e(32) = 0x55
set_write_register(0xe8, 0x05)	# G1DWN [15:8]
unknown8e(32) = 0x55
set_write_register(0xea, 0x08)	# G1UP[15:8]
unknown8e(32) = 0x55
set_write_register(0xec, 0x08)	# G2DWN [15:8]
unknown8e(32) = 0x55
set_write_register(0xee, 0x0a)	# G2UP [15:8]
unknown8e(32) = 0x55
set_write_register(0xf0, 0x0a)	# B1DWN [15:8]
unknown8e(32) = 0x55
set_write_register(0xf2, 0x0d)	# B1UP[15:8]
unknown8e(32) = 0x55
set_write_register(0xf4, 0x0d)	# B2DWN [15:8]
unknown8e(32) = 0x55
set_write_register(0xf6, 0x0f)	# B2UP [15:8]
unknown8e(32) = 0x55
set_write_register(0xf8, 0x05)	# Define bank number of image buffer for buffer-full (for MAXWD), MAXSEL [3:0]; Define bank number of image buffer for buffer-empty, MINSEL [3:0]
unknown8e(32) = 0x55
set_write_register(0x0c, 0x02)	# set the lines count which is synchronized for CCD timing(like NEC8884)
unknown8e(32) = 0x55
read_register(0x41) = 0xdc
read_register(0x41) = 0xdc
read_register(0x41) = 0xdc
set_write_register(0x03, 0x9f)	# as beforehand, but Select dpi average function
unknown8e(32) = 0x55
set_write_register(0x51, 0x28)	# again
unknown8e(32) = 0x55
set_write_register(0x51, 0x29)
unknown8e(32) = 0x55
set_write_register(0x51, 0x2a)
unknown8e(32) = 0x55
set_write_register(0x51, 0x20)
unknown8e(32) = 0x55
set_write_register(0x51, 0x21)
unknown8e(32) = 0x55
set_write_register(0x51, 0x22)
unknown8e(32) = 0x55
set_write_register(0x0d, 0x05)	# send the RS232 data; clear SCANCNT (Reg4B,Reg4C,Reg4D) Note: 1.For each scanning, designers must clear SCANCNT before starting process, 2. They are write-one commands
unknown8e(32) = 0x55
set_write_register(0x0d, 0x07)	# as beforehand, but clear document jam message for ADF module
unknown8e(32) = 0x55
set_write_register(0x01, 0x03)	# as beforehand, but now: Disable shading function; Enable scanning process
unknown8e(32) = 0x55
set_write_register(0x0f, 0x01)	# Start motor forward/backward moving
unknown8e(32) = 0x55
read_register(0x41) = 0xcd
read_register(0x41) = 0xcd
read_register(0x41) = 0xcd
read_register(0x41) = 0xed	# Motor feeding is finished
read_register(0x41) = 0xed
read_register(0x41) = 0xed
read_register(0x41) = 0xed
read_register(0x41) = 0xed
read_register(0x41) = 0xed
read_register(0x41) = 0xed
read_register(0x41) = 0xed
read_register(0x41) = 0x9c	# The image buffer is not empty; Motor is not operation
read_register(0x42) = 0x00	# VALIDWORD [25:24] The available image data stored in SDRAM for host to read.
read_register(0x43) = 0x00	# VALIDWORD [23:16]
read_register(0x44) = 0x01	# VALIDWORD [15:8]
read_register(0x45) = 0xe6	# VALIDWORD [7:0]
buf_prepaccess(ADDR=0x10000000,BYTES=0x00000c00,BULK_IN)
Data: 00 00 00 10 00 0c 00 00
unknown8e(32) = 0x55
BULK<(3072)
  0x00, 0x00, 0x00, 0x00,  0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00,  0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00,  0x00, 0x00, 0x00, 0x00,
.
.
.


More information about the sane-devel mailing list