Usblinky: Unterschied zwischen den Versionen

aus Metalab Wiki, dem offenen Zentrum für meta-disziplinäre Magier und technisch-kreative Enthusiasten.
Zur Navigation springenZur Suche springen
Zeile 43: Zeile 43:
  
  
===Pitfalls and lessons learned ===
+
==Pitfalls and lessons learned ==
 
===Adafruit trinket===
 
===Adafruit trinket===
 
Adafruit built another bootloader that uses a similar trick than micronucleus.
 
Adafruit built another bootloader that uses a similar trick than micronucleus.
Zeile 60: Zeile 60:
  
 
Under some special circumstances it can happen that the bootloader falsy triggers and the FLASH on the MCU is damaged and it can not be programmed any more over USB.
 
Under some special circumstances it can happen that the bootloader falsy triggers and the FLASH on the MCU is damaged and it can not be programmed any more over USB.
 +
 +
 +
===Digispark / micronucleus===
  
 
That was the point that i took a closer look at the micronucleus bootloader.
 
That was the point that i took a closer look at the micronucleus bootloader.
Zeile 67: Zeile 70:
 
The drawback is that you need to modify the arduino environment, but there are packages available for that.
 
The drawback is that you need to modify the arduino environment, but there are packages available for that.
  
When I used the usblinky as a BUTTON for the selfiebooth setup i realized that the pinout is inversed on the trinket.
+
When I used the usblinky as a BUTTON for the selfiebooth setup I realized that the pinout differs on the trinket.
  
 
D+ and D- are switched on the MCU side.
 
D+ and D- are switched on the MCU side.

Version vom 12. März 2015, 21:21 Uhr

What

usblinky

  • is a small usb stick with 4 wires on on end
  • controls up to 150 addressable RGB lights (for example WS2812B)
  • can run stand alone from a USB power supply once programmed
  • consists of:
    • ATTINY85
    • micronucleus 1.11 bootloader based on vUSB

Software

usblinky uses the micronucleus bootloader that speaks USB in software and enables the ATTINY85 to be programmed directly over USB.

A modified arduino environment for this task can be found here

All the sources are available on github.


How

I started this project after pl, chris and I went to make munich 2015 to represent the metalab and the hackerspaceshop.com project there.

It was a blast!

On the second day a guy asked for a microcontroller and a high power led to illuminate a 3D-printed vase he made.

We had no Highpower RGB leds on hand but we gave him a microcontroller and a piece of ws2812 ledstrip (thanks to pl for that great idea!)

Turns out it looked pretty groovy.

So the next day the guys returned the microcontroller and ledstrip and asked if this could be available as a kit.

I said that a full blown ATMEGA32U4 is a waste of resources for that kind of application.. and this is how this project started.

Johannes from ehajo was also there showing off a usbstick with an attiny2313 on board that can be used as a AVR programmer.

I got a handful of these sticks and made a new firmware to drive ledstrips with it.

But this microcontroller was too small to do fancy effects and so i made a completely new design for this job.



Pitfalls and lessons learned

Adafruit trinket

Adafruit built another bootloader that uses a similar trick than micronucleus.

They speak USB over vUSB but enumerate the device as a usbtiny programmer.

The arduino sees a programmer and progremms the ATTINY85 as a target, when it actually overwrites its own FLASH with the user program.

I liked that nifty approach and used the Trinket bootloader when i started this project.

But then i read that adafruit does not wnt you to use their USB ID in a product that you sell.

I contacted them but got no meaningful reply, only a standardized answer that i should come back once my product launched.

Later on i found out that the bootloader on the trinket is fragile.

Under some special circumstances it can happen that the bootloader falsy triggers and the FLASH on the MCU is damaged and it can not be programmed any more over USB.


Digispark / micronucleus

That was the point that i took a closer look at the micronucleus bootloader.

This bootloader is significantly smaller (2k versus 3.5k) and the code is much more straight forward than the trinket bootloader.

The drawback is that you need to modify the arduino environment, but there are packages available for that.

When I used the usblinky as a BUTTON for the selfiebooth setup I realized that the pinout differs on the trinket.

D+ and D- are switched on the MCU side.

In theory not a big deal, but a lot of libraries that are available for the digispark project (for example the USB keyboard emulation) has this pinout hardcoded and I needed to modify the .cpp files in the Arduino environment to make that work.

Future versions of USBlinky have the pins swapped as on the original digispark design.

Alternate usecases

A usblinky stick was used in the selfiebooth installed for the time travellers party.

This stick illuminated a big white button that spits out "PING\n" over USB keyboard when pressed

Who

  • Overflo -The whole USBLINKY project.
  • clifford, marius - OpenSCAD THANK YOU!!
  • cs - vUSB from OBDEV is amazing. Thank you so much.


Media

...
...
...
..
...
..


(in case there is no embedded video look here and here

Links

hackerspaceshop

github

Digispark Arduino