You need to log in to create posts and topics.

WS2812 does not work properly with ATTINY85

While testing the WS2812 with an ATtiny85, I encountered an issue where the LED module was either unresponsive or behaved erratically. I tested the same code on a physical ATtiny85, and the results were identical—the LEDs lit up exactly the same way as in the simulation. Upon further investigation, I checked the fuse settings and discovered that they needed to be configured as follows for the ATtiny85:

  • Low fuse: 0xE2
  • High fuse: 0xDF
  • Extended fuse (ESAVE): 0xFF
  • Lock bit fuse: 0xFF

After re-uploading the code with these fuse settings, the WS2812 started working correctly on the physical hardware. This led me to wonder if this might be an issue with the AVR model used in the simulation.

Thanks in advance for your time and help.

 


Platform IO Configuration

[env:uno]
platform = atmelavr
board = uno
framework = arduino
lib_deps = adafruit/Adafruit NeoPixel@^1.15.1

[env:attiny85]
platform = atmelavr
board = attiny85
framework = arduino
lib_deps = adafruit/Adafruit NeoPixel@^1.15.1
board_build.f_cpu = 8000000L
 
 
Code:
#include <Arduino.h>
#include <Adafruit_NeoPixel.h>

#define PIN PB1 // I used 6, for arduino uno, bur here i'm using PB1 for ATTINY85
#define NUM_LEDS 8
Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LEDS, PIN, NEO_GRB + NEO_KHZ800);

void setup()
{
  strip.begin();                                   // Initialize the strip
  strip.setBrightness(255);                        // Set the brightness to maximum (255)
  strip.fill(strip.Color(255, 0, 0), 0, NUM_LEDS); // Fill the strip with red color
  strip.show();                                    // Update the strip to show the changes
}

void loop()
{
  // put your main code here, to run repeatedly:
}

Output image: 

Uploaded files:

Hi, thanks for reporting.

AVRs don't include fuses in the hex file, so configuration for fuses must be done manually in the "Config" tab.

In any case I will have a look.