]> the.earth.li Git - usb-relay-firmware.git/blob - README.md
Add initial README.md
[usb-relay-firmware.git] / README.md
1 This is a basic firmware for the cheap USB relay boards that are sold on eBay
2 and report themselves as being from www.dcttech.com. They're based on an Atmel
3 ATtiny chip and run [V-USB](https://www.obdev.at/products/vusb/) as the core of
4 their firmware. I wanted to play around with some ATtiny programming so figured a good way to start was to build a new firmware for the device I already had that mimicked the existing firmware. Currently it only supports the 1 port board, but I'm sure it could be easily extended by anyone with access to the boards with more relays on them. Patches welcome.
5
6 `apt install avr-libc avrdude` should install the appropriate build requirements on Debian (`gcc-avr` will be automatically pulled in) assuming you already have `build-essential` installed for `make`.
7
8 `make` will then build you a main.hex which you can program to your device using
9 `avrdude`. With my [Bus Pirate](http://dangerousprototypes.com/docs/Bus_Pirate) I use:
10
11     avrdude -p attiny45 -c buspirate -P /dev/ttyUSB0 -U flash:w:main.hex:i
12
13 Pin outs on the 1 port relay board look like:
14
15 <pre>
16   |RELAY|
17   +-----+               [Bus Pirate connections]
18            o RESET      CS (white)
19            o SCK        CLK (purple)
20    +--+    o MISO       MISO (black)
21    |AT|    □ MOSI       MOSI (grey)
22    +--+
23            □ 5V         +5V (orange)
24            o GND        GND (brown)
25   | USB |
26   +-----+
27 </pre>
28
29 USB D- is connected to Port B pin 1, USB D+ to Port B pin 2 (INT0) and the relay is hanging off Port B pin 3.
30
31 Given that V-USB is GPLv2+ or commercial all of my code is released as GPLv3+, available at [https://the.earth.li/gitweb/?p=usb-relay-firmware.git;a=summary](https://the.earth.li/gitweb/?p=usb-relay-firmware.git;a=summary) or on GitHub for easy whatever at [https://github.com/u1f35c/usb-relay-firmware](https://github.com/u1f35c/usb-relay-firmware)