ATTiny13 compile issues

I have started playing with ATtiny controllers.

I am busy on a project that will control an RBG LED ring with an ATtiny13. When I tried to compile the code I got

Arduino: 1.8.8 (Linux), Board: “ATtiny85, Yes (Normal Arduino Serial/USB Upload), 8MHz Internal Oscillator, Millis and Tone Available, Bin, Hex, Dec Supported, Better Or Equal 1.666% Error (Default), LTO Enabled, 2.7v, Default, Default, Default”

Build options changed, rebuilding all
In file included from /home/abasel/Dropbox/Transfer/WorkingOn/Ballerina/DemoReel100/DemoReel100.ino:1:0:
/home/abasel/Arduino/libraries/FastLED/FastLED.h:14:21: note: #pragma message: FastLED version 3.002.006

pragma message “FastLED version 3.002.006”

^
In file included from /home/abasel/Arduino/libraries/FastLED/FastLED.h:65:0,
from /home/abasel/Dropbox/Transfer/WorkingOn/Ballerina/DemoReel100/DemoReel100.ino:1:
/home/abasel/Arduino/libraries/FastLED/fastspi.h:110:23: note: #pragma message: No hardware SPI pins defined. All SPI access will default to bitbanged output

pragma message “No hardware SPI pins defined. All SPI access will default to bitbanged output”

^
/tmp/cc4i0wat.ltrans0.ltrans.o: In function ClocklessController<(unsigned char)2, 3, 4, 3, (EOrder)66, 0, false, 10>::showPixels(PixelController<(EOrder)66, 1, 4294967295ul>&)': /home/abasel/Arduino/libraries/FastLED/platforms/avr/clockless_trinket.h:144: undefined reference to millis_timer_millis’
/home/abasel/Arduino/libraries/FastLED/platforms/avr/clockless_trinket.h:144: undefined reference to millis_timer_millis' /home/abasel/Arduino/libraries/FastLED/platforms/avr/clockless_trinket.h:144: undefined reference to millis_timer_millis’
/home/abasel/Arduino/libraries/FastLED/platforms/avr/clockless_trinket.h:144: undefined reference to millis_timer_millis' /home/abasel/Arduino/libraries/FastLED/platforms/avr/clockless_trinket.h:144: undefined reference to millis_timer_millis’
/tmp/cc4i0wat.ltrans0.ltrans.o:/home/abasel/Arduino/libraries/FastLED/platforms/avr/clockless_trinket.h:144: more undefined references to `millis_timer_millis’ follow
collect2: error: ld returned 1 exit status
exit status 1
Error compiling for board ATtiny85.

This report would have more information with
“Show verbose output during compilation”
option enabled in File → Preferences.

I wondered if it might be something to do with the capability of the ATtiny 13 and so I Tried using a ATtiny85. With one library it compiled successively but with another one (the one that also has the option for the ATtiny13 option) it returned

Arduino: 1.8.8 (Linux), Board: “ATtiny13, ATtiny13a, No (ISP Programmer Upload), 9.6MHz Internal Oscillator, Millis Available, No Tone, Better Or Equal 1.666% Error (Default), Bin, Hex, Dec Supported, Half Duplex, Read+Write, LTO Enabled, 2.7v, Default, Default”

Build options changed, rebuilding all
In file included from /home/abasel/Dropbox/Transfer/WorkingOn/Ballerina/DemoReel100/DemoReel100.ino:1:0:
/home/abasel/Arduino/libraries/FastLED/FastLED.h:14:21: note: #pragma message: FastLED version 3.002.006

pragma message “FastLED version 3.002.006”

^
In file included from /home/abasel/Arduino/libraries/FastLED/FastLED.h:65:0,
from /home/abasel/Dropbox/Transfer/WorkingOn/Ballerina/DemoReel100/DemoReel100.ino:1:
/home/abasel/Arduino/libraries/FastLED/fastspi.h:110:23: note: #pragma message: No hardware SPI pins defined. All SPI access will default to bitbanged output

pragma message “No hardware SPI pins defined. All SPI access will default to bitbanged output”

^
In file included from /home/abasel/Arduino/libraries/FastLED/FastLED.h:48:0,
from /home/abasel/Dropbox/Transfer/WorkingOn/Ballerina/DemoReel100/DemoReel100.ino:1:
/home/abasel/Arduino/libraries/FastLED/fastpin.h: In instantiation of ‘class FastPin<2u>’:
/home/abasel/Arduino/libraries/FastLED/platforms/avr/clockless_trinket.h:96:49: required from ‘class ClocklessController<2u, 3, 3, 6, (EOrder)66u, 0, false, 10>’
/home/abasel/Arduino/libraries/FastLED/chipsets.h:542:7: required from ‘class WS2811Controller800Khz<2u, (EOrder)66u>’
/home/abasel/Arduino/libraries/FastLED/FastLED.h:111:52: required from ‘class WS2811<2u, (EOrder)66u>’
/home/abasel/Arduino/libraries/FastLED/FastLED.h:302:39: required from ‘static CLEDController& CFastLED::addLeds(CRGB*, int, int) [with CHIPSET = WS2811; unsigned char DATA_PIN = 2u; EOrder RGB_ORDER = (EOrder)66u]’
/home/abasel/Dropbox/Transfer/WorkingOn/Ballerina/DemoReel100/DemoReel100.ino:32:64: required from here
/home/abasel/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.

This report would have more information with
“Show verbose output during compilation”
option enabled in File → Preferences.

The library this I am using for the ATtiny13 and failing ATtiny85 is from https://raw.githubusercontent.com/sleemanj/optiboot/master/dists/package_gogo_diy_attiny_index.json.

Initially I thought that the ATtiny could not support FASTLED but because it compiled with one library and not the other (for the ATtiny 85) I thought that it might be something else but I am not sure what.

  1. Did you install attiny13 core? Core13 download | SourceForge.net
  2. FastLED library is pretty big and will not fit in Attiny13.

I have tried a couple, the latest being http://forum.arduino.cc/index.php?topic=426153. When I tied your link above I got an error saying invalid library and no headers files in (,h).

But all good, if the 13 is too small I will use the 85 which I can get to compile with FAST LED.

Many thanks

I think you were smart to choose the ATtiny85 for this project. However, since you might use the ATtiny13 for a different project, I'd like to recommend MicroCore:

MicroCore is actually based on the project that alesam linked to, but it has has a lot of updates to improve it and make it easier to use. Unlike Core13, MicroCore is actively maintained.

Thanks for the pointers.

I have now run out of memory on the ATtiny85. If I remove most of the tone commands I can compile.

My question now is it possible to somehow optimise the attached code to reduce the size of the program? I tried combining the delay statements but that did not appear to help. Machine code is a bit too challenging for me at present but I was wondering if there was something easier that I could look at.

I was happy to use a simpler LED routine but the music seems to take most of the space. I tried shorting the melody but I needed to make it too short too compile; i.e. would like it longer than that.

WaltzNo2.zip (3.5 KB)