5/29/01

THIS LM983x TWAIN v2.03a PACKAGE IS FOR:
A Windows 98/2000/Me PC connected to a LM9831/LM9832/LM9833 
USB scanner. Ini files are provided for Canon n650u and Umax 3400
and Avision AV630CS scanners.

IMPORTANT NOTES IF LM983x WAS PREVIOUSLY INSTALLED:
If you have previously installed the LM983x software, 
before you install this package, you MUST:
1) Plug in the LM9831/2/3 scanner(s)
2) Go to Control Panel, Scanners and Cameras, and select 
any LM983x USB scanners, and remove them.

TO INSTALL PACKAGE:
Unplug the scanner cable.
Execute LM983x_v203a.exe to install the LM983x software.
Read the following USB driver notes BEFORE you plug in 
the scanner cable.


IMPORTANT NOTES FOR USB DRIVER:
Some changes may be required to the nscstiu.inf file if:
- If you wish to send scanner events to the PC when the LM9831/2/3
  Misc Inputs pins 1,2 and/or 3 are toggled, you must edit the .inf file to have
  EventMaskx=1, where x is 1,2 and/or 3. You must also edit the
  file so that Polling=1.
- If you wish to use remote wakeup, you must edit the
  .inf file so that RemoteWakeup=1 and Polling=1. Note that the
  default ROM for LM9831 does not support remote wakeup.
- The line %Device.DeviceDesc1% must show the PID and VID for 
  your device, if you provided an EEPROM with values different 
  from the LM9831 default ROM values.
- If you only have one device to connect to, you can delete the
  %Device.DeviceDesc2% and %Device.DeviceDesc3% lines. Otherwise, 
  these lines must have the PID and VID for your second/third device,
  if they are different from the LM9832/3 default ROM values.
- You may want to update the [Strings] section for your product.
- The USB driver will automatically install when you connect the cable.
  If you have problems installing, try the reinstallation procedure 
  at the start of this readme file.
-Nscstiu.inf gives the following errors for the WHQL Windows 2000 Inf Checker.
 Note the comment following each error:
 a) ERROR: (E1087) Value side of directive cannot be blank. 
    This is a Microsoft error in the file STI.INF.
 b) WARNING: (W2013) Remove LayoutFile entry. 
    LayoutFile is required for Windows 98. This inf is for both 98 and 2000.
 c) WARNING: (W2014) String tokens inside quotes are interpreted as straight text. 
    This is a Microsoft error in the file STI.INF.


NOTE PACKAGE DEFAULTS TO CANON N650U SCANNER: 
LM983x defaults to the LM9832 Canon n650u scanner using the
canonn650u_v11.ini file. If you wish to use another LM9831/2/3 scanner,
you must edit the LM983x.def file. Edit the line 
ScannerFile=canonn650u_v11.ini 
with av9831_v11.ini or av9832_v11.ini or av9833_v11.ini or umax3400_v11.ini or
your own file. If you are providing the .ini file, you MUST update your 
.ini file as needed for new command lines; see notes below for changes since 
your version and the appropriate ini file. 

LM983x INSTALLED FILES:
The following files are installed into windows\twain_32\lm983x:
readme.txt 		- this file 
lm983x.def 		- general definition file for the Twain scan dll 
av9833_v11.ini		- specific file for LM9833 AV630CS scanner
av9832_v11.ini		- specific file for LM9832 AV630CS scanner
av9831_v11.ini		- specific file for LM9831 AV630CS scanner
canonn650u_v11.ini      - specific file for LM9832 Canon n650u scanner
umax3400_v11.ini 	- specific file for LM9832 Umax 3400 scanner
lm983x_1.gam		- default gamma file for 1 bit/pixel
lm983x_2.gam		- default gamma file for 2 bit/pixel
lm983x_4.gam		- default gamma file for 4 bit/pixel
lm983x_8.gam		- default gamma file for 8 bit/pixel
ui_lm983x.dll		- UI dll 
scan_lm983x.dll		- Scan dll
twain_lm983x.ds 	- Twain datasource

