0

I am trying to use the Adafruit MMA8451 accelerometer with an attiny85. The Adafruit library uses Wire which doesn't work on the attiny so I used the ATTinyCore board files which have been modified to use a working version of Wire (github link: https://github.com/SpenceKonde/ATTinyCore). I'm just trying to get the MMA8451 example to compile but here is the following error output:


C:\Users\sglaw\Documents\Arduino\hardware\ATTinyCore-2.0.0-dev\avr\libraries\SPI\SPI.cpp: In static member function 'static void SPIClass::begin()':
C:\Users\sglaw\Documents\Arduino\hardware\ATTinyCore-2.0.0-dev\avr\libraries\SPI\SPI.cpp:259:5: error: 'USI_SCK_PORT' was not declared in this scope
 USI_SCK_PORT |= _BV(USCK_DD_PIN); //set the USCK pin as output
 ^~~~~~~~~~~~
C:\Users\sglaw\Documents\Arduino\hardware\ATTinyCore-2.0.0-dev\avr\libraries\SPI\SPI.cpp:259:5: note: suggested alternative: 'USI_CLOCK_PORT'
 USI_SCK_PORT |= _BV(USCK_DD_PIN); //set the USCK pin as output
 ^~~~~~~~~~~~
 USI_CLOCK_PORT
In file included from c:\users\sglaw\appdata\local\arduino15\packages\arduino\tools\avr-gcc7円.3.0-atmel3.6.1-arduino7\avr\include\avr\io.h:99:0,
 from C:\Users\sglaw\Documents\Arduino\hardware\ATTinyCore-2.0.0-dev\avr\libraries\SPI\SPI.h:27,
 from C:\Users\sglaw\Documents\Arduino\hardware\ATTinyCore-2.0.0-dev\avr\libraries\SPI\SPI.cpp:20:
C:\Users\sglaw\Documents\Arduino\hardware\ATTinyCore-2.0.0-dev\avr\libraries\SPI\SPI.cpp:259:25: error: 'USCK_DD_PIN' was not declared in this scope
 USI_SCK_PORT |= _BV(USCK_DD_PIN); //set the USCK pin as output
 ^
C:\Users\sglaw\Documents\Arduino\hardware\ATTinyCore-2.0.0-dev\avr\libraries\SPI\SPI.cpp:259:25: note: suggested alternative: 'USI_PIN'
C:\Users\sglaw\Documents\Arduino\hardware\ATTinyCore-2.0.0-dev\avr\libraries\SPI\SPI.cpp:260:5: error: 'USI_DDR_PORT' was not declared in this scope
 USI_DDR_PORT |= _BV(DO_DD_PIN); //set the DO pin as output
 ^~~~~~~~~~~~
C:\Users\sglaw\Documents\Arduino\hardware\ATTinyCore-2.0.0-dev\avr\libraries\SPI\SPI.cpp:260:5: note: suggested alternative: 'USI_PORT'
 USI_DDR_PORT |= _BV(DO_DD_PIN); //set the DO pin as output
 ^~~~~~~~~~~~
 USI_PORT
In file included from c:\users\sglaw\appdata\local\arduino15\packages\arduino\tools\avr-gcc7円.3.0-atmel3.6.1-arduino7\avr\include\avr\io.h:99:0,
 from C:\Users\sglaw\Documents\Arduino\hardware\ATTinyCore-2.0.0-dev\avr\libraries\SPI\SPI.h:27,
 from C:\Users\sglaw\Documents\Arduino\hardware\ATTinyCore-2.0.0-dev\avr\libraries\SPI\SPI.cpp:20:
C:\Users\sglaw\Documents\Arduino\hardware\ATTinyCore-2.0.0-dev\avr\libraries\SPI\SPI.cpp:260:25: error: 'DO_DD_PIN' was not declared in this scope
 USI_DDR_PORT |= _BV(DO_DD_PIN); //set the DO pin as output
 ^
C:\Users\sglaw\Documents\Arduino\hardware\ATTinyCore-2.0.0-dev\avr\libraries\SPI\SPI.cpp:260:25: note: suggested alternative: 'NOT_A_PIN'
C:\Users\sglaw\Documents\Arduino\hardware\ATTinyCore-2.0.0-dev\avr\libraries\SPI\SPI.cpp:261:26: error: 'DI_DD_PIN' was not declared in this scope
 USI_DDR_PORT &= ~_BV(DI_DD_PIN); //set the DI pin as input
 ^
Using library Wire at version 2.0.0 in folder: C:\Users\sglaw\Documents\Arduino\hardware\ATTinyCore-2.0.0-dev\avr\libraries\Wire 
Using library Adafruit_MMA8451_Library at version 1.2.1 in folder: C:\Users\sglaw\Documents\Arduino\libraries\Adafruit_MMA8451_Library 
Using library Adafruit_BusIO at version 1.14.1 in folder: C:\Users\sglaw\Documents\Arduino\libraries\Adafruit_BusIO 
Using library Adafruit_Unified_Sensor at version 1.1.7 in folder: C:\Users\sglaw\Documents\Arduino\libraries\Adafruit_Unified_Sensor 
Using library SPI at version 2.0.0 in folder: C:\Users\sglaw\Documents\Arduino\hardware\ATTinyCore-2.0.0-dev\avr\libraries\SPI 
exit status 1
Error compiling for board ATtiny85/45/25 (No Bootloader).

Any help much appreciated

asked Jan 7, 2023 at 18:05
6
  • I'm pretty sure I know what this is, but I can't replicate your problem exactly. Commented Jan 7, 2023 at 19:01
  • I guess this is a problem with the 2.0.0 version of core. I installed version 1.5.2 through the boards manager and the example of the library compiles without errors Commented Jan 7, 2023 at 19:41
  • I'll try the 1.5.2 version Commented Jan 7, 2023 at 20:27
  • @chrisl Did you also not get their exact error? Commented Jan 7, 2023 at 20:59
  • @timemage In fact I got no error. Only the warning, that like 85% of memory is used globally. Compiled without problems. OP: Maybe you can report this at the cores github repository. They are asking for feedback on the 2.0.0 version. Commented Jan 7, 2023 at 21:36

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.