1

When a USB mouse is connected how does the system tell it's a mouse? Does it send some signal?

I need to implement (something like) a little mouse using an fpga board. I can output x and y coordinates from the board. How do I take the input x and y coordinates from the board and tell the system to control the mouse using them? I think I need to tell the system to treat the board as a mouse. How do I do that?

To be exact: it's a touch screen using proximity sensors.

Edit: The board is an "Altera Cyclone 4 DE2-115"

Edit2: We're using Verilog

  • Note that many touchscreens report data over a simple serial tty-like port, not usb. This would be much easier to implement than usb. Emulating some existing touchscreen protocol would mean not having to develop a software driver. Look for free and libre fpga code on opencores. You might also look at our sister site electronics.stackexchange. You have a long way to go. – meuh Dec 1 '16 at 14:20
3

When a USB mouse is connected how does the system tell it's a mouse? Does it send some signal?

Yes, it sends a USB descriptor, from which the host can tell that it is a mouse and how it expects the host to start reading input from it.

How do I take the input x and y coordinates from the board and tell the system to control the mouse using them?

Making it a proper USB device is a possible solution, which might even get you extra credit. Do not underestimate the complexity of implementing USB, though. Especially without hardware support (it can be done though bit-banging, e.g.: http://hackaday.com/2014/03/22/bitbanging-usb-on-low-power-arms/)

The simplest way is to implement a PS/2 mouse rather than a USB mouse. You can include a PS/2 to USB converter with your project. Another way is to implement a serial mouse.

  • I need the simplest solution possible XD Which would be the simplest? PS/2 or serial? ...then could you point me to some guide? I don't know where to start. Assume that I don't know anything at all (which is true) – Mina Michael Nov 30 '16 at 23:56
  • @MinaMichael The serial protocol is probably the dumbest of all, but I think it is harder to find documentation and example code for it, so if I were doing it I would use PS/2. Of course doing it in Verilog or VHDL will be a bit different than the example code out there which is for MCU. Unless you have enough room on the FPGA to put an MCU on it, which is another possibility ... – DepressedDaniel Dec 1 '16 at 0:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.