The following driver files are installed as noted:
windows\inf\nscstiu.inf - install file for USB STI minidriver
windows\system\nscstiu.dll - USB STI minidriver

Existing files are always overwritten, except for *.gam and
*.ini which are overwritten only if they are older files.


KNOWN ISSUES:
Certain Umax 3400 scanners, primarily outside the United States,
may contain other than the National LM9832. If the Umax 3400 scanner
is not recognized on plug-in after the LM983x software has been installed,
then it is likely that the scanner does not contain the LM9832.

Photoshop 4.0 does not support 16 bit grayscale properly.

USB STI MINIDRIVER VERSION CHANGES:
Changes for version 1.094
- Fixed bug which caused the driver to crash on certain USB error
  conditions

Changes for version 1.093
- Under certain conditions when the step counter terminates the scan,
  the read of the USB data will pause until a command is written to 
  the chip. The minidriver detects this pause by doing a 250ms timeout,
  and then writes a command to the chip. This continues the USB 
  read and thus guarantees the operation of the step counter function.  
  The value KICKSTART in the [Device.DeviceData] section in the 
  nscstiu.inf file may be modified to provide a longer timeout.
  It should be set to 20000 for the LM9831.

Changes for version 1.091
- Polling for Misc I/O events is disabled when an application opens 
  the port. The polling restarts when all apps close the port (or abort). 
- The nscstiu.inf file is modified to pass the signability test
  INFCatReady (except for the CatalogFile line which must be uncommented).

Changes for version 1.08
- When USB I/O error occurs, the USB pipe is now reset

LM983x VERSION CHANGES:
Changes for version 2.03
- Ini file sections of the type [hdpi x:y] are added, where x:y is a horizontal
  resolution range. Any ini setting may be set in this section, and will only
  be used for the specified resolution range. See umax3400_v11.ini and the next
  section for an example. 
- Support is added for sensors with even/odd line separation.
  The new ini file entries are shown with sample values for two 600 dpi sensors
  configured as even/odd with a two line separation.
    	Max_Sensor_Resolution=1200 (as maximum sensor horizontal res is 1200 dpi)
    	EvenOdd_Line_Separation=2  (as 2 lines between even/odd sensors)
  When EvenOdd_Line_Separation is non-zero, Max_Sensor_Resolution/2 is used as
  the hdpi divider=1 value (in this case 600 dpi using only the even sensor). 
  So, the horizontal non-interpolated resolutions are 
  1200,600,400,300,200,150,100,75,50 and are passed to the user interface.
  Using the [hdpi x:y] sections described above, typical entries would be:
    	[hdpi 1:600]
    	Image_Pixel_Width=5100          //width of scan area in pixels
    	Sensor_Type=Standard            //EvenOdd or Standard   reg B b2
    	Optical_Resolution=600          //Optical Resolution in dpi
    	Line_Separation=-12             //Distance between R, G, B sensor lines
    	Total_Pixels=5450               //Number of pixels in CCD reg 20:21
    	EvenOdd_Line_Separation=0       //Distance between Even.Odd sensor lines
    	[hdpi 601:19200]
    	Image_Pixel_Width=10200         //width of scan area in pixels
    	Sensor_Type=EvenOdd             //EvenOdd or Standard   reg B b2
    	Optical_Resolution=1200         //Optical Resolution in dpi
    	Line_Separation=-24             //Distance between R, G, B sensor lines
    	Total_Pixels=10900              //Number of pixels in CCD reg 20:21
    	EvenOdd_Line_Separation=4       //Distance between Even.Odd sensor lines
- The ini entry Max_IntTimeAdj=0 (for max register 19 value = 0) is added,
  to specify the maximum Integration Time Adjust value when in pixel rate mode.
  For some CCD sensors, a non-zero value for register 19 causes saturation of
  the image, and should be avoided. The code switches to line rate mode when
  the specified Integration Time Adjust value is exceeded.  
- The step counter is used to stop scans. This prevents hits the end of the bed.
- Fix calibration strip width calculation when reg 19 is nonzero
- Return exact number of pixels requested for a line
- Verify writes to register 7 to correct homing after a scan

Changes for version 2.01a
- Fixed homing before scanning, so Start_of_Scan value in
  .ini file is used properly.
- Initial gain and offset guesses for coarse calibration are improved.
- Minor changes to .ini files to improve scan speed.
- Errors during scan are now shown properly on the status display.
- Preview display is corrected for Win 2000.

Changes for version 2.00
- New TWAIN interface tested with Imaging and Photoshop
  4.0 and 5.5. The data source name is "LM983x Twain Data Source".
- Simplified interface between TWAIN,Scan,and UI modules;
  see files Twain_LM983x.h,Scan_LM983x.h, and UI_LM983x.h
  in the Include directory.
- UI interface has scan size, image size, and progress bar added
- Supports Windows 98/ME/2000 
- The stand alone non-DS mode is no longer supported
- TR is a multiple of 4*stepsize for standard resolutions
- Fix to guarantee operation during software reset
- When integration time adjust is required to be > 0 in pixel rate mode, 
  the mode is changed to 3 channel line rate to reduce integration time.
- Umax 3400 support is added to the package, Artec support is removed

Changes for version 1.31
- A software reset is done only when all the registers are written as a block.
  Reg 0x18 is set to 24 before the software reset to guarantee proper
  operation of the chip
- Maximum and minimum clock divider are now corrected calculated from
  the max and min integration time
- When horizontal resolution is > 600 in pixel rate mode, the mode is
  changed to 3 channel line rate to reduce integration time.
- The minimum vertical resolution for color line rate is changed to 100 dpi to 
  speed up scans
- When register 58 is written, status register 2 is read twice to flush value
- A .1 sec delay is added for each coarse calibration loop to stabilize lamp

Changes for version 1.30
- When scanning is ended, the USB port is closed

Changes for version 1.29
- Support for LM9833 is added
- The UI pull-down selections for bits/pixel are determined by the
  Chip entry in the .ini file 
- The UI pull-down selections for resolution are calculated from
  the Optical_Resolution entry in the .ini file
- The UI shows the USB_Device string from the .ini file

Changes for version 1.28
- In coarse calibration,
  a)set black clamping before Optical_Black_Pixel_Start postion
  b)limit static offset to register range in all cases
  c)continue static offset/gain adjustment if lamp settings are changing 

Changes for version 1.27
- A USB Bulkin or Bulkout error is retryed up to 3 times
- In the LM983x.def file, RepeatScan=x allows scan to repeat x times
  for standalone mode only

Changes for version 1.26
- Fix for TWAIN image mode to be GrayScale and not Indexed Color
- A 15 second CCD lamp warmup is done if the LM9831/2 is in reset
- Gamma files are now 12 bits (LM983x will continue to read the
  old 10 bit files, and will convert them to 12 bit when the gamma
  is modified)
- Grayscale CIS scan now works properly
- Minor change to averaging algorithm for fine calibration
- First time USB driver installation is now automatic.  
  Reinstallation requires the old driver to be removed first.

Changes for version 1.25
- Support for LM9832 added in the .ini file. Typical values and
  register locations follow for the LM9832 only:
	Bias_Current=100		//50,70,80,100		reg 9 b6..7
  	LampB_Output_ITA=Off		//On or Off		reg 29 b2
  	Reverse_Motor_Direction=Off	//On or Off		reg 45 b5
  	Fullstep_During_Fastfeed=Off	//On or Off		reg 45 b6
- The following ini values have their arguments modified for the 
  LM9832 only:
	Steps_Stopped=8			//0,1,2,8		reg 51 b2..3
	Steps_25=8			//0,1,2,8		reg 51 b4..5
	Steps_50=8			//0,1,2,8		reg 51 b6..7
- Additional changes to ini file for both LM9831 and LM9832. Typical
  values follow: 	
	Triple_TR=Off			//On or Off		reg 27 b6
 	File_version=10			//must = 10 for this version
	//The following are the USB Device and Manufacturer values
	//for the device. These match the strings in the .inf file used
	//for installation. DO NOT put comments at the end of these lines
	USB_Device=LM9832 USB scanner	
	USB_Manufacturer=National Semiconductor	
