Readme.txt 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. This is the Readme file for the directory "examples" of AVR-USB, a firmware-
  2. only USB driver for AVR microcontrollers.
  3. WHAT IS IN THIS DIRECTORY?
  4. ==========================
  5. This directory contains examples which are mostly for educational purposes.
  6. Examples can be device firmware only, host software only or both. Here is
  7. a summary:
  8. custom-class
  9. A custom class device with host software based on libusb. It demonstrates
  10. the straight forward way of sending small amounts of data to a device and
  11. receiving data from the device. It does NOT demonstrate how to send large
  12. amounts of data to the device or how to receive data generated on the fly
  13. by the device (how to use usbFunctionWrite() and usbFunctionRead()). See
  14. the hid-data example for how usbFunctionWrite() and usbFunctionRead() are
  15. used.
  16. hid-custom-rq
  17. This example implements the same functionality as the custom-class example
  18. above, but declares the device as HID. This prevents the "give me a driver
  19. CD" dialog on Windows. The device can still be controlled with libusb as in
  20. the previous example (on Windows, the filter version of libusb-win32 must
  21. be installed). In addition to the features presented in custom-class, this
  22. example demonstrates how a HID class device is defined.
  23. hid-mouse
  24. This example implements a mouse device. No host driver is required since
  25. today's operating systems have drivers for USB mice built-in. It
  26. demonstrates how a real-world HID class device is implemented and how
  27. interrupt-in endpoints are used.
  28. hid-data
  29. This example demonstrates how the HID class can be misused to transfer
  30. arbitrary data over HID feature reports. This technique is of great value
  31. on Windows because no driver DLLs are needed (the hid-custom-rq example
  32. still requires the libusb-win32 DLL, although it may be in the program's
  33. directory). The host side application requires no installation, it can
  34. even be started directly from a CD. This example also demonstrates how
  35. to transfer data using usbFunctionWrite() and usbFunctionRead().
  36. usbtool
  37. This is a general purpose development and debugging tool for USB devices.
  38. You can use it during development of your device to test various requests
  39. without special test programs. But it is also an example how all the
  40. libusb API functions are used.
  41. More information about each example can be found in the Readme file in the
  42. respective directory.
  43. Hardware dependencies of AVR code has been kept at a minimum. All examples
  44. should work on any AVR chip which has enough resources to run the driver.
  45. Makefile and usbconfig.h have been configured for the metaboard hardware (see
  46. http://www.obdev.at/goto.php?t=metaboard for details). Edit the target
  47. device, fuse values, clock rate and programmer in Makefile and the I/O pins
  48. dedicated to USB in usbconfig.h.
  49. WHAT IS NOT DEMONSTRATED IN THESE EXAMPLES?
  50. ===========================================
  51. These examples show only the most basic functionality. More elaborate
  52. examples and real world applications showing more features of the driver are
  53. available at http://www.obdev.at/avrusb/projects.html. Most of these
  54. features are described in our documentation wiki at
  55. http://www.obdev.at/goto.php?t=avrusb-wiki.
  56. To mention just a few:
  57. Using RC oscillator for system clock
  58. The 12.8 MHz and 16.5 MHz modules of AVR-USB have been designed to cope
  59. with clock rate deviations up to 1%. This allows an RC oscillator to be
  60. used. Since the AVR's RC oscillator has a factory precision of only 10%,
  61. it must be calibrated to an external reference. The EasyLogger example
  62. shows how this can be done.
  63. Dynamically generated descriptors
  64. Sometimes you want to implement different typtes of USB device depending
  65. on a jumper or other condition. AVR-USB has a very flexible interface for
  66. providing USB descriptors. See AVR-Doper for how to provide descriptors
  67. at runtime.
  68. Virtual COM port
  69. Some people prefer a virtual serial interface to communicate with their
  70. device. We strongly discourage this method because it does things
  71. forbidden by the USB specification. If you still want to go this route,
  72. see AVR-CDC.
  73. Implementing suspend mode
  74. AVR-USB does not implement suspend mode. This means that the device does
  75. not reduce power consumption when the host goes into sleep mode. Device
  76. firmware is free to implement suspend mode, though. See USB2LPT for an
  77. example.
  78. The projects mentioned above can best be found on
  79. http://www.obdev.at/avrusb/prjall.html
  80. where all projects are listed.
  81. ----------------------------------------------------------------------------
  82. (c) 2008 by OBJECTIVE DEVELOPMENT Software GmbH.
  83. http://www.obdev.at/