Babygnusbuino-v2

From SGMK-SSAM-WIKI
Jump to navigation Jump to search

Ports

By disabling the RESET pin and moving the USB lines to the two least interesting pins we're able to free up four inout/output pins with the most needed functions. This allows for example for a RGB-Led (3 PWMS) and an analog sensor. Or a complete serial communication device, or a I2C sensor chain and 2 pushbuttons… all while retaining full MIDI communication to the host over USB.

Apart from the special functions, each pin can function as a general purpose digital input / output.

Please note the rather bizarre numbering scheme on the Attiny85. Available pins are PB0, PB1, PB2 and PB


4. If you want MIDI functionality you should not connect anything to PB3 and never write anything to this pin, otherwise the USB connection will drop. PB5 can sink a status led (a logic low on PB5 will light the led). Here again: don't ever write to this pin if you want to keep a MIDI connection -but you can see a faint blinking if there's activity on the USB line, and a more visible blinking every time the line is driven low to disconnect/reconnect the device.

If you don't need USB/MIDI functionality, you can use PB5 and PB3 for status leds (as long as you use high enough series resitors to not disturb the USB line - 1kOhm should be ok). Push buttons are ok too, but you should not try to use these two pins for analog input - it could disturb the USB lines of the bootloader.

A word of warning

This is minimalist hardware with no safety features whatsoever.

Inserting a Babygnusbuino in your computers USB port exposes its electrical components to the outside world - this is the equivalent of running around with a double edged sword IN YOUR MOUTH: it's fun and exciting but you better not trip over… Take special care with external power sources - you can easily fry your computers USB port and ALL the devices (webcams, mice etc..) connected to the same port.

You've been warned.

Getting the files

You can either download the two folders and add their contents to the corresponding folders in your Arduino working directory, or you can pull the latest version directly through svn.

cd "the/path/to/Arduino/"    (for me on a Mac it is cd ~/Documents/Arduino  and on Ubuntu it is ~/sketchbook )
git clone https://github.com/mirdej/babygnusbuino.git hardware/babygnusbuino
git clone https://github.com/mirdej/GnusbuinoMIDI.git libraries/GnusbuinoMIDI

later on, you can always update to the latest version by typing

git pull

Patching avrdude

The Babygnusbuino has a bootloader and can thus be reprogrammed directly via USB, without the need for a AVR ISP programmer. Unfortunately, because of the architecture of the ATTINY85, it is

On Mac

./configure
make

rename old avrdude

mv /Applications/

On Ubuntu

in ARDUINO-IDE/hardware/tools replace avrdude and avrdude.conf with patched version maybe this precompiled binary works: Download File:GnusbuinoAvrdudeUbuntu.zip

otherwise you have to compile a patched avrdude yourself:


Then


sudo apt-get install bison
sudo apt-get install flex
sudo apt-get install libusb-dev
./configure
make


I also had to correct permissions for libusb. Not sure this is the right way, but anyway:

sudo gedit /lib/udev/rules.d/50-udev-default.rules

change

# 'libusb' device nodes
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0664"

to

# 'libusb' device nodes
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0666"

see http://unix.stackexchange.com/questions/44308/understanding-udev-rules-and-permissions-in-libusb

Compatibility