Skip to content

ATtiny85 support missing (Digispark) #71

@sebastiannielsen

Description

@sebastiannielsen

Description

Describe your problem.
When trying to add Digispark ATtiny85 support, the code doesn't compile.

Steps To Reproduce Problem

Add ATtiny85 support by modifying boards definition (altsoftserial_boards.h):

#elif defined(__AVR_ATtiny85__)
 #define ALTSS_USE_TIMER2
 #define INPUT_CAPTURE_PIN		 2 // receive
 #define OUTPUT_COMPARE_A_PIN		 3 // transmit
 #define OUTPUT_COMPARE_B_PIN		 0 // unusable PWM
 #define OUTPUT_COMPARE_C_PIN		 1 // unusable PWM
 #define OUTPUT_COMPARE_D_PIN		 4 // unusable PWM

Have tried TIMER0, TIMER1, TIMER2, TIMER3 but none of them work, they give different error messages in console tough.

Hardware & Software

Board ATtiny85 Digispark board
20250102_221457
Shields / modules used: none
Arduino IDE version 2.3.4
Teensyduino version (if using Teensy)
Version info & package name (from Tools > Boards > Board Manager) - Digistump 1.6.7
Operating system & version: Windows 11
Any other software or hardware?

Arduino Sketch

// Change the code below by your sketch (please try to give the smallest code which demonstrates the problem)
#include <Arduino.h>

#include <AltSoftSerial.h>

AltSoftSerial altSerial;

void setup() {
  altSerial.begin(9600);
  altSerial.println("Hello World");
}

void loop() {
    altSerial.print("test");
}

Errors or Incorrect Output

If you see any errors or incorrect output, please show it here. Please use copy & paste to give an exact copy of the message. Details matter, so please show (not merely describe) the actual message or error exactly as it appears.

c:\Users\Sebastian\Documents\Arduino\libraries\AltSoftSerial\AltSoftSerial.cpp: In static member function 'static void AltSoftSerial::init(uint32_t)':
c:\Users\Sebastian\Documents\Arduino\libraries\AltSoftSerial\AltSoftSerial.cpp:74:27: error: 'CONFIG_TIMER_NOPRESCALE' was not declared in this scope
   CONFIG_TIMER_NOPRESCALE();
                           ^
c:\Users\Sebastian\Documents\Arduino\libraries\AltSoftSerial\AltSoftSerial.cpp:79:28: error: 'CONFIG_TIMER_PRESCALE_8' was not declared in this scope
    CONFIG_TIMER_PRESCALE_8();
                            ^
c:\Users\Sebastian\Documents\Arduino\libraries\AltSoftSerial\AltSoftSerial.cpp:113:27: error: 'ENABLE_INT_INPUT_CAPTURE' was not declared in this scope
  ENABLE_INT_INPUT_CAPTURE();
                           ^
c:\Users\Sebastian\Documents\Arduino\libraries\AltSoftSerial\AltSoftSerial.cpp: In static member function 'static void AltSoftSerial::end()':
c:\Users\Sebastian\Documents\Arduino\libraries\AltSoftSerial\AltSoftSerial.cpp:118:24: error: 'DISABLE_INT_COMPARE_B' was not declared in this scope
  DISABLE_INT_COMPARE_B();
                        ^
c:\Users\Sebastian\Documents\Arduino\libraries\AltSoftSerial\AltSoftSerial.cpp:119:28: error: 'DISABLE_INT_INPUT_CAPTURE' was not declared in this scope
  DISABLE_INT_INPUT_CAPTURE();
                            ^
c:\Users\Sebastian\Documents\Arduino\libraries\AltSoftSerial\AltSoftSerial.cpp:122:24: error: 'DISABLE_INT_COMPARE_A' was not declared in this scope
  DISABLE_INT_COMPARE_A();
                        ^
c:\Users\Sebastian\Documents\Arduino\libraries\AltSoftSerial\AltSoftSerial.cpp: In static member function 'static void AltSoftSerial::writeByte(uint8_t)':
c:\Users\Sebastian\Documents\Arduino\libraries\AltSoftSerial\AltSoftSerial.cpp:147:24: error: 'ENABLE_INT_COMPARE_A' was not declared in this scope
   ENABLE_INT_COMPARE_A();
                        ^
c:\Users\Sebastian\Documents\Arduino\libraries\AltSoftSerial\AltSoftSerial.cpp:148:22: error: 'CONFIG_MATCH_CLEAR' was not declared in this scope
   CONFIG_MATCH_CLEAR();
                      ^
c:\Users\Sebastian\Documents\Arduino\libraries\AltSoftSerial\AltSoftSerial.cpp:149:33: error: 'GET_TIMER_COUNT' was not declared in this scope
   SET_COMPARE_A(GET_TIMER_COUNT() + 16);
                                 ^
c:\Users\Sebastian\Documents\Arduino\libraries\AltSoftSerial\AltSoftSerial.cpp:149:39: error: 'SET_COMPARE_A' was not declared in this scope
   SET_COMPARE_A(GET_TIMER_COUNT() + 16);
                                       ^
c:\Users\Sebastian\Documents\Arduino\libraries\AltSoftSerial\AltSoftSerial.cpp: In function 'void COMPARE_A_INTERRUPT()':
c:\Users\Sebastian\Documents\Arduino\libraries\AltSoftSerial\AltSoftSerial.cpp:162:25: error: 'GET_COMPARE_A' was not declared in this scope
  target = GET_COMPARE_A();
                         ^
