ILI9341 on Attiny2313 : library issue? (I know memory is an issue)

Hey,

!!! Compiling error on the first comment because it's too long !!!

I correctly implemented the blinky exemple on an attiny2313A using Drazzy's work to use the arduino as an ISP to load my code on the attiny2313.
Since there is no bootloader for Attiny2313, I followed this tuto which burn the bootloader after loading the code on the attiny to get the right clock frequency: Program an attiny2313 with an Arduino - Arduino Learning

Now that the attiny works, I tried to copy-paste a code exemple for a TFT screen (ili9341) that works on the arduino Uno. I found this tuto here: Interfacing Arduino with ILI9341 color TFT display - SIMPLE PROJECTS

But when I try to load the screen code to my attiny through my arduino as ISP I get a bunch of errors (I put the errors at the end of the topics because it's a lot).

I am wondering if it's not a library error (like maybe since the library is in the arduino folder, maybe it's not coppied on the attiny or something) because on the second line of error it says "'SPDR' was not declared in this scope".

Also, I know that the attiny2313 doesn't have enough memory to make the ili9341 works, I am just trying out thing until my atmega328 arrives.

Thanks for your help :slight_smile:

C:\Program Files (x86)\Arduino\libraries\Adafruit-GFX-Library-master\Adafruit_SPITFT.cpp: In member function 'void Adafruit_SPITFT::writeColor(uint16_t, uint32_t)':
C:\Program Files (x86)\Arduino\libraries\Adafruit-GFX-Library-master\Adafruit_SPITFT.cpp:43:30: error: 'SPDR' was not declared in this scope
 #define AVR_WRITESPI(x) for (SPDR = (x); (!(SPSR & _BV(SPIF)));)
                              ^
C:\Program Files (x86)\Arduino\libraries\Adafruit-GFX-Library-master\Adafruit_SPITFT.cpp:1308:7: note: in expansion of macro 'AVR_WRITESPI'
       AVR_WRITESPI(hi);
       ^~~~~~~~~~~~
C:\Program Files (x86)\Arduino\libraries\Adafruit-GFX-Library-master\Adafruit_SPITFT.cpp:43:30: note: suggested alternative: 'SPI'
 #define AVR_WRITESPI(x) for (SPDR = (x); (!(SPSR & _BV(SPIF)));)
                              ^
C:\Program Files (x86)\Arduino\libraries\Adafruit-GFX-Library-master\Adafruit_SPITFT.cpp:1308:7: note: in expansion of macro 'AVR_WRITESPI'
       AVR_WRITESPI(hi);
       ^~~~~~~~~~~~
C:\Program Files (x86)\Arduino\libraries\Adafruit-GFX-Library-master\Adafruit_SPITFT.cpp:43:45: error: 'SPSR' was not declared in this scope
 #define AVR_WRITESPI(x) for (SPDR = (x); (!(SPSR & _BV(SPIF)));)
                                             ^
C:\Program Files (x86)\Arduino\libraries\Adafruit-GFX-Library-master\Adafruit_SPITFT.cpp:1308:7: note: in expansion of macro 'AVR_WRITESPI'
       AVR_WRITESPI(hi);
       ^~~~~~~~~~~~
C:\Program Files (x86)\Arduino\libraries\Adafruit-GFX-Library-master\Adafruit_SPITFT.cpp:43:45: note: suggested alternative: 'SPI'
 #define AVR_WRITESPI(x) for (SPDR = (x); (!(SPSR & _BV(SPIF)));)
                                             ^
C:\Program Files (x86)\Arduino\libraries\Adafruit-GFX-Library-master\Adafruit_SPITFT.cpp:1308:7: note: in expansion of macro 'AVR_WRITESPI'
       AVR_WRITESPI(hi);
       ^~~~~~~~~~~~
In file included from c:\users\gaeta\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7\avr\include\avr\io.h:99:0,
                 from c:\users\gaeta\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7\avr\include\avr\pgmspace.h:90,
                 from C:\Users\gaeta\AppData\Local\Arduino15\packages\ATTinyCore\hardware\avr\1.5.2\cores\tiny/Arduino.h:9,
                 from C:\Program Files (x86)\Arduino\libraries\Adafruit-GFX-Library-master\Adafruit_GFX.h:5,
                 from C:\Program Files (x86)\Arduino\libraries\Adafruit-GFX-Library-master\Adafruit_SPITFT.h:25,
                 from C:\Program Files (x86)\Arduino\libraries\Adafruit-GFX-Library-master\Adafruit_SPITFT.cpp:36:
C:\Program Files (x86)\Arduino\libraries\Adafruit-GFX-Library-master\Adafruit_SPITFT.cpp:43:56: error: 'SPIF' was not declared in this scope
 #define AVR_WRITESPI(x) for (SPDR = (x); (!(SPSR & _BV(SPIF)));)

!!! There is a lot of other lines that looks just the same, so I will skip to the end where ther might be more usefull stuff. !!!

C:\Program Files (x86)\Arduino\libraries\Adafruit-GFX-Library-master\Adafruit_SPITFT.cpp:43:30: note: suggested alternative: 'SPI'
 #define AVR_WRITESPI(x) for (SPDR = (x); (!(SPSR & _BV(SPIF)));)
                              ^
C:\Program Files (x86)\Arduino\libraries\Adafruit-GFX-Library-master\Adafruit_SPITFT.cpp:2412:5: note: in expansion of macro 'AVR_WRITESPI'
     AVR_WRITESPI(l);
     ^~~~~~~~~~~~
C:\Program Files (x86)\Arduino\libraries\Adafruit-GFX-Library-master\Adafruit_SPITFT.cpp:43:45: error: 'SPSR' was not declared in this scope
 #define AVR_WRITESPI(x) for (SPDR = (x); (!(SPSR & _BV(SPIF)));)
                                             ^
C:\Program Files (x86)\Arduino\libraries\Adafruit-GFX-Library-master\Adafruit_SPITFT.cpp:2412:5: note: in expansion of macro 'AVR_WRITESPI'
     AVR_WRITESPI(l);
     ^~~~~~~~~~~~
C:\Program Files (x86)\Arduino\libraries\Adafruit-GFX-Library-master\Adafruit_SPITFT.cpp:43:45: note: suggested alternative: 'SPI'
 #define AVR_WRITESPI(x) for (SPDR = (x); (!(SPSR & _BV(SPIF)));)
                                             ^
C:\Program Files (x86)\Arduino\libraries\Adafruit-GFX-Library-master\Adafruit_SPITFT.cpp:2412:5: note: in expansion of macro 'AVR_WRITESPI'
     AVR_WRITESPI(l);
     ^~~~~~~~~~~~
In file included from c:\users\gaeta\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7\avr\include\avr\io.h:99:0,
                 from c:\users\gaeta\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7\avr\include\avr\pgmspace.h:90,
                 from C:\Users\gaeta\AppData\Local\Arduino15\packages\ATTinyCore\hardware\avr\1.5.2\cores\tiny/Arduino.h:9,
                 from C:\Program Files (x86)\Arduino\libraries\Adafruit-GFX-Library-master\Adafruit_GFX.h:5,
                 from C:\Program Files (x86)\Arduino\libraries\Adafruit-GFX-Library-master\Adafruit_SPITFT.h:25,
                 from C:\Program Files (x86)\Arduino\libraries\Adafruit-GFX-Library-master\Adafruit_SPITFT.cpp:36:
C:\Program Files (x86)\Arduino\libraries\Adafruit-GFX-Library-master\Adafruit_SPITFT.cpp:43:56: error: 'SPIF' was not declared in this scope
 #define AVR_WRITESPI(x) for (SPDR = (x); (!(SPSR & _BV(SPIF)));)
                                                        ^
C:\Program Files (x86)\Arduino\libraries\Adafruit-GFX-Library-master\Adafruit_SPITFT.cpp:2412:5: note: in expansion of macro 'AVR_WRITESPI'
     AVR_WRITESPI(l);
     ^~~~~~~~~~~~
C:\Program Files (x86)\Arduino\libraries\Adafruit-GFX-Library-master\Adafruit_SPITFT.cpp:43:56: note: suggested alternative: 'SPI'
 #define AVR_WRITESPI(x) for (SPDR = (x); (!(SPSR & _BV(SPIF)));)
                                                        ^
C:\Program Files (x86)\Arduino\libraries\Adafruit-GFX-Library-master\Adafruit_SPITFT.cpp:2412:5: note: in expansion of macro 'AVR_WRITESPI'
     AVR_WRITESPI(l);
     ^~~~~~~~~~~~
exit status 1
Erreur de compilation pour la carte ATtiny2313(a)/4313 (No bootloader)

"'SPDR' was not declared in this scope".

This is because the library is trying to set a register that does not exsist on the 2313.

Thanks for your answer.

So basically this library (the one to program the screen using arduino) does not exist on attiny2313?

So I have to either find one or dig into the datasheet to make every operation "manually"?

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.