Skip to content

ATTiny861, ATTiny261 and ATTiny461 support #1356

Closed

Description

@IliTheButterfly

Hi, I'm trying to use my ATTiny861 to control a strip of WS2812 LEDs.

I'm using version 3.5.0. But also tried 3.4.0 and 3.1.3.
This is my curent config for the ATTiny
ATTiny config

I'm trying to compile the FastLED Blink example and I get this error:

In file included from C:\Users\...\Documents\Arduino\libraries\FastLED\src/FastLED.h:50:0,
                 from C:\Users\...\AppData\Local\Temp\arduino_modified_sketch_335833\Blink.ino:1:
C:\Users\...\Documents\Arduino\libraries\FastLED\src/fastpin.h: In instantiation of 'class FastPin<7>':
C:\Users\...\Documents\Arduino\libraries\FastLED\src/platforms/avr/clockless_trinket.h:107:49:   required from 'class ClocklessController<7, 2, 5, 3, (EOrder)66, 0, false, 10>'
C:\Users\...\Documents\Arduino\libraries\FastLED\src/chipsets.h:474:7:   required from 'class WS2812Controller800Khz<7, (EOrder)66>'
C:\Users\...\Documents\Arduino\libraries\FastLED\src/FastLED.h:105:52:   required from 'class WS2812<7, (EOrder)66>'
C:\Users\...\Documents\Arduino\libraries\FastLED\src/FastLED.h:304:39:   required from 'static CLEDController& CFastLED::addLeds(CRGB*, int, int) [with CHIPSET = WS2812; unsigned char DATA_PIN = 7; EOrder RGB_ORDER = (EOrder)66]'
C:\Users\...\AppData\Local\Temp\arduino_modified_sketch_335833\Blink.ino:30:59:   required from here
C:\Users\...\Documents\Arduino\libraries\FastLED\src/fastpin.h:210:2: error: static assertion failed: Invalid pin specified
  static_assert(validpin(), "Invalid pin specified");

I explored the source code and found that there seems to be an empty implementation of FastPin<PIN> in fastpin.h line 207?

template<uint8_t PIN> class FastPin {
	constexpr static bool validpin() { return false; }

	static_assert(validpin(), "Invalid pin specified");
// ...
};

To me it looks like this bit of code (in the case where FASTLED_FORCE_SOFTWARE_PINS is not defined) will always crash.

I also at some point got some assembly errors when I had forgotten to setup the LEDControllers. But I think that's a separate issue. Just wanted to mention it for the record.

I've seen that people has made the library work for ATTiny85, but I'm having trouble finding instances of using it on ATTinyX61.

Activity

  1. changed the title [-]ATTiny861 invalid pin specified (probably also applies to ATTiny261 and ATTiny461)[/-] [+]ATTiny861, ATTiny261 and ATTiny461 support[/+] on Jan 23, 2022
  2. IliTheButterfly commented on Jan 23, 2022

    @IliTheButterfly
    Author

    This is an update, I have looked at the porting file and am now currently adding support for ATtinyX61

  3. IliTheButterfly commented on Jan 24, 2022

    @IliTheButterfly
    Author

    Here is my fork for the project https://github.com/Civelier/FastLED.

    I tried compiling it for the ATtiny861 but I get assembly errors:

    ccirXX43.s*: Assembler messages
     
    
    Error linking for board ATtiny261/461/861(a)
    ccirXX43.s*:1279: illegal opcode or for mcu avr25
     
    ccirXX43.s*:1341: illegal opcode or for mcu avr25
     
    ccirXX43.s*:1381: illegal opcode or for mcu avr25
     
    ccirXX43.s*:1431: illegal opcode or for mcu avr25
     
    ccirXX43.s*:1462: illegal opcode or for mcu avr25
     
    ccirXX43.s*:1506: illegal opcode or for mcu avr25
     
    ccirXX43.s*:1546: illegal opcode or for mcu avr25
     
    ccirXX43.s*:1591: illegal opcode or for mcu avr25
     
    ccirXX43.s*:1628: illegal opcode or for mcu avr25
     
    ccirXX43.s*:1669: illegal opcode or for mcu avr25
     
    ccirXX43.s*:8754: illegal opcode or for mcu avr25
     
    ccirXX43.s*:9126: illegal opcode or for mcu avr25
     
    ccirXX43.s*:9147: illegal opcode or for mcu avr25
     
    ccirXX43.s*:9168: illegal opcode or for mcu avr25
     
    ccirXX43.s*:9199: illegal opcode or for mcu avr25
     
    ccirXX43.s*:9236: illegal opcode or for mcu avr25
     
    ccirXX43.s*:9261: illegal opcode or for mcu avr25
     
    ccirXX43.s*:9282: illegal opcode or for mcu avr25
     
    ccirXX43.s*:9303: illegal opcode or for mcu avr25
     
    ccirXX43.s*:9357: illegal opcode or for mcu avr25
     
    ccirXX43.s*:9439: illegal opcode or for mcu avr25
     
    lto-wrapper.exe*: fatal error: C:\Users\civel\AppData\Local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7\bin\avr-gcc returned 1 exit status
       compilation terminated
     
    ld.exe: error: lto-wrapper failed
    

    This is what I meant with the assembly errors.

    My guess is that I forgot some defines somewhere that allows it to properly work.
    It's my first time porting this library.

  4. IliTheButterfly commented on Jan 24, 2022

    @IliTheButterfly
    Author

    So I made it build, but unfortunately, I can only run my ATtiny at 4MHz which is not enough to control the leds. I will leave this issue open for a few days for people to find a solution.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions