Weird

So I have a device to convert a PS/2 keyboard into a USB keyboard. But it seems to crash the USB host driver.

Here is the dump…

[Device, Port 3]
Type: Keyboard
ProductID: 1
VendorID: 3389
=== Interface ===
Class: HID
SubClass: 1
Number: 0
Protocol: 1
Type: 4
– Endpoint –
Attributes: 3
Address: 129
Type: 5
Interval: 10

=== Interface ===
Class: HID
SubClass: 1
Number: 1
Protocol: 2
Type: 4
– Endpoint –
Attributes: 3
Address: 130
Type: 5
Interval: 10

[Device, Port 3]
Type: Mouse
ProductID: 1
VendorID: 3389
=== Interface ===
Class: HID
SubClass: 1
Number: 0
Protocol: 1
Type: 4
– Endpoint –
Attributes: 3
Address: 129
Type: 5
Interval: 10

=== Interface ===
Class: HID
SubClass: 1
Number: 1
Protocol: 2
Type: 4
– Endpoint –
Attributes: 3
Address: 130
Type: 5
Interval: 10


I do not care about the mouse interface. See the project below!

It is an EMX (Spider) USB host, 2 line char display, Track reader, all stuffed inside a keyboard…

I think I have room to add the bluetooth module I have.

How to know what’s going wrong? When you say “it seems to crash the usb host driver” what is the crash exactly?

You seems to have a link to a project but nothing appears in your post.

I think the “project” is actually just the picture attached, see the screen on the keyboard?

@ Tempered, Can you be more specific than “crash”. Is there an error message or does the program just stop working? Can you post the code that interprets the PS/2 input?

The below is the code. The connect event fires. It also links the events to the object instance… Just no events ever fire. Before i removed the USBHost object on the designer i was getting USB Device not supported.


    public partial class Program
    {
        USBH_Keyboard KeyB = null;
        GT.Timer timer = new GT.Timer(1000); // every second (1000ms)
        //Ascended.Helpers.UsbDiscoveryHelper Helper = new Ascended.Helpers.UsbDiscoveryHelper();

        // This method is run when the mainboard is powered up or reset.   
        void ProgramStarted()
        {
            char_Display.PrintString("Hello");
            //USBHostController.DeviceConnectedEvent += USBHostController_DeviceConnectedEvent;

            USBHostController.DeviceConnectedEvent += USBHostController_DeviceConnectedEvent;
            // Use Debug.Print to show messages in Visual Studio's "Output" window during debugging.
            Debug.Print("Program Started");
        }

        void USBHostController_DeviceConnectedEvent(USBH_Device device)
        {
            if (device.TYPE == USBH_DeviceType.Keyboard)
            {
                KeyB = new USBH_Keyboard(device);
                KeyB.CharDown += KeyB_CharDown;  //these commands DO execute
                KeyB.CharUp += KeyB_CharUp;
                KeyB.Disconnected += KeyB_Disconnected;
                KeyB.KeyDown += new USBH_KeyboardEventHandler(KeyB_KeyDown);
                KeyB.KeyUp += KeyB_KeyUp;
            }//catch
            {}
        }

        void KeyB_Disconnected(USBH_Keyboard sender, USBH_KeyboardEventArgs args)
        {
            throw new NotImplementedException(); //NEVER EXECUTES
        }

        void KeyB_CharUp(USBH_Keyboard sender, USBH_KeyboardEventArgs args)
        {
            throw new NotImplementedException();//NEVER EXECUTES
        }

        void KeyB_CharDown(USBH_Keyboard sender, USBH_KeyboardEventArgs args)
        {
            throw new NotImplementedException();//NEVER EXECUTES
        }

        void KeyB_KeyDown(USBH_Keyboard sender, USBH_KeyboardEventArgs args)
        {
            throw new NotImplementedException();//NEVER EXECUTES
        }

        void KeyB_KeyUp(USBH_Keyboard sender, USBH_KeyboardEventArgs args)
        {
            Debug.Print(args.Key.ToString());//NEVER EXECUTES
        }

oh and the caps lock, scroll lock, and num lock keys DO NOT work… making me think the driver crashed.

is the device i used. I am linking there because it shows images with the cover off.

I have removed the ps/2 port and hard soldered the wires from the keyboard to the pcm board.

To my shear amazement, it works perfectly in windows. (this was my first time using a solder iron!)

Have you tried with different USB keyboard? I think you should use a generic usb class and listen for the usb frames.

Yeah, I don’t know much about USB.

It kinda needs to be this device as it is soldered to the system.

I still don’t understand why nothing usb works… Out of all the devices I have tried only 1 usb to serial has worked.

The way I understood the USB keyboard profile is they are all the same.