Using FT245R (bear in mind the suffix R, it's important!)
Pieces | Description | Package | Reichelt Order Code | Price in € (2011) |
---|---|---|---|---|
1 | USB FIFO IC | QFN-32 | FT245RQ | 4.99 |
1 | Ceramic capacitor 100 nF | 0603 | X7R-G0603 100n | 0.05 |
1 | Ceramic capacitor 4.7 µF | 0603 | X5R-G0603 4,7/6 | 0.05 |
3 | Resistor array 4 × 100 Ω | 1206 | BCN16 100 | 0.02 |
1 | Resistor 4.7 kΩ | 0603 | SMD-0603 4,7k | 0.10 |
1 | D-Sub plug 25 pin | wire solder cups | D-Sub St 25 | 0.19 |
1 | USB receptacle MiniB | through-hole | USB BWM | 0.98 |
1 | Plastic D-Sub shell | KAPPE CG25G | 0.16 | |
1 | USB cable | 1 m | AK 673-A | 1.00 |
1 | One- or Two-sided PCB Vias/bridges can be made by hand | LptCap.brd | DIY |
Note: The schematic's pin numbers of FT245R don't apply to the L package (SSOP, 28-pin, 0.65 mm pitch), and re-design of PCB would be necessary.
LptCap is not intended for capturing local printer data. Although such a constellation will work too, there are software-only solutions around, like DosPrn, or some methods available for the current operating system.
Someone (Sandro Bureca) reported 100 kByte/s transfer rate, but did not note which data source he had used.
Besides using FT245R the more general but more cumbersome solution is using a microcontroller and firmware. It's possibly cheaper. For example:
SubD25 | Port | Board |
---|---|---|
1 | PD4 | 4 |
2 | PD0 | 3 |
3 | PB1 | 15 |
4 | PB2 | 16 |
5 | PB3 | 14 |
6 | PB4 | 8 |
7 | PB5 | 9 |
8 | PB6 | 10 |
9 | PD7 | 6 |
10 | PD1 | 2 |
11 | PC6 | 5 |
12 18..24 | GND | |
15-16 | — |
I implement this only on request! Therefore, there is currently no firmware nor sketch available for download.;ISR at Hi-Lo transition at Strobe (here: Input Capture at PD4) ;UENUM is preset with endpoint number for the USB-CDC IN channel, ;registers R16, R17, and flags are free for fast reaction on Strobe edge sbi PORTD, 1 ;BUSY highin r16,PINB ;(available) D1..D6 in r17,PIND ;residual D0 und D7 andi r16, 0x7E andi r17, 0x81 or r16,r17 ;concatenate sts UEDATX,r16 ;send to USB-CDC in r16,UEINTX sbrc r16, 5 ;check RWAL: FIFO full?rjmp 1f ;no, to ACK cycleldi r16, 0x7F sts UEINTX,r16 ;send data block (clear FIFOCON) in r16,UEINTX sbrs r16, 5 ;check RWAL: New (double-buffered) bank available?rjmp 2f ;no, leave BUSY high, main loop must resolve1 : cbi PORTD,1 ;BUSY lowcbi PORTC, 6 ;!ACK lowldi r16, 16 1 : dec r16 ;wait 3 µsbrne 1b sbi PORTC, 6 ;!ACK high2 : reti ;done
However, if you want to redirect printer data to another Windows printer (e.g. a PDF generator), if necessary with processing ESC/P printer control codes, I had written the application SPE = Serial Printer Emulator. The name implies that, while running this application service-like, it converts the computer to (at least) one printer with a serial port, together with the hardware described above, with a parallel port.
Of course you can write any application using any programming language you know, that can read and process data from a COM port, e.g. using VisualBasic, VBA, C++, Python or LabVIEW.