PS2 to serial port conversion

This is the place for any magazine-related discussions that don't fit in any of the column discussion boards below.
Post Reply
User avatar
kheston
Posts: 354
Joined: Wed Dec 03, 2003 1:01 am
Location: CA
Contact:

PS2 to serial port conversion

Post by kheston »

Hi All,<p>I have a number of keyboard-wedge PS2 interface barcode scanners that I'd like to adapt for use with the DB9 serial port (RS232) on my PC. I don't mind if the change is permanent. Is there a way to do this?<p>I'd like to trigger events in my UI based upon when a barcode is scanned. When using keyboard wedges, it is difficult to programmatically differentiate between keystrokes and barcode scans. For this reason, a serial connection would be more convenient for me to code around.<p>Thanks for you help!
Kurt - SF Bay
User avatar
Chris Smith
Posts: 4325
Joined: Tue Dec 04, 2001 1:01 am
Location: Bieber Ca.

Re: PS2 to serial port conversion

Post by Chris Smith »

Don’t quote me on this but all you need is the plug with wire connector. The plug on the mother board is the same, 8 or 10 pin two row with one plug blocked off for reference, and the language is also the same after the wires. <p>I have several plugs off old computers that go side by side with another plug of the same, to the MB connector, [PS2 and DB9 connectors] while the out puts go to different back plate connectors for both styles.
User avatar
kheston
Posts: 354
Joined: Wed Dec 03, 2003 1:01 am
Location: CA
Contact:

Re: PS2 to serial port conversion

Post by kheston »

I've tried one of the passive connectors (I have three or four), but it doesn't seem to power the scanner. Can I remedy this by sending one of the pins 5 volts without creating a smoke show?
Kurt - SF Bay
User avatar
dr_when
Posts: 208
Joined: Thu Oct 28, 2004 1:01 am
Location: Milwaukee
Contact:

Re: PS2 to serial port conversion

Post by dr_when »

Hi,<p>Chris must have been sloshed when he replied because what he said is non-sensical gibberish :) <p>A wedge BC scanner works like the keyboard. There is a clock and a data line and then +5 and ground (on both ps/2 and older large 6-pin din keyboard ports). The scanner is sending out 11 bits per byte of data, i.e. 1 start bit, 8 data, odd parity and a stop. Yes, you can power the device from a 5-volt source but you'll have to adapt the data to an asynchronous form for regular serial communication.
"Who is John Galt?"
User avatar
Chris Smith
Posts: 4325
Joined: Tue Dec 04, 2001 1:01 am
Location: Bieber Ca.

Re: PS2 to serial port conversion

Post by Chris Smith »

My connectors must be sloshed?
But they wont disapear?
DB9, PS2 same connector on the MB.<p>From memory, the PS2 plate that covers one PCI slot at the back, was for Audio?<p> I remember trying a PS2 mouse on it and it didn’t work. <p>But the connectors were plugged into a pair of identical plugs on the MB.<p>[ April 15, 2005: Message edited by: Chris Smith ]</p>
User avatar
kheston
Posts: 354
Joined: Wed Dec 03, 2003 1:01 am
Location: CA
Contact:

Re: PS2 to serial port conversion

Post by kheston »

What would be the best way to approach the conversion? Microprocessor?
Kurt - SF Bay
User avatar
dr_when
Posts: 208
Joined: Thu Oct 28, 2004 1:01 am
Location: Milwaukee
Contact:

Re: PS2 to serial port conversion

Post by dr_when »

Kurt,<p>The cheapest way to go I think would be using a very cheap small-pin-count microcontroller like one of the 6 or 8 pin PICS. There is tons of code around for decoding PC keyboards (or in your case the BC reader that is sending out keyboard codes. <p>If I remember right, many of the keyboard-wedge Barcode readers had adapters available (and/or settings that could be changed by dip-switches or scanning special config codes) that would allow them to be used serially also. The adapter would have the appropriate DB-9/25 plug. What is the make? Symbol? Honeywell? PSC?
"Who is John Galt?"
User avatar
kheston
Posts: 354
Joined: Wed Dec 03, 2003 1:01 am
Location: CA
Contact:

Re: PS2 to serial port conversion

Post by kheston »

Actually, if I wasn't such a spend thrift, I'd buy scanners with serial interfaces from one of those guys and be done. However, I've cheaped out and purchased 7 declawed CueCats on EBay. I do have a single Symbol LS-1004 with a serial interface for which I've written a simple POS system. However, I've volunteered to set up 6 registers for a fundraiser with no budget and had to come up with a low-overhead solution. 5 more LS-1004s at $200/pop used was out of my range.<p>Does that change your recommendation?
Kurt - SF Bay
rshayes
Posts: 1286
Joined: Tue Mar 04, 2003 1:01 am
Contact:

Re: PS2 to serial port conversion

Post by rshayes »

Since the bar code reader appears to act like a keyboard, you might find the thread "connect keyboard to serial port" useful. This was started by "cerf" and last updated on April 7th. It seems to address the same issues.
User avatar
kheston
Posts: 354
Joined: Wed Dec 03, 2003 1:01 am
Location: CA
Contact:

Re: PS2 to serial port conversion

Post by kheston »

Is this what I'm looking for? Schematic<p>Looks like I could build one for under $10.
Kurt - SF Bay
rshayes
Posts: 1286
Joined: Tue Mar 04, 2003 1:01 am
Contact:

Re: PS2 to serial port conversion

Post by rshayes »

The schematic is both less than you need and more than you need. It shows the interface with the RS-232 port only, with no interface to the light pen. It also shows a a bidirectional interface, and you only need to send data to the RS-232 port.<p>The only RS-232 signal that you really need is TXD (Transmit Data). This carries the combined clock and data information. There is no data going to the bar code reader, so RXD (Received Data) is not needed. The bar code reader does not appear to have handshaking signals, so DSR (Data Set Ready) and DTR (Data Terminal Ready) are also not needed.<p>You would need to connect the data and clock leads from the bar code scanner to two of the unused port connections. The software will have to detect the edge of the clock signal and sample the data line at that time. I don't know the clock rate from the bar code scanner, so this might be rather tricky if the clock rate is high.<p>You have to consider that the bar code reader may start to transmit a new byte before the RS-232 interface has finished the previous byte. The RS-232 interface requires accurate timing, which is difficult to do if the bar code reader generates an interrupt.<p>Its probably possible to do this, but it may not be simple.<p>My preference would be for a programmable logic chip, where the timing of the two data streams can be independent, and the only connection is a near instantaneous parallel transfer of a byte between them. This does require a different set of programming interface and software than the PIC, but the complexity is similar. It depends on whether you already have the software and interface for the PIC or not.<p>The clock crystal should be some multiple of 19,200 Hz. A common value for this is 1.8432 Mhz (96 times 19,200).
User avatar
dr_when
Posts: 208
Joined: Thu Oct 28, 2004 1:01 am
Location: Milwaukee
Contact:

Re: PS2 to serial port conversion

Post by dr_when »

You should be able to use a PIC to easily read the keycodes from the CueCat. You just need a table and two lines to read the clock and data. Stephen was right as there are link on this site that will take you to docs on the PC 101-keyboard protocol.<p>I have seen people interface PIC port pins directly to PC serial without a level shifter of any kind (maybe a resistor or two. VERY EASY. There again you just need RXD and TXD lines.<p>One concern with the CueCat I have after playing with declawed versions is that they are pretty cruddy bar wands. They are picky about swiping speed and the barcode has to be VERY flat...so forget wanding something like a teddy-bear with a label on it. Second, if I recall, the wand only supported the goofy cuecat symbology and Code 3-of-9...which is OK as 3-of-9 should be adequate. But I do recall you had to jump something on the Cuecat to put it into 3-of-9 mode. It's been a while. I personally like the Symbol scanning angines because they can scan from a foot away and will interface with anything easily (as you found with the LS). I had some cheap circuit boards made a while back that would handle infacing a Symbol engine and a BASIC stamp and Emic voice module that would speak the data that was scanned. <p>Good Luck!
"Who is John Galt?"
Post Reply

Who is online

Users browsing this forum: Amazon [Bot] and 16 guests