Skip to content

Support ATtiny412 or ATtiny1614, aka Mega Tiny #973

Closed

Description

@KIdon-Park

I'd like to use FaseLED on the attiny412(or 1614). But I cannot work on that.
Anyone success FastLED running on the Megatiny?
Thanks

Activity

  1. changed the title [-]Support Mega Tiny?[/-] [+]Support ATtiny412 or ATtiny1614, aka Mega Tiny[/+] on Feb 18, 2020
  2. kriegsman commented on Feb 18, 2020

    @kriegsman
    Member

    Thanks for opening this issue. Probably it's a small piece of work if you'd like to try adding the port/pin mappings yourself. If that's not something you're familiar with, perhaps someone else can help out here.

  3. KIdon-Park commented on Feb 21, 2020

    @KIdon-Park
    Author

    Thank you for the advice.
    I'll try pin-mapping myself. But for me as a beginner, it seems like a difficult task to spend a lot of time.
    It would be very grateful if someone could help.

  4. added
    type: feature
    platform: avr
    area: core
    status: stale
    status: triage
    on Apr 16, 2026
  5. 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.

  6. zackees commented on Jun 3, 2026

    @zackees
    Member

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

    Build-tool side is healthy:

    • Board metadata present for both: ATtiny412.json, ATtiny1614.json.
    • megatinycore (SpenceKonde/megaTinyCore v2.6.11) registered in avr_frameworks.json.
    • Smoke fixtures tests/platform/ATtiny1604/ and tests/platform/ATtiny1616/ cover this class.
    • FastLED has pin maps for the full megaTinyCore family (ATtiny412/414/416/417/814/816/817/1614/etc.) in src/platforms/avr/attiny/pins/fastpin_attiny.h.

    This should now work. If you hit a concrete error, please open a fresh issue with the verbose compiler output — the build environment that was broken in 2020 is no longer the blocker.

  7. zackees commented on Aug 2, 2026

    @zackees
    Member

    Closing — but with a correction, because the answer differs for the two chips you named.

    ATtiny1614: supported ✅

    megaTinyCore defines __AVR_ATtinyxy4__ for the 14-pin parts, which fastpin_attiny.h:218 matches, giving a 12-pin map (MAX_PIN 12) plus hardware SPI on PA1/PA3. is_avr.h also flags the whole tinyAVR 0/1/2-series as FL_IS_AVR_ATTINY_MODERN, which selects the VPORT-register _FL_DEFPIN path and the no-MUL shift-and-add scale8 (the ATtiny parts have no hardware multiplier).

    Verified by building, not by reading:

    bash compile attiny1616 --examples Blink   →  flash 4885 B, ram 257 B   ✅
    bash compile attiny1604 --examples Blink   →  flash 4839 B, ram 225 B   ✅
    

    Both are in CI (ci/boards.py) on framework-arduino-megaavr-megatinycore. The ATtiny1614 shares the xy4 pin map with the 1604, so it is on the same supported path.

    ATtiny412: not supported, and not planned ❌

    Here I have to correct the earlier reply on this thread. It stated FastLED "has pin maps for the full megaTinyCore family (ATtiny412/414/416/417/…)". It does not. All four of those land in the arm at fastpin_attiny.h:215, which emits only:

    #pragma message "ATtiny2YZ or ATtiny4YZ have very limited storage. This library could use up to more than 100% of its flash size"

    — and defines no pins at all, no MAX_PIN, no HAS_HARDWARE_PIN_SUPPORT. FastPin<> is left unspecialised, so a build fails to compile rather than silently overflowing at link time.

    That is deliberate and it is the right call. The measurement above is the reason: a minimal Blink is 4885 bytes of flash on this family. The ATtiny412 has 4096 bytes total. FastLED does not fit before you write a single line of your own sketch — and its 256 bytes of SRAM would hold about 85 pixels' worth of CRGB with nothing left for anything else. This matches the reasoning that closed #581 for the ATtiny13.

    So the honest answer to your original question — "anyone success FastLED running on the Megatiny?" — is: yes on the 8K/16K parts, no on the 2K/4K parts, and the 4K limit is arithmetic rather than missing work. @kriegsman's 2020 suggestion that it was "a small piece of work" to add pin mappings was right for the 1614 and cannot be made true for the 412.

    Fixed along the way

    The misreading above was not carelessness — the file invited it. ATtiny404 and ATtiny416 were each listed twice in the #elif chain: once in the limited-storage arm, and again in the xy4/xy6 pin-map arms below. Since the chain hits the limited-storage arm first, those second listings were unreachable dead code that made the parts look supported.

    Cleaned up in #3830 (merged): the dead listings are gone and the ordering constraint is now documented at the arm itself. Proven inert — firmware.elf for both attiny1616 and attiny1604 is byte-identical to the build from unmodified master.

    If you want to use a megaTinyCore part

    Pick an 8KB or larger one: ATtiny1614/1616/1617, 814/816/817, 3216/3217. The 1614 you asked about is fine. Flash headroom after FastLED is ~3KB on an 8K part and ~11KB on a 16K part.

    Thanks for the report and for the patience — six years is a long wait for an answer, and the answer turned out to be worth stating precisely.

  8. moved this from Triage to Done in FastLED Trackeron Aug 2, 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: triagetype: feature

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions