HP4200 info page

This page contains technical info about the internal operation of the HP4200 Flatbed Scanner.

pv8630 - Parallel Port to USB bridge

This chip is a parallel port to USB bridge. There isn't really any documentation on the web about this chip, but nothing re-engeneering can not do. Remember that the NS lm9830 has a parallel port interface, not an USB port ---NS lm9831 has a USB port--- so that's why HP 4200 uses this bridge. Support functions for the pv8630 are in `pv8630.h' and `pv8630.c'. Functions defined in that module talk directly to the Linux USB stack.

NS lm9830 - A scanner on a chip

This is the main chip of the scanner. Look at Merlin Project Home Page for datasheets, software, newer releases and hardware info. There are some issues about programming a scanning process.

Color displacement

The scanner head has 3 sensors, one for each color (red, green and blue). But due to phisical constraints, those sensors are separated each one from the other by some distance. At 600 dpi this distance is of 4 lines, at higher resolutions there will be more lines between them and at lower resolutions there will be less (the distance is always the same, but at a higher resolution the scanner can distinguish more lines).

So to get a correct image color planes must be adjusted. Suppose you want to scan a color photo using 600 dpi as vertical resolution. Once the lm9830 is cofigured to do so at line rate mode, you will get the color info of the image from the scanner buffer in the follogin order: first you will get the data of the red sensor at the position the head scanner is. Then you will get data from the green sensor, but this data matches the info of a line of the photo image 4 lines lower than the line the red sensor has scanned, because the scanner head stays in the same position and is not moved until the data from the tree sensors have been read. So after reading data from the green sensor data from the blue sensor will match color info from the line of the photo image that is 4 lines below the green sensor and 8 lines below the red sensor.

So if you put scanning data into a file after removing the status byte of each line you will get the scanned image in line-interlaced raw format, but due to the offset of the scanner sensors the color planes will be displaced: 4 lines the red plane from the green plane, and 4 lines the green plane from the blue one.

Some factors affect color plane offset:

The `m out of n' function

Maybe the PC-Transfer rate is too low or you can't adjust scanner parameters to slow down the scanning process and thus scanning pause is too frecuent.

So what can you do then? The answer is to scan at a higher vertical resolution and discard some lines so only a few lines are really saved on memory and transmitted to the host computer.

For example, suppose you want to scan at a vertical resolution of 600dpi, but the scanner fills the buffer too quickly because you want to scan the maximum line length. Usually moving the scanner head is slower than filling the scanning buffer. So if you say the scanner to scan at a double vertical resolution (1200 dpi) and discard one of each two lines scanned, the scanning process will take twice the time than scanning at 600dpi, because the computed step size is (s)lower. The chip is capable of discard certain number of lines (m) of a bigger number (n) of scanned lines. The discarted lines are not saved in the buffer, but the status byte is.

This functionality can also be used to scan at lower resolutions than 150 dpi when the maximum motor speed is reached. Discarding one of each two lines at 150 vdpi you will get a vertical resolution of 75 dpi.

(under construction...)

Adrian Perez Jorge

Last modified : 1 April 2000