Skip to content

ATmega1284 alternative pin mappings #1253

Open

Description

@Delph

Another library I use uses an older version of fastpin from here. I recently had some issues migrating from a 382 to a 1284 as I chose the Bobuino pin mapping so I didn't have to remap pins to find that the copy of fastpin didn't support these multiple pin mappings. On checking, I found the same here, and I just know it'll bite me one day.

I've added support for the Bobuino pinout to this other library locally, but since the #defines for it will be core/board vendor specific, I wanted to check what the "right" way, or whether it'd even be accepted, before making PRs.

Activity

  1. kriegsman commented on Jul 29, 2021

    @kriegsman
    Member

    Thanks for opening the issue here, and for raising the questions about how to handle this.
    What do the #defines for the pin mappings for the Bobuino look like?

  2. Delph commented on Jul 29, 2021

    @Delph
    Author

    The version of FastPin the other library uses seems a little older, I had simply added as this for my own use;

    #ifdef BOBUINO_PINOUT
    _DEFPIN_AVR( 4, (1<<0), B); _DEFPIN_AVR( 5, (1<<1), B); _DEFPIN_AVR( 6, (1<<2), B); _DEFPIN_AVR( 7, (1<<3), B);
    _DEFPIN_AVR(10, (1<<4), B); _DEFPIN_AVR(11, (1<<5), B); _DEFPIN_AVR(12, (1<<6), B); _DEFPIN_AVR(13, (1<<7), B);
    
    _DEFPIN_AVR( 0, (1<<0), D); _DEFPIN_AVR( 1, (1<<1), D); _DEFPIN_AVR( 2, (1<<2), D); _DEFPIN_AVR( 3, (1<<3), D);
    _DEFPIN_AVR(30, (1<<4), D); _DEFPIN_AVR( 8, (1<<5), D); _DEFPIN_AVR( 9, (1<<6), D); _DEFPIN_AVR(31, (1<<7), D);
    
    _DEFPIN_AVR(22, (1<<0), C); _DEFPIN_AVR(23, (1<<1), C); _DEFPIN_AVR(24, (1<<2), C); _DEFPIN_AVR(25, (1<<3), C);
    _DEFPIN_AVR(26, (1<<4), C); _DEFPIN_AVR(27, (1<<5), C); _DEFPIN_AVR(28, (1<<6), C); _DEFPIN_AVR(29, (1<<7), C);
    
    _DEFPIN_AVR(21, (1<<0), A); _DEFPIN_AVR(20, (1<<1), A); _DEFPIN_AVR(19, (1<<2), A); _DEFPIN_AVR(18, (1<<3), A);
    _DEFPIN_AVR(17, (1<<4), A); _DEFPIN_AVR(16, (1<<5), A); _DEFPIN_AVR(15, (1<<6), A); _DEFPIN_AVR(14, (1<<7), A);
    #else
    _DEFPIN_AVR( 0, (1<<0), B); _DEFPIN_AVR( 1, (1<<1), B); _DEFPIN_AVR( 2, (1<<2), B); _DEFPIN_AVR( 3, (1<<3), B);
    _DEFPIN_AVR( 4, (1<<4), B); _DEFPIN_AVR( 5, (1<<5), B); _DEFPIN_AVR( 6, (1<<6), B); _DEFPIN_AVR( 7, (1<<7), B);
    
    _DEFPIN_AVR( 8, (1<<0), D); _DEFPIN_AVR( 9, (1<<1), D); _DEFPIN_AVR(10, (1<<2), D); _DEFPIN_AVR(11, (1<<3), D);
    _DEFPIN_AVR(12, (1<<4), D); _DEFPIN_AVR(13, (1<<5), D); _DEFPIN_AVR(14, (1<<6), D); _DEFPIN_AVR(15, (1<<7), D);
    
    _DEFPIN_AVR(16, (1<<0), C); _DEFPIN_AVR(17, (1<<1), C); _DEFPIN_AVR(18, (1<<2), C); _DEFPIN_AVR(19, (1<<3), C);
    _DEFPIN_AVR(20, (1<<4), C); _DEFPIN_AVR(21, (1<<5), C); _DEFPIN_AVR(22, (1<<6), C); _DEFPIN_AVR(23, (1<<7), C);
    
    _DEFPIN_AVR(24, (1<<0), A); _DEFPIN_AVR(25, (1<<1), A); _DEFPIN_AVR(26, (1<<2), A); _DEFPIN_AVR(27, (1<<3), A);
    _DEFPIN_AVR(28, (1<<4), A); _DEFPIN_AVR(29, (1<<5), A); _DEFPIN_AVR(30, (1<<6), A); _DEFPIN_AVR(31, (1<<7), A);
    #endif

    Pinout diagrams are available on MCUdude's MightyCore repo, the other two #defines used are STANDARD_PINOUT and SANGUINO_PINOUT. https://github.com/MCUdude/MightyCore/tree/master/avr/variants

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

  5. zackees commented on Jun 3, 2026

    @zackees
    Member

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

    Build-tool side is healthy:

    • Board metadata 1284p16m.json, ATmega1284P.json, sanguino_atmega1284p.json present.
    • Both arduino (ArduinoCore-avr) and MiniCore (MCUdude/MiniCore v2.2.2) frameworks registered in avr_frameworks.json.
    • Tracker fixture tests/platform/atmega1284/ added in test(avr): tracker fixtures + framework gap tripwires for #389 fbuild#397.
    • FastLED has ATmega1284 / ATmega1284P pin support in src/platforms/avr/atmega/common/fastpin_legacy_other.h.

    The Bobuino-pinout request is FastLED-side: the FastPin variant selector needs to dispatch on a variant-specific macro (e.g. BOBUINO_PINOUT) and choose an alternative _FL_DEFPIN table. Optionally a separate fbuild board JSON could pin variant = bobuino so users don't have to wire the macro manually.

  6. removed
    status: stale
    on Sep 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

    area: coreplatform: avrstatus: triage

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions