Summary: Using a adafruit trinket with linux
I recently purchased an Adafruit trinket from BC Robotics and I had a few plans for the small microcontroller. But before I could do that I had to get my linux computer to recognize the trinket. The trinket implements USB in software rather than with hardware and my linux computer would not recognize the trinket.
Getting linux to recognize the trinket
When I plugged the trinket into my computer it would not show up as a USB device in /dev
. Running
lsusb
and checking dmesg
showed that the device was connected but it was not assigned a location in /dev/ttyUSBn
.
According to the arduino and Cap'n Regex sites I needed to add a rule to udev to get the trinket assigned a location in /dev
.
I created a file named 99-arduino-trinket.rule
in /etc/udev/rules.d/
and added the following lines:
# Adafruit Trinket
SUBSYSTEM=="usb", ATTR{product}=="USBtiny", ATTR{idProduct}=="0c9f", ATTRS{idVendor}=="1781", MODE="0666", GROUP="dialout", SYMLINK+="ttyUSB%n"
SUBSYSTEM=="usb", ATTR{product}=="Trinket", ATTR{idProduct}=="0c9f", ATTRS{idVendor}=="1781", MODE="0666", GROUP="dialout", SYMLINK+="ttyUSB%n"
Now when the device is connected it is assigned to /dev/ttyUSBn
.
Modifying AVRDUDE.conf for programming
The trinket was now recognized by the computer but it was programmable. According to the adafruit trinket site the avrdude.conf
needs to be modified for the attiny85 chip that the trinket uses. The attiny85 settings in
/etc/avrdude.conf
must be replaced with the linux attiny85 settings. If you then start the arduino IDE and set the verbose output when uploading you can find the path
of the arduino IDE avrdude.conf. Mine was in /usr/share/arduino/hardware/tools/avr/etc/avrdude.conf
. Replace that copy of avrdude.conf
with the one from
from /etc/avrdude.conf
.