I have a small project with a LoRa module, a display and the Arduino MEGA 2560. The display and the LoRa module works perfectly alone, but when I use both parts together only the display works.
After searching in the Internet, I found the information, that it is possible to use multiple SPI devices with the SS Pin (Slave Select Pin), but I couldn't found a SS pin on the display and the LoRa module.
Alwin07:
After searching in the Internet, I found the information, that it is possible to use multiple SPI devices with the SS Pin (Slave Select Pin), but I couldn't found a SS pin on the display and the LoRa module.
Do some more searching and you will find that each SPI device needs its own SS\CS pin even if your using only one device.
Alwin07:
Yes, I already know it! But my problem is that I couln't find the CS/SS Pin or Schematic of the display because it is connected with a strange shield.
If it helps I use this contrustructor:
UTFT screen(ILI9341_16,38,39,40,41)
UTFT(byte model, int RS, int WR, int CS, int RST, int SER=0);
That means 40 is the SS pin?
Yes, very likley.
And if you had posted the code you are using as requested we would have been able to tell you that several post ago.
There is a major "gotcha" with SPI, which is that many chips are not SPI compliant, yet claim to be
so. And even so if different devices use different clock modes and phases they may be impossible
to reconcile.
You should check in any datasheet than an SPI device genuinely releases the MISO line to high-impedance
state whenever CS is high, and that it completely ignores clocks when CS is high.
The common offenders seem to be chips which claim to support I2C and SPI using the same pins - this
is not possible to do and allow sharing on the SPI bus.