PDA

View Full Version : PS/2 barcode reader to RS232 port - need help



phoenix_1
- 25th May 2008, 11:23
Did someone use or know how to connect PS/2 barcode reader to rs232 port ?
I need to read data from barcode reader on some my hardware where I have only rs232 port.

Any suggest are welcome.

Best regards Robert

Archangel
- 25th May 2008, 21:21
Hi Robert,
Easier and cheaper to get an RS232 Barcode reader, run about 125. US, otherwise you are in the same boat as everyone trying to use a PS/2 keyboard with PIC. Probably doable, How much is your time worth? Check out the Obsolete / Used computer stores especially those who have used POS terminals.

phoenix_1
- 25th May 2008, 23:08
Hi Robert,
Easier and cheaper to get an RS232 Barcode reader, run about 125. US, otherwise you are in the same boat as everyone trying to use a PS/2 keyboard with PIC. Probably doable, How much is your time worth? Check out the Obsolete / Used computer stores especially those who have used POS terminals.

Thank's ,
I have one hardware with 16F877 and TIBBO DS1000-00 module as final product and now I must implement barcode reader - HUH.......
Here in Serbia most user use PS/2 barcode readers and none want back to RS232...

I must find some solution....
Thank's anyway my dear friend for answare
Robert

mister_e
- 26th May 2008, 20:27
...otherwise you are in the same boat as everyone trying to use a PS/2 keyboard with PIC.

Using PS2 with PIC it's fairly easy, max 10-15 lines of code, a decent Lookup table and away you go. The problem arise when you want emulate a PS/2 with a PIC on a PC. That's easy to send Keystroke... Emulate and perform the PC Boot sequence IS the 'tricky' part.

I have done enough to hate it now :D

Forget SHiftin/Shiftout... must role your own 'SPI' routines. A logic analyzer comes pretty handy in this specific case. Pickit... yeah maybe, even if a bit limited in acquisition time. PoScope? Yeah, better.

Archangel
- 26th May 2008, 23:09
Using PS2 with PIC it's fairly easy, max 10-15 lines of code, a decent Lookup table and away you go. The problem arise when you want emulate a PS/2 with a PIC on a PC. That's easy to send Keystroke... Emulate and perform the PC Boot sequence IS the 'tricky' part.


So it's easy to use PS/2 periferals hooked to pic but hard to hook pc to PIC through PS/2 port?

mister_e
- 27th May 2008, 02:31
Not that REALLY HARD... but way more tricky. At very least, one of the tricky point is that your PIC MUST talk, acknowledge the PC command... which can comes from the Boot and 'till the Shut-down. If you don't do that, your project may never work, the PC may freeze/Crash... and then, this is where the fun begin!

High likely, you need interrupts, ASM are more than welcome while Darrel's instant may work as well but maybe will need a slighly higher frequency crystal. Those i've done 'till now, use the internal 4MHz osc and ASM ints. Seems to works fault-free 'till now.

This is a bi-directional port, so you should play with TRIS register instead of simply send a pin high/low... that's the easy part. Forget Shiftout for reliability and timing.

A logic analyzer + a home-brew PS2 sniffer & Logger are highly recommended.

There's a load of information/tips about the PS2 protocol on this forum... but no real complete solution.

phoenix_1
- 27th May 2008, 06:56
I simple need to make some type PS/2 to RS232 converter nothig else.
When I scan barcode to I can read on PC via RS232 - pass tru type.
Any help please ???
Robert

mister_e
- 27th May 2008, 07:10
Yikes,
well, do you have a part# for your Reader?

In the ol' days we had PS2 to Serial converter... but the devices (mouse) was design to support it, so basically it was just a matter to cross connect some pins here and there. Sure enough some local overstock supplier may still have some in stock for few bucks.

Something like that

http://www.geeks.com/largePic_All.asp?InvtId=PS2XSERIAL&Pic=PS2XSERIAL-unit.jpg

phoenix_1
- 27th May 2008, 16:38
Yikes,
well, do you have a part# for your Reader?

In the ol' days we had PS2 to Serial converter... but the devices (mouse) was design to support it, so basically it was just a matter to cross connect some pins here and there. Sure enough some local overstock supplier may still have some in stock for few bucks.

Something like that

http://www.geeks.com/largePic_All.asp?InvtId=PS2XSERIAL&Pic=PS2XSERIAL-unit.jpg

I was probe that cross ower cable but not work with barcode reader!
huh......

mister_e
- 27th May 2008, 16:54
Can't help from Canada without any model#

leisryan
- 28th May 2008, 06:35
I was probe that cross ower cable but not work with barcode reader!
huh......

Use this

http://www.electronic-engineering.ch/microchip/projects/keyboard/v1xx/keyboard_v1xx.html#faq_kbd_input


the revised version is non_inverted you can directly use it without translator ie. max232 otherwise use inverted version for direct pc connection!!!