Usbio ACM sample program

From BitWizard Wiki
Jump to navigation Jump to search

USBIO sample ACM program

The sample ACM program can already be quite useful. It creates an ACM device on the USB bus where you can communicate with the AVR on the board.

Under Linux if you connect your usbio board when it is loaded with this program, you will get a /dev/ttyACM0 device.

Under windows you will have to follow the directions of the LUFA documentation which include downloading and using the INF file located: https://code.google.com/p/lufa-lib/source/browse/trunk/Demos/Device/LowLevel/VirtualSerial/LUFA%20VirtualSerial.inf?r=1607

The LUFA explanation is here: http://code.google.com/p/lufa-lib/source/browse/trunk/Demos/Device/LowLevel/VirtualSerial/VirtualSerial.txt?spec=svn1470&r=1470

Once you have the driver sorted, you can use any terminal program you like to connect with the board. I use "kermit" to communicate with serial devices like this. There are several other programs available, but I'm used to kermit. Under windows there is a program called hyperterm.

Once you connect to the device, you will be prompted with a welcome string and a prompt. You can use several commands:

s

if you type s<outputnumber> the output with that number will go high. Outputnumber is in hex. For usbio the output numbers go from 0 to f. For example s5 will turn on output 5.

c

if you type c<outputnumber> the output with that number will be cleared. For example: ce will clear output 14 (which is e in hex).

a

If you type a<output> <value> the output will be put in software pwm mode. Currently values 0...80 are supported (128 levels).

p

If you type p <output> <length> the output with that number will be pulsed for <length> ms. The length is of course in hex.

z

If you type "z" the board will reset into firmware-upload-mode.

Download

You can download the source from: http://www.bitwizard.nl/software/usbio.tgz

You then need to download LUFA, and place it in the directory usbio/../LUFA (i.e. next to the usbio directory).

Future enhancements

In the future we'll enhance the program to allow setting the mode of pins to inputs. And the program should be able to monitor the inputs value, and report the state changes as they happen. Also on-demand questioning of the inputs should become possible.