- For CCD scanners, the Lamp Green PWM value is now always started at the
  Green_PWM_Duty_Cycle_High value. If the image is too bright,
  the lamp PWM is reduced by small steps until either all the pixels are
  less than the target code, or until the Green_PWM_Duty_Cycle_Low is 
  reached.
- Support for 14 bit scan by adding 42 color and 14 bit gray settings
  to the user interface. Photoshop receives the full 42 bits for color
  while the 14 bit gray currently only passes 8 bits.
- Driver support for Win2000 added
- Support for LM9830 is removed from this package

Changes for version 1.22c
- Fix for set register 3=0 before scan to prevent occasional failure
- Fix for LM9830 calibration

Changes for version 1.22a
- Added 16 calibration, for both coarse and fine calibration.
- Added black fine calibration.
- The target values in the .ini files are now 16 bit, so
  the lines
  	red_target=1000
  	green_target=1000
  	blue_target=1000
  are changed to  
  	red_target=64000	// 16 bit white target for max red level
  	green_target=64000	// 16 bit white target for max green level
  	blue_target=64000	// 16 bit white target for max blue level
- The following lines are added for black level
  	min_red_target=1000	// 16 bit black target for min red level
  	min_green_target=1000	// 16 bit black target for min green level
  	min_blue_target=1000	// 16 bit black target for min blue level
- The following line enables or disables the black fine calibration
  	black_fine_calibration=yes // enable black fine calibration

Changes for version 1.21b
- Fixed bug which caused 1.21 to hang during scan
- Fixed bug which caused calibration to fail sometimes

Changes for version 1.21
- Added Mirror_Image to .ini file to specify if the image is
  to be inverted. (Mirror_Image=YES is mirror image).
- Added Start_of_Calibration to the .ini file. This specifies
  how many motor steps to skip from the home position to the calibration
  strip. If you want to not skip, set Start_of_Calibration=0.

Changes for Version 1.19
- Fixed 100 dpi scan
- Added some filtering for calibration

Changes for version 1.18
- Removed vertical lines caused by calibration

Changes for Version 1.17
- Fixed color 3,6,12 bit depths
- Fixed all gray bit depths 
 
Changes for Version 1.16
- Fix Calibration 
- Added auto calibration for lamp on time
  All lamps start at .ini file value, then are reduced if needed

NOTE: That the Minimum_Static_Gain is still used to guarantee
      that a saturated pixel returns a maximum value.
      Recommended ini values are
      Minimum_Static_Gain=1.5
      Red_Lamp_Off=5000
      Green_Lamp_Off=5000
      Blue_Lamp_Off=5000

Changes for Version 1.15
- Add support for CIS scanner
- Add .ini file entry
  Minimum_Static_Gain=1.5
  which sets minimum static gain so that it is guaranteed that
  a saturated pixel returns a maximum value
- Set ini version number to 5
  FileVersion=5
- Modified the Red_Lamp_Off,Green_Lamp_Off,Blue_Lamp_Off values in
  the ini file so that a 600dpi scan will not saturate the sensor. 
  If you get the message "Maximum Integration Time exceeded", 
  reduce these values.

Version 1.14
- Improved calibration for LM9831 
- Faster gray scans
- Searches for scanner on multiple USB ports which have LM9831 USB
  driver installed 
- Adds HP4200C Powervision support
- Editted .ini version number to 4 (File_version=4)

Version 1.12
- Added support for dimming lamp when integration time is
  exceeded. This improves calibration at high dpi.
  The following lines in the .ini files are removed:
	Maximum_Integration_Time  
	Green_PWM_Duty_Cycle
  The following lines in the .ini file are added:
	Maximum_Integration_Time_Highlamp
		is integration time when lamp is high output 	
	Maximum_Integration_Time_Lowlamp
		is integration time when lamp is low output
	Green_PWM_Duty_Cycle_High
		is PWM value for lamp is high output
	Green_PWM_Duty_Cycle_Low
		is PWM value for lamp is low output
NOTE: Dimming lamp assumes there is PWM lamp circuitry. To not
      dim lamp, set the Max_Integration_Time_Lowlamp to the
      Max_Integration_Time_Highlamp value.

