Is this display compatible?

Hello,

I have purchased a 10.1 inch display from:

I'm have issues with the SPI.h. The examples from the above site do not compile with Mega 2560. Errors point to SPI no containing certain functions.

The display was tested on Due but is advertised as compatible with Mega 2560. I've seen other posts with similar issues but none have a solution. All related posts go silent. Has anybody solved a similar issue?

Regards,

Brian

Your post was MOVED to its current location as it is more suitable.

Could you also take a few moments to Learn How To Use The Forum.

Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.

Please post the sketch that you have problems with and the full error messages

Hello UKHeliBob,

I've attached the library and the example for capacitive touchscreen which I downloaded from the BuyDisplay web site for the 10.1inch screen. Also attached is a text file containing the error code. Note, I am using an Arduino Mega 2560 and not the Due. The web site states it is compatible to the Mega 2560.

Libraries-Examples_ER-TFTM101-1_Capacitive_Touch.zip (55.5 KB)

Processing: Display_error.txt...

Any help here UKHeliBob would be most appreciated.

Regards,

Brian

UKHeliBob,

I don't think the text file uploaded correctly so I'll post it here:

Arduino: 1.8.13 (Linux), Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"
/home/pi/Arduino/libraries/Ra8876_Lite/Ra8876_Lite.cpp: In member function 'boolean Ra8876_Lite::begin()':
/home/pi/Arduino/libraries/Ra8876_Lite/Ra8876_Lite.cpp:27:19: error: no matching function for call to 'SPIClass::begin(int&)'
SPI.begin(_xnscs);
^
In file included from /home/pi/Arduino/libraries/Ra8876_Lite/Ra8876_Lite.cpp:11:0:
/home/pi/Downloads/arduino-1.8.13/hardware/arduino/avr/libraries/SPI/src/SPI.h:159:15: note: candidate: static void SPIClass::begin()
static void begin();
^~~~~
/home/pi/Downloads/arduino-1.8.13/hardware/arduino/avr/libraries/SPI/src/SPI.h:159:15: note: candidate expects 0 arguments, 1 provided
/home/pi/Arduino/libraries/Ra8876_Lite/Ra8876_Lite.cpp:30:32: error: no matching function for call to 'SPIClass::setClockDivider(int&, int)'
SPI.setClockDivider(_xnscs,21);
^
In file included from /home/pi/Arduino/libraries/Ra8876_Lite/Ra8876_Lite.cpp:11:0:
/home/pi/Downloads/arduino-1.8.13/hardware/arduino/avr/libraries/SPI/src/SPI.h:302:22: note: candidate: static void SPIClass::setClockDivider(uint8_t)
inline static void setClockDivider(uint8_t clockDiv) {
^~~~~~~~~~~~~~~
/home/pi/Downloads/arduino-1.8.13/hardware/arduino/avr/libraries/SPI/src/SPI.h:302:22: note: candidate expects 1 argument, 2 provided
/home/pi/Arduino/libraries/Ra8876_Lite/Ra8876_Lite.cpp:31:35: error: no matching function for call to 'SPIClass::setDataMode(int&, int)'
SPI.setDataMode(_xnscs,SPI_MODE0);
^
In file included from /home/pi/Arduino/libraries/Ra8876_Lite/Ra8876_Lite.cpp:11:0:
/home/pi/Downloads/arduino-1.8.13/hardware/arduino/avr/libraries/SPI/src/SPI.h:297:22: note: candidate: static void SPIClass::setDataMode(uint8_t)
inline static void setDataMode(uint8_t dataMode) {
^~~~~~~~~~~
/home/pi/Downloads/arduino-1.8.13/hardware/arduino/avr/libraries/SPI/src/SPI.h:297:22: note: candidate expects 1 argument, 2 provided
/home/pi/Arduino/libraries/Ra8876_Lite/Ra8876_Lite.cpp:66:31: error: no matching function for call to 'SPIClass::setClockDivider(int&, int)'
SPI.setClockDivider(_xnscs,2);
^
In file included from /home/pi/Arduino/libraries/Ra8876_Lite/Ra8876_Lite.cpp:11:0:
/home/pi/Downloads/arduino-1.8.13/hardware/arduino/avr/libraries/SPI/src/SPI.h:302:22: note: candidate: static void SPIClass::setClockDivider(uint8_t)
inline static void setClockDivider(uint8_t clockDiv) {
^~~~~~~~~~~~~~~
/home/pi/Downloads/arduino-1.8.13/hardware/arduino/avr/libraries/SPI/src/SPI.h:302:22: note: candidate expects 1 argument, 2 provided
/home/pi/Arduino/libraries/Ra8876_Lite/Ra8876_Lite.cpp: In member function 'void Ra8876_Lite::lcdRegWrite(ru8)':
/home/pi/Arduino/libraries/Ra8876_Lite/Ra8876_Lite.cpp:133:43: error: 'SPI_CONTINUE' was not declared in this scope
SPI.transfer(_xnscs,RA8876_SPI_CMDWRITE,SPI_CONTINUE);
^~~~~~~~~~~~
/home/pi/Arduino/libraries/Ra8876_Lite/Ra8876_Lite.cpp: In member function 'void Ra8876_Lite::lcdDataWrite(ru8)':
/home/pi/Arduino/libraries/Ra8876_Lite/Ra8876_Lite.cpp:140:44: error: 'SPI_CONTINUE' was not declared in this scope
SPI.transfer(_xnscs,RA8876_SPI_DATAWRITE,SPI_CONTINUE);
^~~~~~~~~~~~
/home/pi/Arduino/libraries/Ra8876_Lite/Ra8876_Lite.cpp: In member function 'ru8 Ra8876_Lite::lcdDataRead()':
/home/pi/Arduino/libraries/Ra8876_Lite/Ra8876_Lite.cpp:147:43: error: 'SPI_CONTINUE' was not declared in this scope
SPI.transfer(_xnscs,RA8876_SPI_DATAREAD,SPI_CONTINUE);
^~~~~~~~~~~~
/home/pi/Arduino/libraries/Ra8876_Lite/Ra8876_Lite.cpp:148:38: error: void value not ignored as it ought to be
ru8 data = SPI.transfer(_xnscs,0xff);
^
/home/pi/Arduino/libraries/Ra8876_Lite/Ra8876_Lite.cpp: In member function 'ru8 Ra8876_Lite::lcdStatusRead()':
/home/pi/Arduino/libraries/Ra8876_Lite/Ra8876_Lite.cpp:155:45: error: 'SPI_CONTINUE' was not declared in this scope
SPI.transfer(_xnscs,RA8876_SPI_STATUSREAD,SPI_CONTINUE);
^~~~~~~~~~~~
/home/pi/Arduino/libraries/Ra8876_Lite/Ra8876_Lite.cpp:156:37: error: void value not ignored as it ought to be
ru8 data= SPI.transfer(_xnscs,0xff);
^
/home/pi/Arduino/libraries/Ra8876_Lite/Ra8876_Lite.cpp: In member function 'void Ra8876_Lite::lcdDataWrite16bbp(ru16)':
/home/pi/Arduino/libraries/Ra8876_Lite/Ra8876_Lite.cpp:179:44: error: 'SPI_CONTINUE' was not declared in this scope
SPI.transfer(_xnscs,RA8876_SPI_DATAWRITE,SPI_CONTINUE);
^~~~~~~~~~~~
Multiple libraries were found for "Ra8876_Lite.h"
Used: /home/pi/Arduino/libraries/Ra8876_Lite
Not used: /home/pi/Arduino/libraries/olfRa8876_Lite
exit status 1
Error compiling for board Arduino Mega or Mega 2560.T

If you are posting error output such as this, it needs to be posted as "code", not "quote". Otherwise the formatting is munged.

Paul_B,

I can't see in the editor how to upload the error code as 'code'. Any hints here? In the mean time I've snipped it in three parts as I have a small screen.

I've highlighted the error at the start of part 1.

I missed the last line in part two so part 3 captures the last statement in full. The statement of multiple library's shows 'olfRa8876_Lite'. Should actually read oldRa8876_Lite. I've since removed it. Same library loaded from vendor web site but from different file i.e. examples and lib for display without touch screen. Had same issue.

I think the error is to do with something missing in the SPI.h file.

Regards,

Brian

Hi @Brian_Usher,

The SPI library for Arduino Due is different compared to other Arduino SPI libraries.
I find SPI.h for Due here: C:\Users\ZinggJ\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.12\libraries\SPI\src
You will need to look for
C:\Users\xxx\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.12\libraries\SPI\src

Any library using HW SPI on Arduino Due will need conditional compile statements for compatibility with Arduino Due.

It is unfortunate that there is no common SPI base class for all platforms.

Jean-Marc

Select the full error from the IDE using the "Copy error messages" button then in the forum post editor click the </> icon in thw window header (or press Ctrl and E) and paste the error text where you are prompted to "type or paste code here"

Here goes:

Arduino: 1.8.13 (Linux), Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"

/home/pi/Arduino/libraries/Ra8876_Lite/Ra8876_Lite.cpp: In member function 'boolean Ra8876_Lite::begin()':
/home/pi/Arduino/libraries/Ra8876_Lite/Ra8876_Lite.cpp:27:19: error: no matching function for call to 'SPIClass::begin(int&)'
   SPI.begin(_xnscs);
                   ^
In file included from /home/pi/Arduino/libraries/Ra8876_Lite/Ra8876_Lite.cpp:11:0:
/home/pi/Downloads/arduino-1.8.13/hardware/arduino/avr/libraries/SPI/src/SPI.h:159:15: note: candidate: static void SPIClass::begin()
   static void begin();
               ^~~~~
/home/pi/Downloads/arduino-1.8.13/hardware/arduino/avr/libraries/SPI/src/SPI.h:159:15: note:   candidate expects 0 arguments, 1 provided
/home/pi/Arduino/libraries/Ra8876_Lite/Ra8876_Lite.cpp:30:32: error: no matching function for call to 'SPIClass::setClockDivider(int&, int)'
   SPI.setClockDivider(_xnscs,21);
                                ^
In file included from /home/pi/Arduino/libraries/Ra8876_Lite/Ra8876_Lite.cpp:11:0:
/home/pi/Downloads/arduino-1.8.13/hardware/arduino/avr/libraries/SPI/src/SPI.h:302:22: note: candidate: static void SPIClass::setClockDivider(uint8_t)
   inline static void setClockDivider(uint8_t clockDiv) {
                      ^~~~~~~~~~~~~~~
/home/pi/Downloads/arduino-1.8.13/hardware/arduino/avr/libraries/SPI/src/SPI.h:302:22: note:   candidate expects 1 argument, 2 provided
/home/pi/Arduino/libraries/Ra8876_Lite/Ra8876_Lite.cpp:31:35: error: no matching function for call to 'SPIClass::setDataMode(int&, int)'
   SPI.setDataMode(_xnscs,SPI_MODE0);
                                   ^
In file included from /home/pi/Arduino/libraries/Ra8876_Lite/Ra8876_Lite.cpp:11:0:
/home/pi/Downloads/arduino-1.8.13/hardware/arduino/avr/libraries/SPI/src/SPI.h:297:22: note: candidate: static void SPIClass::setDataMode(uint8_t)
   inline static void setDataMode(uint8_t dataMode) {
                      ^~~~~~~~~~~
/home/pi/Downloads/arduino-1.8.13/hardware/arduino/avr/libraries/SPI/src/SPI.h:297:22: note:   candidate expects 1 argument, 2 provided
/home/pi/Arduino/libraries/Ra8876_Lite/Ra8876_Lite.cpp:66:31: error: no matching function for call to 'SPIClass::setClockDivider(int&, int)'
   SPI.setClockDivider(_xnscs,2);
                               ^
In file included from /home/pi/Arduino/libraries/Ra8876_Lite/Ra8876_Lite.cpp:11:0:
/home/pi/Downloads/arduino-1.8.13/hardware/arduino/avr/libraries/SPI/src/SPI.h:302:22: note: candidate: static void SPIClass::setClockDivider(uint8_t)
   inline static void setClockDivider(uint8_t clockDiv) {
                      ^~~~~~~~~~~~~~~
/home/pi/Downloads/arduino-1.8.13/hardware/arduino/avr/libraries/SPI/src/SPI.h:302:22: note:   candidate expects 1 argument, 2 provided
/home/pi/Arduino/libraries/Ra8876_Lite/Ra8876_Lite.cpp: In member function 'void Ra8876_Lite::lcdRegWrite(ru8)':
/home/pi/Arduino/libraries/Ra8876_Lite/Ra8876_Lite.cpp:133:43: error: 'SPI_CONTINUE' was not declared in this scope
   SPI.transfer(_xnscs,RA8876_SPI_CMDWRITE,SPI_CONTINUE);
                                           ^~~~~~~~~~~~
/home/pi/Arduino/libraries/Ra8876_Lite/Ra8876_Lite.cpp: In member function 'void Ra8876_Lite::lcdDataWrite(ru8)':
/home/pi/Arduino/libraries/Ra8876_Lite/Ra8876_Lite.cpp:140:44: error: 'SPI_CONTINUE' was not declared in this scope
   SPI.transfer(_xnscs,RA8876_SPI_DATAWRITE,SPI_CONTINUE);
                                            ^~~~~~~~~~~~
/home/pi/Arduino/libraries/Ra8876_Lite/Ra8876_Lite.cpp: In member function 'ru8 Ra8876_Lite::lcdDataRead()':
/home/pi/Arduino/libraries/Ra8876_Lite/Ra8876_Lite.cpp:147:43: error: 'SPI_CONTINUE' was not declared in this scope
   SPI.transfer(_xnscs,RA8876_SPI_DATAREAD,SPI_CONTINUE);
                                           ^~~~~~~~~~~~
/home/pi/Arduino/libraries/Ra8876_Lite/Ra8876_Lite.cpp:148:38: error: void value not ignored as it ought to be
   ru8 data = SPI.transfer(_xnscs,0xff);
                                      ^
/home/pi/Arduino/libraries/Ra8876_Lite/Ra8876_Lite.cpp: In member function 'ru8 Ra8876_Lite::lcdStatusRead()':
/home/pi/Arduino/libraries/Ra8876_Lite/Ra8876_Lite.cpp:155:45: error: 'SPI_CONTINUE' was not declared in this scope
   SPI.transfer(_xnscs,RA8876_SPI_STATUSREAD,SPI_CONTINUE);
                                             ^~~~~~~~~~~~
/home/pi/Arduino/libraries/Ra8876_Lite/Ra8876_Lite.cpp:156:37: error: void value not ignored as it ought to be
   ru8 data= SPI.transfer(_xnscs,0xff);
                                     ^
/home/pi/Arduino/libraries/Ra8876_Lite/Ra8876_Lite.cpp: In member function 'void Ra8876_Lite::lcdDataWrite16bbp(ru16)':
/home/pi/Arduino/libraries/Ra8876_Lite/Ra8876_Lite.cpp:179:44: error: 'SPI_CONTINUE' was not declared in this scope
   SPI.transfer(_xnscs,RA8876_SPI_DATAWRITE,SPI_CONTINUE);
                                            ^~~~~~~~~~~~
Multiple libraries were found for "Ra8876_Lite.h"
 Used: /home/pi/Arduino/libraries/Ra8876_Lite
 Not used: /home/pi/Arduino/libraries/olfRa8876_Lite
exit status 1
Error compiling for board Arduino Mega or Mega 2560.


This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Thanks ZinggJM,

I agree. Without a common SPI it makes things a little less fun.

So do you mean:

Any library using HW SPI on Arduino Due will need conditional compile statements for compatibility with Arduino Mega?

This I'm not quite sure on what to do in order to modify the SPI. Any hints here?

Regards,

Brian

You would need to look up every method call that produced an error message in SPI.h, to see what parameters need be added or changed. It looks like the CS pin number is needed, to identify the SPI channel to apply the call to.

Jean-Marc

Oops, I see you used Arduino MEGA to compiler for? Now I am confused.

Aha, you try to compile a library intended for Arduino Due for Arduino MEGA. I should have read the posts more attentively.

ZinggJM,

I use a Mega 2560 micro. The display and shield was designed for a Due. The web site states it is compatible with a Mega:

Before I get to any potential hardware mod requirements I thought I'd just try to compile and upload the sketch to the Mega to ensure nothing silly occurs. Something silly occurred.

B

That does not seem to be a very suitable display for a Mega (and certainly not an UNO) because of the high resolution. Since there does not seem to be any library available from the seller for anything other than the Due, they may never have actually tested it with the Mega.

Is that display compatible with a 5 volt board such as the Mega?

So most likely the vendor has no example or library for Arduino MEGA. The reason might be the limited RAM and ROM resources of the MEGA.
A display of this size and prize deserves a powerful processor such as Arduino Due.

Hi David_2018,

It comes with a shield. The shield can be set for 3.5V or 5V and takes an external 5VDC, 1Amp supply. I had a look last night at the little jumpers (tiny circle pads with a cut through the middle). It was soldered for 5VDC as a default. I'm assuming it is compatible with 5VDC. (after all they stated this on their web site)

Regards,
Bran

ZinggJM,

The reason I went for the use of Mega was two fold:

  1. I search for a Mega compatible 10.1inch display and it came up.

  2. The Mega board I use has an integrated ESP8266 which communicates to my Fronius solar inverter and multiple TPlink smart switches. Basically it measures the amount of spare power I'm generating and turns on/off non essential lights around the house so I avoid importing (very expensive) power. Works well but I only have a 3 inch display hence the search for a bigger one.

I could use a Due but would probably need to externally connect an ESP8266. I'd prefer to use the Mega at this point unless it becomes a full blown engineering task (which I simply don't have the time for....just ask my wife, tap is still dripping!).

I've come across other posts with the same or similar problems. Most were very old (2 or 3 years) and inconclusive. They may have found a solution or gave up.

Regards,
Brian

You might try to modify the library. Mostly by removing the _xnscs parameter.
I have a Waveshare 7" display with RA8875. I don't know if RA8875 and RA8876 are similar.

ZinggJM,

So you think if I just delete the:

SPI.begin(xnscs); and make it
SPI.begin(
); this may work?

Hang five and I'll check.

Regards,

Brian

ZinggJM,

No. It didn't work. There's many references within the library to xnscs.

Regards,
B