Skip to content

Need ATTiny13 support #581

Closed as not planned
Closed as not planned

Description

@532910

MCUdude/MicroCore#54

In file included from /root/Arduino/libraries/FastLED/FastLED.h:51:0,
                 from /root/Arduino/RGB-HUE-RR/RGB-HUE-RR.ino:5:
/root/Arduino/libraries/FastLED/fastpin.h: In instantiation of 'class FastPin<1u>':
/root/Arduino/libraries/FastLED/platforms/avr/clockless_trinket.h:96:49:   required from 'class ClocklessController<1u, 3, 3, 6, (EOrder)10u, 0, false, 10>'
/root/Arduino/libraries/FastLED/chipsets.h:460:7:   required from 'class WS2811Controller800Khz<1u, (EOrder)10u>'
/root/Arduino/libraries/FastLED/FastLED.h:111:52:   required from 'class WS2811<1u, (EOrder)10u>'
/root/Arduino/libraries/FastLED/FastLED.h:304:33:   required from 'static CLEDController& CFastLED::addLeds(CRGB*, int, int) [with CHIPSET = WS2811; unsigned char DATA_PIN = 1u]'
/root/Arduino/RGB-HUE-RR/RGB-HUE-RR.ino:13:43:   required from here
/root/Arduino/libraries/FastLED/fastpin.h:207:2: error: static assertion failed: Invalid pin specified
  static_assert(validpin(), "Invalid pin specified");
  ^
exit status 1
Error compiling for board ATtiny13.

