📄 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 forUnix to control 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/).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 uisp with the AVR910 serial programmer connected through a USB toserial adapter to a Mac running Mac OS X.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 Makefile and edit the settings if requiredand type "make". This will build the unix 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 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/usbconfig.h". PowerSwitch uses Objective Development's free sharedUSB IDs by default. You may set your own USB IDs in usbconfig.h. For moreinformation about USB descriptors and IDs see the document "USB in a Nutshell"available at http://www.beyondlogic.org/usbnutshell/usb1.htm or the USB 1.1standard available at http://www.usb.org/. Don't forget to check the licenseagreement for 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 USBdevices and ideas for USB devices available to the general public. Wetherefore require that all projects built with our USB driver are publishedunder an Open Source license. Our license for the USB driver and demo codeis based on the GNU General Public License (GPL). We add some specialrequirements and privileges, though. See the file "License.txt" for details.If you don't want to publish your source code and the circuit diagrams underan Open Source license, you can simply pay money for AVR-USB. As anadditional benefit you get USB PIDs for free, licensed exclusively to you.See http://www.obdev.at/products/avrusb/license.html 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 by OBJECTIVE DEVELOPMENT Software GmbH.http://www.obdev.at/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -