cancel
Showing results for 
Search instead for 
Did you mean: 

USB HID Mouse+Keyboard

Maikip92
Associate

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

5 REPLIES 5
Pavel A.
Evangelist III

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.

 

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

Acquire means read Data and Clock signal from mouse and keyboard. This step works fine

I know there is a converters but our client want a custom board and that is allways avaible.

So we can't buy a commercial product

Pavel A.
Evangelist III

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.