Fail: 2 RA8875 on an Arduino Yun - SPI problem

Hi

I'm trying to build an installation with seven 5"-TFT's by adafruit (5.0 40-pin 800x480 TFT Display without Touchscreen : ID 1680 : $27.50 : Adafruit Industries, Unique & fun DIY electronics and kits), connected to an Arduino Yun. The TFT's themselves are driven by RA8875 boards (RA8875 Driver Board for 40-pin TFT Touch Displays - 800x480 Max : ID 1590 : $39.95 : Adafruit Industries, Unique & fun DIY electronics and kits), that are able to talk over SPI to the Arduino.

As long as I only connect 1 RA8875 to the 32u4 of the Arduino Yun, all works well.
As soon as I connect a second RA8875, SPI gets hung up - the displays cannot initialize.

I discussed it quite a while with adafruit's support guy rick under Driving 2X RA8875 off of one microcontroller, can it be done - Page 1 - adafruit industries.

There we found out, that it is actually possible to drive more than one RA8875 - but only from Arduino UNO (Aka Atmega 328P). With other microprocessors I tried (Arduino Yun (Atmel 32u4), Teensy++ 2.0 (Atmel AT90USB1286), Teensy 3.1 (MK20DX256)), only one RA8875 can be connected.

Now I suspect that the SPI library has something to do with this problem. Has anyone an idea in what way the SPI differs in between these processors?

Thank you very much, Dani

@admins: I opened this post under another board (Displays: 2 RA8875 on an Arduino Yun - SPI problem - Arduino Yún - Arduino Forum). Please erase it on the wrong board. Thank you.

Hello,

try to add this line:

SPCR |= _BV(MSTR);

after line 77 in Adafruit_RA8875.cpp:

and try again

Hi Angelo9999

Thanks for the suggestion. I altered the file and restarted the IDE 1.5.8. But nothing really changed:
Serial Monitor says

RA8875 start
RA8875 Not Found!

Shall I remove the line again or keep it in the code since nothing really changed?

You said that you altered the file and restarted the IDE, but did you upload again the sketch? Sorry for the stupid question but I need to be sure :slight_smile:

Yes, I uploaded it again.

Maybe when you call the begin for the second time it touches the SPI configuration while it is running so it stops working.

I have no more ideas and unfortunately I have not these screen so I can't try anything.

Seven 5"-TFT plus seven driver board plus seven power cords and seven spi cables is not easy job just wire up.

Plan B:

http://forum.arduino.cc/index.php?topic=278717.msg1961407#msg1961407

Wrote android app to communicate to Yun via UDP or Websocket. everything on WIFI, no wires.
The display could be at local or even at an other country.

It's only 7 wires for each display. I think the setup is not that complicated. Funny thing is that the problem can also be found on many other microcontrollers than Arduino Yun like on Arduino Leonardo, Teensy 3.1, Teensy++ 2.0 - but not on Arduino UNO and Arduino MEGA. There is an active discussion about it in the adafruit-forum: Driving 2X RA8875 off of one microcontroller, can it be done - Page 1 - adafruit industries.
Thank you for your ideas! Dani

Plan C:

AR9331 + Arduino Mega

http://forum.arduino.cc/index.php?topic=241259.msg1733572#msg1733572

Just a quick followup, for anyone who might find this thread by searching.

I've been looking into this problem, since it also happens when using a Teensy board. The cause appears to be a lack of tri-state by the RA8875 chip on the MISO pin when CS is high.

Details are here:

and also here:

https://forums.adafruit.com/viewtopic.php?f=47&t=60533&p=322091#p322091

If anyone else hits this issue, using a RA8875 with pretty much any other SPI chip, hopefully this will help?