c:\Users\Sebastian\Documents\Arduino\libraries\AltSoftSerial\AltSoftSerial.cpp:173:22: error: 'CONFIG_MATCH_SET' was not declared in this scope
     CONFIG_MATCH_SET();
                      ^
c:\Users\Sebastian\Documents\Arduino\libraries\AltSoftSerial\AltSoftSerial.cpp:175:24: error: 'CONFIG_MATCH_CLEAR' was not declared in this scope
     CONFIG_MATCH_CLEAR();
                        ^
c:\Users\Sebastian\Documents\Arduino\libraries\AltSoftSerial\AltSoftSerial.cpp:177:24: error: 'SET_COMPARE_A' was not declared in this scope
    SET_COMPARE_A(target);
                        ^
c:\Users\Sebastian\Documents\Arduino\libraries\AltSoftSerial\AltSoftSerial.cpp:191:40: error: 'SET_COMPARE_A' was not declared in this scope
    SET_COMPARE_A(target + ticks_per_bit);
                                        ^
c:\Users\Sebastian\Documents\Arduino\libraries\AltSoftSerial\AltSoftSerial.cpp:194:24: error: 'CONFIG_MATCH_NORMAL' was not declared in this scope
    CONFIG_MATCH_NORMAL();
                        ^
c:\Users\Sebastian\Documents\Arduino\libraries\AltSoftSerial\AltSoftSerial.cpp:195:26: error: 'DISABLE_INT_COMPARE_A' was not declared in this scope
    DISABLE_INT_COMPARE_A();
                          ^
c:\Users\Sebastian\Documents\Arduino\libraries\AltSoftSerial\AltSoftSerial.cpp:202:22: error: 'CONFIG_MATCH_CLEAR' was not declared in this scope
   CONFIG_MATCH_CLEAR();
                      ^
c:\Users\Sebastian\Documents\Arduino\libraries\AltSoftSerial\AltSoftSerial.cpp:204:40: error: 'SET_COMPARE_A' was not declared in this scope
    SET_COMPARE_A(target + ticks_per_bit);
                                        ^
c:\Users\Sebastian\Documents\Arduino\libraries\AltSoftSerial\AltSoftSerial.cpp:206:34: error: 'GET_TIMER_COUNT' was not declared in this scope
    SET_COMPARE_A(GET_TIMER_COUNT() + 16);
                                  ^
c:\Users\Sebastian\Documents\Arduino\libraries\AltSoftSerial\AltSoftSerial.cpp:206:40: error: 'SET_COMPARE_A' was not declared in this scope
    SET_COMPARE_A(GET_TIMER_COUNT() + 16);
                                        ^
c:\Users\Sebastian\Documents\Arduino\libraries\AltSoftSerial\AltSoftSerial.cpp: In function 'void CAPTURE_INTERRUPT()':
c:\Users\Sebastian\Documents\Arduino\libraries\AltSoftSerial\AltSoftSerial.cpp:228:30: error: 'GET_INPUT_CAPTURE' was not declared in this scope
  capture = GET_INPUT_CAPTURE();
                              ^
c:\Users\Sebastian\Documents\Arduino\libraries\AltSoftSerial\AltSoftSerial.cpp:231:31: error: 'CONFIG_CAPTURE_FALLING_EDGE' was not declared in this scope
   CONFIG_CAPTURE_FALLING_EDGE();
                               ^
c:\Users\Sebastian\Documents\Arduino\libraries\AltSoftSerial\AltSoftSerial.cpp:234:30: error: 'CONFIG_CAPTURE_RISING_EDGE' was not declared in this scope
   CONFIG_CAPTURE_RISING_EDGE();
                              ^
c:\Users\Sebastian\Documents\Arduino\libraries\AltSoftSerial\AltSoftSerial.cpp:241:21: error: 'SET_COMPARE_B' was not declared in this scope
    SET_COMPARE_B(end);
                     ^
c:\Users\Sebastian\Documents\Arduino\libraries\AltSoftSerial\AltSoftSerial.cpp:242:25: error: 'ENABLE_INT_COMPARE_B' was not declared in this scope
    ENABLE_INT_COMPARE_B();
                         ^
c:\Users\Sebastian\Documents\Arduino\libraries\AltSoftSerial\AltSoftSerial.cpp:256:27: error: 'DISABLE_INT_COMPARE_B' was not declared in this scope
     DISABLE_INT_COMPARE_B();
                           ^
c:\Users\Sebastian\Documents\Arduino\libraries\AltSoftSerial\AltSoftSerial.cpp:263:33: error: 'CONFIG_CAPTURE_FALLING_EDGE' was not declared in this scope
     CONFIG_CAPTURE_FALLING_EDGE();
                                 ^
c:\Users\Sebastian\Documents\Arduino\libraries\AltSoftSerial\AltSoftSerial.cpp: In function 'void COMPARE_B_INTERRUPT()':
c:\Users\Sebastian\Documents\Arduino\libraries\AltSoftSerial\AltSoftSerial.cpp:279:24: error: 'DISABLE_INT_COMPARE_B' was not declared in this scope
  DISABLE_INT_COMPARE_B();
                        ^
c:\Users\Sebastian\Documents\Arduino\libraries\AltSoftSerial\AltSoftSerial.cpp:280:30: error: 'CONFIG_CAPTURE_FALLING_EDGE' was not declared in this scope
  CONFIG_CAPTURE_FALLING_EDGE();
                              ^

exit status 1

Compilation error: exit status 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions