Thursday, December 9, 2010

USB2LPT – Cloning instructions for Release 1.5



This device was built using AVRUSB firmware developed by extern Objective Development.

Meanwhile, a very similar Release 1.6 exists.
This Low-Speed device violates following USB specification rules:
  • Detachable cable (must be captive for Low-Speed)
  • Output drivers with 5 V (must be 3.3 V, but USB is 5 V tolerant)
  • No differential data input (only one line D- is sampled)
  • No data clock regenration while receiving (only at packet start)
  • No error detection of input data (OUT direction), no time for CRC16
  • Data transfer using BULK pipes (not specified for low-speed, but works on Windows – for Linux there is an "Alternate Setting" with INTERRUPT pipes instead)
However, new to this firmware, following rules are accepted:
  • Suspend detection and lowered suspend current (below 500 µA)

Electronic Components

You need:


PiecesDescriptionReichelt Order CodePrice in € (2007)
1ATmega8 in TQFP32 package
or ATmega48
ATMEGA 8-16 TQ
ATMEGA 48-20 AU
1,70
1,45
1Crystal 12000 kHz12,0000-HC49U-S0,24
1Electrolytic capacitor 10 µFrad 10/350,041
1USB receptacle MiniB through-holeUSB BWM0,50
1SubD receptacle 25 pinD-SUB BU 250,15
1Yellow LED 3 mmLED 3mm ST ge0,051
1Resistor array 220ΩBCN160,02
2Ceramic capacitor 22 pF 0603NPO-G0603 22p0,051
1Ceramic capacitor 100 nF 0603X7R-G0603 100n0,051
1Resistor 10 kΩ 0805
or 4.7 kΩ for ATmega48
SMD-0805 10k
SMD-0805 4,70k
0,10
1HousingKappe CG25G0,13
1USB cable 1 mAK 673-A0,98
1Two-sided PCB (see below)UL-155,00



Schematic


PCB


Wiring


  • That's right, my USB2LPT5 only needs two port pins for USB, no additional INT pin. I use the Input Capture interrupt of Timer1. As a side effect, I can exactly measure the time between two SOFs.
  • For Windows driver and AVR firmware, and how-to-use instructions. 
    That download you need for running the device on your host PC:
  • Driver for Windows 98/Me/2k/XP/Vista/7 (1.3M, Thursday, 02-Dec-2010 00:07:02 MET)
    These drivers are not so much plug'n'play. Up to three LPT port address rages are automatically captured. Up to 10 devices may be connected due to naming scheme. The driver and software appears english on non-German Windows. All other languages may be added by modifying the resources and the .INF file. Windows does the automatic selection.

    Note: For Low-Speed USB2LPT 1.5 und 1.6 with Vista/7 the driver uses the second “Alternate Setting” of the USB2LPT 1.5 and 1.6 firmware that uses INTERRUPT instead of BULK pipes. As a real bad consequence, emulation speed drops by factor 8.
    New: There are two new pages for “Properties” in Device Manager. All 4 pages are available in 11 languages.


    That download you only need to upgrade the firmware:
  • Firmware for serial EEPROM (AN2131)
  • Firmware for serial EEPROM (FX2LP)
    It simply puts USB OUT transfers to the OUT port, and answers to IN transfers. ECP are EPP are simulated too.
  • If you don't got an installation manual:
  • Pamphlet.doc as WinWord2000 file Eye

Known PCB bugs

  • R2 must be 10 kΩ or at least 4.7 kΩ for right voltages on USB!
    1.5 kΩ is only suitable for 3.3V operation using LD1117

Solder Jumper

This revision 5 (USB2LPT 1.5) has three solder jumpers:
  • SJ1 connects pin 25 of SubD receptacle:
    • open: to nothing (free pin)
    • right shorted: to ground (default)
    • left shorted: to 5 Volt
  • SJ2shorted by default, cut at delivery: Activation of RESET pin for programming the ATmega chip.
  • SJ3shorted by default, for optional 3.3 Volt regulator, or for measuring power consumption.

Usage
Have a look to Device Manager! In the “Connections (COM & LPT)” tree, you will find a new parallel port. Its property dialog has two extra sheets:
  • Emulation: Here you can set up properties like the port address emulated, the usage of debug registers, etc.
  • Statistics: Here you can inspect how USB2LPT is working, and maybe shooting some trouble
There is an API for programmers too. It is simply DeviceIoControl based. Open the device with CreateFile and file name "\\.\LPT1" (or LPT2 if you already have one), and transfer IN/OUT data with (see USB2LPT.A51, label "upv") via a single call of DeviceIoControl. This part of API is not subject to change in the future. (The IOCTL code is $222010.) Of course, a helpful documentation must follow.Via IOCTL code IOCTL_VLPT_AnchorDownload, you can inject additional firmware to speed-up your applications. Therefore, USB2LPT is aPocket Development Kit for EZUSB AN2131/CY7C68013 too.


No comments:

Post a Comment