- Silicon Labs Community
- Welcome and Announcements
- Silicon Labs Knowledge Base
- 8-bit MCU
- 32-bit MCU
- Bluetooth / Wi-Fi
- Other Products Category
- Optical/RH/Temp Sensor
- Other Products
- Hardware and Software Tools
- Simplicity Studio and Software
- General Discussions and Suggestions
- Chinese Forum
- Software Libraries
- Development Kits
- Reference Designs
- Third Party Tools
- White Papers
- Official Blog of Silicon Labs
- Chinese Blog
09-10-2017 02:51 PM
I'm working with an Avnet LX9 Microboard, which uses a CP2102 USB-UART Bridge and a Spartan-6 FPGA. I'm using a simple UART interface inside the FPGA for sending/receiving characters from the CP2102. I installed the "VCP with Serial Enumeration" driver for Windows 7 x64 and successfully sent and received characters to/from the FPGA using RealTerm (serial capture program).
My goal is to have the FPGA send data to the PC which mimics that of a serial mouse (HID). My very basic understanding so far is that if the VCP receives an ASCII 'M' character (0x4D) then it will consider the input as mouse data. I tried researching the Plug-and-Play specification (link below), but I'm not sure under what conditions to send the data: when the device is first enumerated, every time I send a mouse movement packet, etc?
I'm also not sure if the SiLabs VCP driver is expecting a certain packet format for the mouse data. I've seen basic info online that typical serial mouse packets consists of 3 bytes, where bit 6 is the "first byte" flag and contains button, x and y movement data.
So far I've just tried (unsuccessfully) sending data packets which I thought might work, for example, from the FPGA's UART TX port:
PnP Mouse ID: 0x4D
Mouse data byte 1: 0x4F
Mouse data byte 2: 0x3F
Mouse data byte 3: 0x3F
I'd like to make it so the FPGA transmits a series of characters over UART to the CP2102 bridge, which then goes over USB to the VCP on my PC and results in moving the mouse.
Does anyone know more about how to format the mouse data packet, and about the Plug-and-Play headers? Any helpful reference material would be appreciated too.
Serial Mouse Protocol:
09-10-2017 08:20 PM
Which driver you are using? I suggest you tried the driver with serial enumeration feature on.
09-10-2017 11:52 PM
Yes, that's the driver I installed.
Download link for reference:
09-16-2017 09:04 PM
I have some updates on my progress, and some new questions.
I noticed that when I plug the LX9 Microboard into my PC, it looks like Windows enumerates the CP2102 USB-UART Bridge on the USB Host Controller and sends a single Null character (0x00).
I modified the VHDL on my board to just spam the CP2102 UART TX line with ASCII 'M' characters upon configuration. Once the FPGA receives a single Null character, it stops sending M's. This way, I power on the board, plug it into my computer, and it successfully enumerates as a Microsoft Serial Mouse. Windows installs the drivers for it too.
Note that I had to modify my VHDL to operate at 1200 baud, 1 bit start, 7 bits data, 1 bit stop on the UART side.
So now I've got my LX9 Microboard appearing as a mouse to Windows, and in my Device Manager I see this:
I'd like to still be able to transmit characters to the CP2102, while still receiving mouse data. Does anyone know if this is possible? It seems tricky because there appears to be conflicting drivers now...
09-17-2017 04:21 AM