Version 1.11
- Add support for minimum integration time to ini file
  The following lines must appear in the ini file, with 
  appropriate millisecond value. Lowres is for horizontal dpi
  divider greater than 2, and highres is for divider <= 2.
  This time should be  > 0 and <= Maximum_Integration_Time.
  Note that as the minimum integration time increases, the scan
  tends to slow down while the image quality tends to improve.
  Example of lines:
  	Minimum_Integration_Time_LowRes=6 //ms for hdiv > 2     
  	Minimum_Integration_Time_HighRes=6 //ms for hdiv <= 2     

Version 1.10
- Add support for LM9831 Misc IO 3,4,5,6 to ini
  The following lines must appear in the LM9831 ini file, with one
  of the valid arguments shown in the comment. If you are installing
  for the first time, the av9831_v4.ini already has these lines.
	MiscIO_3_Type=Output		//Input or Output	reg 5a b0
	MiscIO_3_Polarity=High		//High or Low		reg 5a b1
	MiscIO_3_Trigger=Edge		//Edge or Level		reg 5a b2
	MiscIO_3_Output_State=High	//High or Low		reg 5a b3
	MiscIO_4_Type=Output		//Input or Output	reg 5a b4
	MiscIO_4_Polarity=High		//High or Low		reg 5a b5
	MiscIO_4_Trigger=Edge		//Edge or Level		reg 5a b6
	MiscIO_4_Output_State=High	//High or Low		reg 5a b7
	MiscIO_5_Type=Output		//Input or Output	reg 5b b0
	MiscIO_5_Polarity=High		//High or Low		reg 5b b1
	MiscIO_5_Trigger=Edge		//Edge or Level		reg 5b b2
	MiscIO_5_Output_State=High	//High or Low		reg 5b b3
	MiscIO_6_Type=Output		//Input or Output	reg 5b b4
	MiscIO_6_Polarity=High		//High or Low		reg 5b b5
	MiscIO_6_Trigger=Edge		//Edge or Level		reg 5b b6
	MiscIO_6_Output_State=High	//High or Low		reg 5b b7

Version 1.09
- Fix scan time so stop after scan

Version 1.08
- Added gamma window
- Remembers settings for scan parameters when LM983x exits.

Version 1.07
- Fix gray scan for low resolutions

Version 1.05
- Added debug= in lm983x.def. Debug=1 writes additional debug
info to lm983x_status.txt. Debug=0 does not.

Version 1.04
- Fixed loss of scan data during pausing

Version 1.03
- Bug fixed in LM9830 calibration
- Files renamed as above for consistent usage 
- Selection of scanner ini file is now done through lm983x.def file.
  The ScannerFile= should be set to the .ini file in the windows directory.
IMPORTANT!!
If you are installing over a previous version of NSCSCAN
or UI, take these steps. 
a) modify the lm983x.def file so the settings for Scan_Buffer_Mbytes and 
Parallel_Port_Addr and _Type are the same as in the ui.ini. Modify
the ScannerFile= to merlin.ini or merlin2.ini as appropriate. Add
the line CHIP=LM9830 in your merlin.ini.
after the VERSION= line.
b) if you wish to keep your .gam files from UI or NSCSCAN, copy them
to the lm983x*.gam files noted above.
b) if you have a previous version of NSCSCAN installed, erase the
windows\twain_32\nsscan32.ds to avoid confusion in Photoshop. If you
have nsscan32.ds from UI, you can leave it.
NOTE: If you wish, you can run LM983x and UI without conflict, as they now
use separate files.

Version 1.02
- Coarse calibration is implemented         
- Updated source comments to show clearly which functions 
  to modify for the UI, and what parameters to pass 
  between UI and scan dll
- The integration time adjust is not implemented yet, 
  so > 300 dpi can be a saturated image

Version 1.01a:
- Static build of nscscan.exe and nscscandll.dll

Version 1.01:
- Fixed scan time continuing pass home time

Version 1.00:
- Gray does not work at some resolutions
- Calibration is not implemented
