ATTiny85

An area to discuss AVR and Arduino specific problems and examples

Moderator: Benj

Post Reply
mnf
Valued Contributor
Valued Contributor
Posts: 1064
Joined: Wed May 31, 2017 11:57 am
Has thanked: 63 times
Been thanked: 413 times
Contact:

ATTiny85

Post by mnf »

I've been trying to get an ATTiny85 to drive a WS2812 LED strip without much success. (I got it to work for ~10 LEDs)

It seems the timing is a bit out - the Adafruit library puts out a ~812kHz - but using Flowcode I'm just getting ~750kHz - looking at the output on an oscilloscope.

Has anyone got an ATTiny up and running with this component?

The ATTiny 'should' be running at 16MHz - but there isn't an option to in the Project Options - configure tab for this.. (This is a confusing list of dozens of options - however because the selection box isn't wide enough to display all the text, it isn't easy to make an informed decision here? - on selecting an option the text box of the Configure tab is also too short to display all the text - resizing the dialog box doesn't help).

Setting the clock to 16MHz and trying various settings wasn't successful - the WS2812s may not be as demanding on timing as advertised - (see for example https://wp.josh.com/2014/05/13/ws2812-n ... #more-1681 - he also has some great ideas for large (very large) displays driven by an Arduino - by not buffering the strip contents)

Is there a better option to upload the program to the 85? I'm using a digispark board running a micronucleus kernel - which allows programming via USB... Flowcode tries to use AVRDude via a usbtiny which I'm not using. I'm currently using the digistump tools via the command line - but it's not a particularly smooth process - I keep closing the cmd window by mistake (aaarrggh)

Why - I had an idea to try a POV 'fan' - and initially thought - port expander and ATTiny85 (which I wanted to try) - but then the appeal of RGB at each point got to me and I decided to try a short string of addressable LEDS (and anything that reduces the amount of soldering & wiring appeals big time too :D ) - this might not be fast enough for a good POV display ???

Martin

User avatar
Benj
Matrix Staff
Posts: 15159
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4753 times
Been thanked: 4285 times
Contact:

Re: ATTiny85

Post by Benj »

Hi Martin,

I did a POV display project a few years back. I'm using a dsPIC but you still have lots of made up boards and motors etc if you fancy one.
https://www.instructables.com/id/Ultima ... r-Display/

I also did an earlier versionusing an AVR but the LEDs were much bigger making the propellor quite large and therefore dangerous as it's spinning at speed, approx 25cm in length.

If you can drive 10 LEDs then it should be possible to drive more, maybe it's a current sourcing problem? I've already been through the how to hack the WS2812 timings tutorials and implemented the results into the component. Keep the colour channel values very low and this will vastly decrease current draw and hopefully allow you to drive more LEDs. As for using the WS LEDs in a POV display you may have problems with the automatic refresh rate as you have no real control over this.

Atmel Studio can be quite useful for determining AVR config values though it's fairly sizable to download and install just for that.

mnf
Valued Contributor
Valued Contributor
Posts: 1064
Joined: Wed May 31, 2017 11:57 am
Has thanked: 63 times
Been thanked: 413 times
Contact:

Re: ATTiny85

Post by mnf »

Thanks Ben,

I'll have a try with Atmel Studio - I think I had a copy installed... I don't think it's a power issue - I have the LEDs powered from a bench supply (with a cap across to limit startup problems and a common ground) and the strip of 60 is working fine when using the adafruit library...
If I set number of LEDs to 60 - and setAllLeds to a faint colour (& refresh) - the first 16 in the string get altered (I set the string to all red leds using the adafruit code) Counting up the LED string then changes (slightly erratically) these 16 LEDs. As mentioned - the output from the FC program looks very similar to the adafruit program when viewed on an oscilloscope - just a slightly lower frequency.

Martin

Post Reply