Friend asked me to find problem with compilation for his DigiSpark AT Tiny85 board. We are trying to compile sketch from here: https://forum.arduino.cc/index.php?topic=314773.0
But with no luck - there is something mixed in headers or configuration and I do not know what exactly.
This ISR does not compile:
ISR(TIMER1_OVF_vect) { //timer1 overflow
First there were some errors like TCCR1 = 0; not defined in this sketch, then after playing with #define __ AVR_ATtiny85__, #undef _AVR_IOXXX_H_ and replacing avr/io.h with iotn85.h errors like multiple definition of __vector_x(?) came. Commenting out this line:
//attachInterrupt(0,zeroCrossingInterrupt, FALLING)
helped, but now even this one works, but ISR not.
I know there is a lot of caches and you do not see what is going on behind curtains, but I am quite lost yet...
Maybe there is also problem I have multiple installs in different dirs, but do not know how to clean old ones (1.6.5-r2) and at the end both work same way now, my latest fresh installed is 1.8.9.
Does anyone have any experiences with or some working demo sketch using both compare match and overflow ISRs ?
Edit
Setup info
This board selected (...\AppData\Roaming\Arduino15\packages\digistump\hardware\avr\1.6.7\boards.txt):
digispark-tiny.name=Digispark (Default - 16.5mhz)
digispark-tiny.upload.using=micronucleusprog
digispark-tiny.upload.protocol=usb
digispark-tiny.upload.tool=micronucleus
digispark-tiny.upload.maximum_size=6012
digispark-tiny.build.mcu=attiny85
digispark-tiny.build.f_cpu=16500000L
digispark-tiny.build.board=AVR_DIGISPARK
digispark-tiny.build.core=tiny
digispark-tiny.build.variant=digispark
digispark-tiny.upload.wait_for_upload_port = false
digispark-tiny.upload.use_1200bps_touch = false
digispark-tiny.upload.disable_flushing = false
And these are available:
(...\AppData\Roaming\Arduino15\package_digistump_index.json)
...
"boards": [
{
"name": "Digispark (Default - 16.5mhz)"
},
{
"name": "Digispark Pro (Default 16 Mhz)"
},
{
"name": "Digispark Pro (16 Mhz) (32 byte buffer)"
},
{
"name": "Digispark Pro (16 Mhz) (64 byte buffer)"
},
{
"name": "Digispark (16mhz - No USB)"
},
{
"name": "Digispark (8mhz - No USB)"
},
{
"name": "Digispark (1mhz - No USB)"
}
],
...
Edit 2
Fresh install attempt on W10
Few more links - 2nd manual here:
https://www.electronicshub.org/getting-started-with-attiny85/
http://digistump.com/package_digistump_index.json
have to be translated to
https://raw.githubusercontent.com/digistump/arduino-boards-index/master/package_digistump_index.json
https://downloads.arduino.cc/arduino-1.8.9-windows.zip
W10
When installing shows error downloading (timeout?):
http://downloads.arduino.cc/tools/avr-gcc-4.8.1-arduino5-i686-mingw32.zip
Downloaded by hand to (there was empty file of this name):
...\AppData\Local\Arduino15\staging\packages\
avr-gcc-4.8.1-arduino5-i686-mingw32.zip
...\AppData\Local\Temp\arduino_build_139604\core\core.a(wiring.c.o): In function `__vector_4':
...\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\cores\tiny/wiring.c:93: multiple definition of `__vector_4'
...\AppData\Local\Temp\arduino_build_139604\sketch\sketch_jun28a.ino.cpp.o:...\arduino-1.8.9\SketchBook\sketch_jun28a/sketch_jun28a.ino:60: first defined here
collect2.exe: error: ld returned 1 exit status
exit status 1 Error compiling for board Digispark (Default - 16.5mhz).
...\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\cores\tiny\core_build_options.h (not found that file in arduino dir):
/*=============================================================================
Build options for the ATtiny85 processor
=============================================================================*/
#if defined( __AVR_ATtiny25__ ) || defined( __AVR_ATtiny45__ ) || defined( __AVR_ATtiny85__ )
#define __AVR_ATtinyX5__
#endif
#if defined( __AVR_ATtinyX5__ )
/*
For various reasons, Timer 1 is a better choice for the millis timer on the
'85 processor.
*/
#define TIMER_TO_USE_FOR_MILLIS 1
#define TIMER_TO_USE_FOR_MILLIS
?