Shop OBEX P1 Docs P2 Docs Learn Events
DB9 serial to PS/2 adapter? — Parallax Forums

DB9 serial to PS/2 adapter?

RaymanRayman Posts: 14,670
edited 2012-10-24 15:33 in Propeller 1
This is making me think...
I have a touchscreen monitor with a DB9 serial output that I'd like to connect to a Propeller box.
This particular Propeller box has the PS/2 mouse and keyboard connectors.

So, I think the easiest thing for me is to make or buy an adapter...
Since I only need to input data, I think I can just use a resistor between the DB9 serial output and one of the Prop pins of the PS/2 connector.
Anybody know if that would work?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2012-10-24 07:49
    Look at the schematic for the Propeller board you're using for details of what's there and which pin is which.

    Best thing would be to use a MAX3232 since the PS/2 inputs would be fine with 3.3V logic levels. If you want something simpler, I'd use the input side of the 3-transistor serial programming adapter. You can build this in a little box with a PS/2 connector on one side and a DB9 connector on the other. The PS/2 connector provides both 3.3V and 5.0V to power the adapter. Neither the 10K pullup to 3.3V nor the 100 Ohm series resistor to the Propeller pin that are part of the PS/2 interface should make a significant difference in either the MAX3232 or the transistor adapter circuit
  • RaymanRayman Posts: 14,670
    edited 2012-10-24 09:51
    Robert, I don't think those direct adapters will work, although I'm not 100% sure.

    I think the best way would be what Mike suggests and use a MAX3232 type chip.

    But, I'm thinking that the TX output of this touchpanel is going to be at standard RS232 levels, perhaps as high as +/- 15 V.
    That's why I'm thinking a plain 100k series resistor should let me read this with a prop pin...
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-10-24 10:01
    Rayman wrote:
    That's why I'm thinking a plain 100k series resistor should let me read this with a prop pin...
    That would work. Even 47K would keep the Prop's protection resistor current below 500 uA. But there's a problem. If your terminal is powered and the Prop is not, the RS232 levels could power the Prop through its input pin, possibly damaging it. I would at least use a common-emitter NPN with a pullup to 3.3V to prevent this eventuality. As a bonus, your data will no longer be inverted.

    -Phil
  • RobotWorkshopRobotWorkshop Posts: 2,307
    edited 2012-10-24 12:06
    Rayman wrote: »
    Robert, I don't think those direct adapters will work, although I'm not 100% sure.

    I think the best way would be what Mike suggests and use a MAX3232 type chip.

    But, I'm thinking that the TX output of this touchpanel is going to be at standard RS232 levels, perhaps as high as +/- 15 V.
    That's why I'm thinking a plain 100k series resistor should let me read this with a prop pin...

    It all depends on your device. If it truely uses the +/- 15V then using one of the RS-232 voltage translator chips may be the safest option. If it doesn't then one of these adapters may work. There were a lot of serial mice that shipped with adapters like this. On one of my large robots I use an IR keyboard/Mouse and the mouse connection was a DB-9 for a serial connection. I was able to use a similar adapter to just plug it in to the PS/2 port. It's been working flawlessly so far. But, I don't believe that the serial interface was using the +/- 15V standard.

    There are several other similar adapters:

    http://www.monoprice.com/products/product.asp?seq=1&format=2&p_id=1118

    http://www.ebay.com/itm/TOPAZ-A-CSA4-2-SERIAL-PS-2-CABLE-Z-A-CSA4-2-Dual-Interface-Pads-/150864217648

    For the cost it may be worth trying the one from Monoprice.

    Robert
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2012-10-24 15:29
    A resistor is all you need but you have to take into account the pullup resistor on the PS/2 line. Ideally this should be a pulldown resistor otherwise a disconnected line looks like a break condition (literally too). Of course this is easy to get around in software so just add your resistor.

    As I have previously mentioned in other threads a MAX chip will do you no harm, and it will do you no better than a resistor. In fact if you really want just use a a resistor into an NPN with the collector pulling down the PS/2 line. That is basically all that an MAX receiver does. Add a diode into the base if you really really want to push up the switching threshold.
  • RaymanRayman Posts: 14,670
    edited 2012-10-24 15:33
    Ok, thanks guys. I think I'll try a transistor as you suggest...
Sign In or Register to comment.