Skip to main content
Visitor II
November 7, 2024
Question

USB HID Mouse+Keyboard

  • November 7, 2024
  • 3 replies
  • 1435 views

Hi guys,

I've a problem and I hope you can help me.

my project must acquire a ps2 keyobard and a ps2 mouse and must be see with the usb.

This is ioc configuration:

usbcfg.PNG

 

usbdevice.PNG

 

The first step I tested the firmware only acquire a keyboard and works fine. The PC see the keyboard descriptor and write the character.

The next step I tested the firmware only acquire a mouse and works fine. The PC see the mouse descriptor and  move the mouse.

So I've try to combined the descriptors and the PC see the keyboard and mouse.

Cattura.PNG

 

When I send the report of keyboard I'm able to write the character.

Cattura2.PNG

 

But when I send the report of mouse I see an "Abort pipe" and the usb crash.

Cattura3.PNG

 

I attached my project so you can see it

 

Thanks.

Best,

 

Michael

    This topic has been closed for replies.

    3 replies

    Super User
    November 7, 2024

    What means acquire? Are you making a converter of PS/2 keyboard and mouse to USB? If so, these converters already exist, very cheap. Just buy and use.

     

    Super User
    November 8, 2024

    I wouldn't be surprised if PS/2 mice & keyboards are now collector's items and sell for a premium ...

    Super User
    November 8, 2024

    About 10 years ago I did a similar thing on a STM32F4. Don't have sources but recall that the USB part of it was straightforward. Just make sure the HID descriptors are correct.

    For the best compatibility (any old host) converters are composite devices with the keyboard as the 1st function.

    But any modern desktop OS understands one device with two HID collections: two report descriptors in one HID device, one for keyboard another for mouse. Only one function descriptor and one endpoint.

    Super User
    November 8, 2024