USB HOST – Interfacing to an USB mouse

 

  1. What this example do?
  2. How I must configure my ORbit16™ to work with this example?
  3. Where I can learn more about this?
  4. Download this example!

What this example do?

In this demo, the ORbit16™ will be interfaced to an USB mouse. Movement, scrolling wheel, right center and left button will be read. Data from mouse will be shown on Usart2 (a TTL adapter is required) and on a Nokia LCD with PCD8544 controller.

Warning: not all mice are supported. Particularly composite and compound devices are not supported. Also some mice (not composite and not compound) are not supported.

Here is a video showing how demo works: http://www.youtube.com/watch?v=E5k0hYLqF30

How I must configure my ORbit16™ to work with this example?

First, program the ORbit16™ with USB selector in ‘Device Mode’ in order to make bootloader work. When programming has finished, you must put USB selector in ‘Host’ mode. Please refer to Jumper Settings document in the Documents Section.

You can read on a terminal software (such as Hyperterminal, with the settings 57600,8,N,1) the various debug messages. If you want to do that, a 3V TTL serial adapter is required but is not needed for main application functions.

Then connect an USB mouse to USB HOST connector.

This example uses also a Nokia Display. Go to the PCD8544 library page and read the usage document: here you will see the display pinout. Follow the instructions in the document. In particular you must connect the display IOs as showed here (left: display IO, right: ORbit16™ IO):

  1. VCC to 3.3V
  2. GND to GND
  3. SCE to GND
  4. RST to RA0
  5. D/C to RA1
  6. DN (MOSI) to RB0
  7. SCLK to RB1
  8. LED : is the backlight, you can leave it disconnected or you can connect it to 3.3V through a 220Ω resistor

Where I can learn more about this?

My advice is to read the documents located at this link

Download this example!

USB HOST - Using an HID USB Mouse (187 downloads)