Go Down

Topic: Problem running LED sketch on ATTiny85 chip (Read 130 times) previous topic - next topic


I uploaded a sketch that works perfectly on my Arduino Uno, to an ATTiny85 chip (I chose Internal 16 Mhz).    When I attach the LED data cable to the ATTiny85 chip on the selected pin, it doesn't execute the sketch, all leds are just glowing bright orange - so it's getting some instructions, just not the right ones.

Any thoughts?


Please post your full sketch. If possible, you should always post code directly in the forum thread as text using code tags (</> button on the toolbar). This will make it easy for anyone to look at it, which will increase the likelihood of you getting help. If the sketch is longer than the forum will allow then it's OK to add it as an attachment. After clicking the "Reply" button, you will see an "Attachments and other settings" link.

Please always do an Auto Format (Tools > Auto Format in the Arduino IDE or Ctrl + B in the Arduino Web Editor) on your code before posting it. This will make it easier for you to spot bugs and make it easier for us to read.

When your code requires a library that's not included with the Arduino IDE please post a link (using the chain links icon on the toolbar to make it clickable) to where you downloaded that library from or if you installed it using Library Manger (Sketch > Include Library > Manage Libraries in the Arduino IDE or Libraries > Library Manager in the Arduino Web Editor) then say so and state the full name of the library.


Also, tell us what board package you're using to add support for the tiny85.

Also, what do you mean "LED data cable"? LEDs don't have a data cable, unless you're talking about a WS2812 LED string, in which case - how many LEDs and how are you trying to power the whole thing? If you have a power supply that can't supply enough current, if it reacts to that by letting the voltage droop, the result will be that the red channel will work, and the green channel will work a little and the blue not at all - so if you sent all white to them, the result could be that they'd all be a dark red-orange.

You say you selected 16MHz internal. Did you do "burn bootloader" to set the chip to actually run at that speed? A virgin tiny85 runs at 1MHz (same as all other AVRs - this way it is in spec over the full voltage range, so that they can be programmed in system even if the system runs at the minimum voltage), and you need to do "burn bootloader" (even if not using a bootloader) to set it to run at the selected speed.

I've seen a chip running at a speed different than what was set when the sketch was compiled, attempting to control WS2812 LEDs resulting in them all turning white. Which, if you had too many LEDs for your power source, and it responded to overcurrent by letting the voltage droop instead of turning power off entirely, you would see all the LEDs turn on red/orange.
ATtiny core for 841+1634+828 and x313/x4/x5/x61/x7/x8 series Board Manager:
ATtiny breakouts (some assembled), mosfets and awesome prototyping board in my store http://tindie.com/stores/DrAzzy


I think the problem was that I fried the chip.  I started with a fresh one and everything works perfectly.  Thanks for the responses.

Go Up