- Demo Applications
the avrBridge bridges an avr microcontroller’s hardware registers to a host pc, so the host can access them just like they were part of itself or in other words, it adds a set of general purpose I/O pins as well as ADCs and DACs to your PC, Notebook, Server or Router and makes them accessible via an easy to use API.
To demonstrate what this actually means, here’s a quick example, that would flash a led at PORTB, PIN0.
// configure PORTB, PIN0 as an output pin
// set led on
// sleep a while
// set led off
// sleep again
the hardware requirements are minimal, usb is done in software using obde’s V-USB and since that, all you actually need is an atmel atmega8, a usb-port, 4resistors and a resonator, you can find schematics for simple dev-board here , at metalab.at or at obdev.at .Currently there is only one supported mcu, the atmel atmega8.
The firmware is based on obdev’s V-USB, which implements USB completely in software.
Right now only usb control-messages are transferred, to improve performance bulk messages will be used in a future release.
to access the hardware from the host side, there are several possibilities, currently there is:
- avrBridgeC – a c-library which relies on libusb
- avrBridgeJNA – a java-wrapper for the c-library
- avrBridgeKMOD – a x86-linux- kernel 2.6 driver
- avrBridgeC_openWRT – the c-library for use with openWRT-based embedded systems
- avrBridgeKMOD_openWRT – linux- kernel 2.4/2.6 driver for use with openWRT-based embedded-systems
following features are currently supported:
- read/write all PORTs and PINs
- read from ADC on all channels
- write to DAC on all PWM channels
following features will be supported:
- configure timers
- use i2c, usart and spi bus
here are some potential use cases for the avrBridge:
- rapid prototyping: because the software runs on the host, no firmware flashing is required anymore.
- debugging: the fact that common registers can be read, displayed and analyzed from the host at any time, makes debugging more comfortable
- Human Interface Devices: because of the usb connection, and the easy to use host side API, the weirdest hid devices can be implemented in no time!
- Datalogging: collecting and analyzing live sensor-data is as simple as the led example above.
- Hardware Hacks:Hacking new features into Toys and Consumer Electronics can be done with minimal programming efforts.
- Extending Embedded Devices:
the avrBridge now supports OpenWRT embedded devices running Linux Kernel 2.4 and 2.6
- zero-signal detector
a little tool I built for a radio-station I work for, its basically the dev-board from above with two audio-jacks connected to two adcs.The host software polls the adcs and decides what to do in case there is so signal going out of the station.
I’ve simply placed two piezos on the floor beneath my desk so I can use them as footswitches to trigger shortcuts or mouse-events.
- Remote Remote Power Switch
I’ve managed to connect a cheap hx2262-based remote controled power outlet to an openWRT-based router using the avrBridge.
This is a short preview showing the openAMI AJAX-Remote, Light control and sensing is done by using an avrBridge connected to a ASUS wl500 gp V2 wireless router.
hg clone https://avrbridge.openami.googlecode.com/hg/ openami-avrbridge
In addition to the source-code repository, schematics and sources are also available for download here.
The Documentation isn’t nearly complete, but build instructions and some samples can already be found here.