Shop OBEX P1 Docs P2 Docs Learn Events
Keyboards... USB keyboards connecting to PS2 on the prop — Parallax Forums

Keyboards... USB keyboards connecting to PS2 on the prop

Cluso99Cluso99 Posts: 18,069
edited 2009-08-10 16:45 in Propeller 1
It was my impression that the newer USB·keyboards did not contain the smarts to also connect as a PS2 keyboard.

Well, I just connected a recent (1-2 year old???) HP keyboard via the USB to PS2 adapter and it works.

So, it is definately worth trying if you don't have a PS2 keyboard :-)

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:

· Home of the MultiBladeProps: TriBladeProp, RamBlade, TwinBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: Micros eg Altair, and Terminals eg VT100 (Index) ZiCog (Z80), MoCog (6809)
· Search the Propeller forums (via Google)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm

Comments

  • Brandon C.Brandon C. Posts: 106
    edited 2009-08-08 01:08
    Hi Cluso,

    Which USB to PS/2 adapter are you using?

    Brandon C.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    No purchase necessary. See back panel for more details.

    Tired of the same old robot brains? not enough processing power? Get the Propeller Robot Module now!!

  • Cluso99Cluso99 Posts: 18,069
    edited 2009-08-08 05:58
    I have a Microsoft (old) adapter. Pretty sure there is no logic inside.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBladeProp, RamBlade, TwinBlade,·SixBlade, website
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: Micros eg Altair, and Terminals eg VT100 (Index) ZiCog (Z80), MoCog (6809)
    · Search the Propeller forums (via Google)
    My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
  • RinksCustomsRinksCustoms Posts: 531
    edited 2009-08-09 04:11
    most USB keyboards are legacy compatible. Otherwise you wouldn't be able to hit F2 to access the BIOS after POST. and since the KB/Mouse drivers were written as legacy-based, they will work with a usb mouse/KB that supports legacy serial communications. CLK/DATA lines are the same for legacy and USB, just dont forget to connect power too.

    P.S. - No PS/2 adapter needed if you have a spare usb cable/plug lying round (dont forget the pullup resistors!)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Quicker answers in the #propeller chat channel on freenode.net. Don't know squat about IRC? Download Pigin! So easy a caveman could do it...
    http://folding.stanford.edu/ - Donating some CPU/GPU downtime just might lead to a cure for cancer! My team stats.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-08-09 04:51
    RinksCustoms said...
    most USB keyboards are legacy compatible. Otherwise you wouldn't be able to hit F2 to access the BIOS after POST. and since the KB/Mouse drivers were written as legacy-based, they will work with a usb mouse/KB that supports legacy serial communications. CLK/DATA lines are the same for legacy and USB, just dont forget to connect power too.

    P.S. - No PS/2 adapter needed if you have a spare usb cable/plug lying round (dont forget the pullup resistors!)

    I think it works the other way round with the BIOS as the BIOS has to have some basic USB keyboard support to handle *any* USB keyboard, not that it talks to the USB keyboard as PS/2 before boot. But not all USB keyboards are legacy compatible, in fact I think and have found that most aren't. The ones that come with an PS/2 "adaptor" plug are designed with the PS/2 interface on the keyboard and autodetect which interface is being used. The adaptor is a simple passive "gender-bender" type of affair and plays no part in what the keyboard does. After all the keyboard still only uses two signal connections, for PS/2 thats the clock and data, and for USB it's the D+ and D-.

    *Peter*
  • BradCBradC Posts: 2,601
    edited 2009-08-09 05:43
    RinksCustoms said...
    most USB keyboards are legacy compatible. Otherwise you wouldn't be able to hit F2 to access the BIOS after POST. and since the KB/Mouse drivers were written as legacy-based, they will work with a usb mouse/KB that supports legacy serial communications. CLK/DATA lines are the same for legacy and USB, just dont forget to connect power too.

    I'm sorry, but this is wrong.

    A USB keyboard has two modes :
    A) A simplified USB mode for use in "legacy BIOS" applications, where a HID enumerator is not present.
    B) A full HID mode (which is switched to when the OS boots and activates its HID enumerator

    Any ability to interface using a PS/2 interface is in addition to these USB modes and usually activated by some form of biasing on the data lines. It is simply not possible for a USB port to talk to a keyboard in PS2 mode.

    I've got 2 keyboards here that are USB only, but most of mine will do USB or PS/2 with the right adapter. The adapter is a hardware device with no smarts. It simply changes the pin routing. I suspect the keyboard detects either USB or PS/2 by looking at the voltages on the signal lines when it powers up.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    lt's not particularly silly, is it?
  • Cluso99Cluso99 Posts: 18,069
    edited 2009-08-09 06:46
    I commented simply because I was not expecting a recent keyboard (USB) to still do the PS2 mode via the USB to PS2 adapter.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBladeProp, RamBlade, TwinBlade,·SixBlade, website
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: Micros eg Altair, and Terminals eg VT100 (Index) ZiCog (Z80), MoCog (6809)
    · Search the Propeller forums (via Google)
    My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
  • TimmooreTimmoore Posts: 1,031
    edited 2009-08-09 06:54
    Bradc, you are correct. I have seen code for some keyboard/mice that support both and during init they check one or both (dont remember) of the D+/D- lines, for USB it expects low, for PS2 it expects high. The code then follows differnt code path for PS2 and USB keyboards after that.
  • VaatiVaati Posts: 712
    edited 2009-08-09 12:52
    Huh... It seems as though this is the 10,000th thread in the prop forum! smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Quit buying all those fixed voltage regulators, and·get an Adjustable Power Supply·for your projects!· Includes an LED testing terminal!

    *-NEW-* SD Card Adapter·Now available!· Add extra memory to your next Propeller project with ease!
  • RaymanRayman Posts: 14,845
    edited 2009-08-09 13:36
    It just occurred to me that perhaps we should just put USB jacks on our boards instead of PS2 ports for keyboard and mouse... With the right wiring, it should work in PS2 mode and be simpler to use, but perhaps a little confusing...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-08-09 14:34
    Well Ray, that's what I've been doing and not at all confusing as we don't really plug in slave USB devices normally and I don't think anybody is going to mistake it for a PC! So all my newer pcbs are just using the USB A socket rather than the PS/2 for 2 reasons:

    1) Most PS/2 devices are also USB so it gets rid of that awkward "adaptor"
    2) Leaves the way open for future software to be incorporated that will handle the device in native USB mode

    Another reason is that the USB socket is cheap and easier to obtain and cables also are a dime-a-dozen (almost). There is also no reason why this same socket can't be used for external I2C as well, why not, it's up to software anyway.

    *Peter*
  • Cluso99Cluso99 Posts: 18,069
    edited 2009-08-09 23:16
    Great idea Peter :-) I may just use that idea also, thanks.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBladeProp, RamBlade, TwinBlade,·SixBlade, website
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: Micros eg Altair, and Terminals eg VT100 (Index) ZiCog (Z80), MoCog (6809)
    · Search the Propeller forums (via Google)
    My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
  • RinksCustomsRinksCustoms Posts: 531
    edited 2009-08-09 23:35
    ok, so im not perfect at explaining ideas.. But a USB keyboard (namely a Razer Lycosa gaming keyboard and mouse) WILL interface witht he stock KB/Mouse.spin drivers.. as long as you use pullup resistors.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Quicker answers in the #propeller chat channel on freenode.net. Don't know squat about IRC? Download Pigin! So easy a caveman could do it...
    http://folding.stanford.edu/ - Donating some CPU/GPU downtime just might lead to a cure for cancer! My team stats.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-08-10 00:17
    RinksCustoms said...
    ok, so im not perfect at explaining ideas.. But a USB keyboard (namely a Razer Lycosa gaming keyboard and mouse) WILL interface witht he stock KB/Mouse.spin drivers.. as long as you use pullup resistors.

    I think actually that your original statement was just plain wrong. It's not about not being able to explain ideas perfectly, you have a gaming keyboard that works and then you assumed that all keyboards must be the same and then assumed that's how the BIOS manages to talk to them at pre-boot, then stated these assumptions as facts.

    Nobody is worried about this assumption though as the matter has been clarified for the sake of the other forum members who might have acted on what you said. If you had said XYZ USB keyboard WILL interface to PS/2 then that would not have been misleading.

    But it's cleared up now, and I didn't know that about the "simple USB mode" prior to enumeration which Brad kindly pointed out, so it's all an education!

    *Peter*
  • RaymanRayman Posts: 14,845
    edited 2009-08-10 13:30
    I'm leaning heavily towards switching my new board over to USB ports...· I think it is perhaps a little misleading at first glance, but it is cheaper and smaller and as Peter says, can allow for future "real" USB things...

    Peter:· I'm thinking you just connect the PS/2 data ports to D+ and D- and give +5V and GND on the other two pins...· Is that all there is too it?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-08-10 14:03
    Well I just connected PS2CLK to D+ (pin 3) and PS2DAT to D- (pin 2) and I added 10K pullups. The USB signals are normally 3.3V or so anyway so there is no need for voltage translation but I will look into the signals and check the voltages and timings and post my findings.

    USB
    1 +5V
    2 D- PS2DAT
    3 D+ PS2CLK
    4 GND

    *Peter*
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2009-08-10 14:04
    Typical !

    I had a tidy up at work last week, and chucked a load of single and stacked USB conns away. Some even had integrated magnetics for the RJ45.

    As they say " Chuck it away and you will need it tomorrow"

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Style and grace : Nil point
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-08-10 14:17
    Toby! wake up! You are networking in your sleep, I think you chucked some Ethernet connectors away, not USB [noparse]:)[/noparse]

    But a stacked connector is probably USB though. Anyway, USB connectors are cheap and even the corner shop sells them (yeah, buy a $5 hub and rip out 4 connectors)

    *Peter*
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2009-08-10 14:42
    Probably close to snoozing, just tried to put windoze onto a PC and I think that the virus got it on the activation. Must pull the net out next time.

    The stacks I had were mostly either 2 USBs or 2 USBs and a RJ45. The latter would have been ok for the Ybox2.

    Over here the Pound shops do 4 port hubs

    Now, back to siesta.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Style and grace : Nil point

    Post Edited (Toby Seckshund) : 8/10/2009 2:56:20 PM GMT
  • TimmooreTimmoore Posts: 1,031
    edited 2009-08-10 16:45
    Peter, clk to D+ and data to d- matches the code I have looked at. If you want to see an example of how a mice/keyboard detects ps2/usb look on cypress website (http://www.cypress.com/) for firmware examples for ps2/usb mouse/keyboard for cy7c63723
Sign In or Register to comment.