Code (it works with arduino atmega and Attiny85 ATTinyCore

// this is temporary workaround for ATTinyCore
extern "C" {
  volatile unsigned long timer0_millis = 0; // FAKE FAKE FAKE!
}

#include<FastLED.h>
#define NUM_LEDS 8

CRGBArray<NUM_LEDS> leds;

static uint8_t hue[NUM_LEDS];

void setup(){
  FastLED.addLeds<WS2811,1>(leds, NUM_LEDS);

  for(int i = 0; i < NUM_LEDS; i++){
    hue[i] = i;
  }
}

void loop(){ 
  for(int i = 0; i < NUM_LEDS; i++){   
    leds[i] = CHSV(hue[i],255,255);
    FastLED.delay(0);
    hue[i] ++;
  }
}

Activity

  1. focalintent commented on Mar 21, 2018

    @focalintent
    Contributor

    The problem is there are no pin definitions for the ATTiny13 in https://github.com/FastLED/FastLED/blob/master/platforms/avr/fastpin_avr.h - you would have to add those, as the attiny13 isn't a supported configuration yet.

  2. changed the title [-]unable to compile with MicroCore for attiny13[/-] [+]Need ATTiny13 support[/+] on Jan 20, 2019
  3. Sagar73594 commented on Aug 10, 2022

    @Sagar73594

    It's been almost 2 years, Still no support? @focalintent

  4. marmilicious commented on Aug 10, 2022

    @marmilicious
    Contributor
  5. JulianGmp commented on Jan 22, 2023

    @JulianGmp

    For those coming across this in the future, I tried porting over FastLED to the attiny, but I would say it's not really possible.

    You can find some discussions on the FastLED reddit, but the tldr is:

    • the ATtiny13/ATtiny13A's micro core doesn't provide a ms counter, which FastLED (from my understanding) relies on.
    • The chip is also limited to 1024 bytes of program memory and 64 bytes of RAM. FastLED already gives out a warning to ATtiny25 users, that the 2048 bytes storage is likely not enough.

    For these reasons, I would say using FastLED on the ATtiny13 or ATtiny13A is not possible.


    For those who happen to have WS2812 LEDs: you may want to take a look at Tiny WS2812 (platformio, github).

    I managed to get that one running and did a simple color cycle for 6 LEDs. This already consumed 480 bytes of the program memory though. Adding any sort of complex functionality like HSV to RGB conversion will exceed the 1024 bytes limitation.
    Usable for very, very simple applications, but if you're shopping for micro controllers, I'd say go for one with more storage, I'll probably buy some ATtiny85's.

    Update: I am using a simple lookup table for LED values and ran into a problem where the table itself was loaded into the (very limited) RAM. If you run into this (on the ATtiny85 or ATtiny13, or any AVR chip I think), consider reading the values from the program memory directly. That way you can use up the majority of your program memory while keeping your RAM usage very low. I put 480 RGB values (1440 bytes) onto an ATtiny85 with this.

  6. added
    platform: avr
    area: core
    status: stale
    status: triage
    on Apr 16, 2026
  7. zackees commented on Jun 3, 2026

    @zackees
    Member

    Tracked in FastLED/fbuild#389 for AVR / megaAVR / ATtiny fbuild platform/build support validation.

    That fbuild issue is scoped to board metadata, toolchain/backend support, and FastLED smoke-build evidence. Any remaining FastLED source/platform-code blocker should stay linked from both sides.

  8. zackees commented on Jun 3, 2026

    @zackees
    Member

    fbuild build-system status update (tracker: FastLED/fbuild#389)

    Build-tool side is split:

    • Board metadata attiny13.json / attiny13a.json present and declare core = MicroCore.
    • FastLED platform support: __AVR_ATtiny13__ is already handled in src/platforms/avr/attiny/pins/fastpin_attiny.h.
    • fbuild gap: MicroCore (MCUdude/MicroCore) is not yet wired into crates/fbuild-packages/assets/avr_frameworks.json, so fbuild's AVR orchestrator currently fails at framework-resolve for ATtiny13. Tracked by tripwire test test_microcore_gap_tracked and tracker fixture tests/platform/attiny13/ (added in test(avr): tracker fixtures + framework gap tripwires for #389 fbuild#397).

    Once MicroCore is registered, the fixture flips from "tracker" to "real FastLED smoke build" and the static-assert / invalid-pin issue can be debugged on a working pipeline.

  9. zackees commented on Aug 1, 2026

    @zackees
    Member

    Closing as not planned — the ATtiny13 is too small for FastLED, and that isn't something a port can fix.

    The specific error you hit is gone. Pin definitions for __AVR_ATtiny13__ now exist at src/platforms/avr/attiny/pins/fastpin_attiny.h:101 (MAX_PIN 5, PB0-PB5), so static_assert(validpin(), "Invalid pin specified") is no longer what stops you. Two other things are.

    1. It still doesn't assemble. There's a comment sitting right above those pin definitions recording a persistent failure:

    Error: illegal opcode or for mcu avr25
    

    The ATtiny13 is avr25, an instruction-set subset that doesn't include opcodes FastLED's generated code relies on. That's a toolchain-level mismatch, not a missing header.

    2. The arithmetic doesn't work, and this is the real answer. @JulianGmp's 2023 analysis is correct and worth restating:

    part flash RAM
    ATtiny13/13A 1024 B 64 B
    ATtiny25 2048 B 128 B
    ATtiny85 8192 B 512 B

    FastLED already emits this on the ATtiny25 (fastpin_attiny.h:54):

    #pragma message "ATtiny25 has very limited storage. This library could use up to more than 100% of its flash size"

    The ATtiny13 has half the flash of the part we already warn is too small, and half its RAM. There's no version of "add support" that makes a library which overflows 2 KB fit in 1 KB. On top of that, MicroCore provides no millisecond counter, which FastLED's timing depends on.

    If you're on an ATtiny13 and want WS2812 output, @JulianGmp's recommendation stands — TinyWS2812 fits, at about 480 B for a simple color cycle. His follow-up note is worth heeding too: keep lookup tables in PROGMEM rather than RAM, or 64 B disappears immediately. If you have room to change parts, the ATtiny85 is the smallest one where FastLED is genuinely comfortable.

    @Sagar73594 — sorry your 2022 question went unanswered for so long, and thank you @marmilicious for letting people know about Dan.

    For completeness on the build-tool side: fbuild has attiny13.json / attiny13a.json board metadata, but MicroCore isn't registered in its AVR framework list (tracked by test_microcore_gap_tracked and the tests/platform/attiny13/ fixture). Even with that wired up, the flash and ISA problems above remain, which is why this is being closed rather than left open pending it.

  10. moved this from Triage to Done in FastLED Trackeron Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    MCUsarea: coreplatform: avrstatus: stalestatus: triage

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions