📄 readme.txt
字号:
This is the README file for the PowerSwitch USB device.PowerSwitch is an example application using Objective Development'sfirmware-only USB driver for Atmel's AVR microcontrollers. It provides 8 bitsof parallel output intended to switch e.g. the power supply to electronicdevices. The PowerSwitch firmware is accompanied by a command line tool tocontrol the device.Objective Development's USB driver is a firmware-only implementation of theUSB 1.1 standard (low speed device) on cheap single chip microcomputers ofAtmel's AVR series, such as the ATtiny2313 or even some of the small 8 pindevices. It implements the standard to the point where useful applicationscan be implemented. See the file "firmware/usbdrdv/usbdrv.h" for featuresand limitations.BUILDING AND INSTALLINGBoth, the firmware and Unix command line tool are built with "make". You mayneed to customize both makefiles.Firmware:The firmware for PowerSwitch requires avr-gcc and avr-libc (a C-library forthe AVR controller). Please read the instructions athttp://www.nongnu.org/avr-libc/user-manual/install_tools.html for how toinstall the GNU toolchain (avr-gcc, assembler, linker etc.) and avr-libc.If you are on Windows, download WinAVR (see http://winavr.sourceforge.net/).For the Mac, we recommend AVR MacPack at http://www.obdev.at/avrmacpack/.Once you have the GNU toolchain for AVR microcontrollers installed, you canrun "make" in the subdirectory "firmware". You may have to edit the Makefileto use your preferred downloader with "make flash". Our current version isbuilt for avrdude with our AVR-Doper programmer.Command Line Tool on Unix:The command line tool requires libusb. Please download libusb fromhttp://libusb.sourceforge.net/ and install it before you compile. Change todirectory "commandline", check the settings in Makefile and edit them asappropriate. Then type "make" to build the executable "powerSwitch" which canbe used to control the device.Command Line Tool on Windows:The command line tool uses libusb-win32. Please download libusb-win32 fromhttp://libusb-win32.sourceforge.net/. The small package(libusb-win32-device-bin) should be sufficient. We need usb.h and libusb.a forgcc (or your favorite compiler). Make sure that usb.h is in the include pathand libusb.a in the library search path (edit Makefile to achieve this).Although it should be possible to compile the command line tool with anycompiler, we recommend that you use MSYS (to run make and other Unix tools)and MinGW (for the gcc toolchain). Both can be downloaded for free fromhttp://www.mingw.org/.If you want to develop Windows drivers without libusb-win32, see our"Automator" project for an example.WORKING WITH POWERSWITCHOnce you have compiled and flashed the firmware and compiled the command linetool, you can move on to the fun part: Connect the device to a free USB portof your computer or USB-hub. You should now be able to find the device inany USB analyzer tool, e.g. SystemProfiler on Mac OS X. If you connect itto a Windows PC, the "New Hardware" dialog will pop up and you can createthe appropriate info files with libusb-win32's inf-wizard.The next step is to try the command line tool, e.g.: ./powerSwitch off 3to turn off port 3 (all ports are on when the device has been cleared) or for i in 0 1 2 3 4 5 6 7; do ./powerSwitch off $i; donein an sh or bash (not csh or tcsh) type shell to turn off all ports.You can also switch a port on or off temporarily. Try ./powerSwitch on 0 2.5to activate port 0 for two and a half seconds.FILES IN THE DISTRIBUTIONReadme.txt ........ The file you are currently reading.firmware .......... Source code of the controller firmware.firmware/usbdrv ... USB driver -- See Readme.txt in this directory for infocommandline ....... Source code of the host software (needs libusb).circuit ........... Circuit diagrams in PDF and EAGLE 4 format. A free version of EAGLE is available for Linux, Mac OS X and Windows from http://www.cadsoft.de/.License.txt ....... Public license (GNU GPL2) for all contents of this project.Changelog.txt ..... Logfile documenting changes in soft-, firm- and hardware.Pitfalls.txt ...... List of possible pitfalls and solutions.USING THE USB DRIVER FOR YOUR OWN PROJECTSPowerSwitch is mainly an example, although it may be very useful by itself.If you want to implement your own application based on our USB driver, seethe file "firmware/main.c" for the application specific part of the firmware.PowerSwitch uses only the most basic driver interface. More information and afull technical description of the driver's interface can be found in"firmware/usbdrv/usbdrv.h". Please review the configuration options in"firmware/usbdrv/usbconfig-prototype.h". PowerSwitch uses ObjectiveDevelopment's free shared USB IDs by default. You may set your own USB IDsin usbconfig.h. For more information about USB descriptors and IDs see thedocument "USB in a Nutshell" available athttp://www.beyondlogic.org/usbnutshell/usb1.htm or the USB 1.1 standardavailable at http://www.usb.org/. Don't forget to check the license agreementfor Objective Development's firmware-only USB driver!ABOUT THE LICENSEIt is our intention to make our USB driver and this demo applicationavailable to everyone. Moreover, we want to make a broad range of USBprojects and ideas for USB devices available to the general public. Wetherefore want that all projects built with our USB driver are publishedunder an Open Source license. Our license for the USB driver and demo code isthe GNU General Public License Version 2 (GPL2). See the file "License.txt"for details.If you don't want to publish your source code under the GPL2, you can simplypay money for AVR-USB. As an additional benefit you get USB PIDs for free,licensed exclusively to you. See the file "CommercialLicense.txt" for details.MORE INFORMATIONFor more information about Objective Development's firmware-only USB driverfor Atmel's AVR microcontrollers please visit the URL http://www.obdev.at/products/avrusb/A technical documentation of the driver's interface can be found in the file"firmware/usbdrv/usbdrv.h".(c) 2005, 2006, 2007 by OBJECTIVE DEVELOPMENT Software GmbH.http://www.obdev.at/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -