Hey.
I use the TFT display ILI9341 with SD card and a NRF24.
The SPI Pins MISO, MOSI and SCK i put together. I use a level shifter.
The microcontroller is a MEGA2560.
All CSN Pins ic connect with an separate Resistor to 3V3 (Pull Up). Is this right?
The instructions from the Net is ambiguous.
Many Chinese "Red SPI" displays do not have pullups on the CS pins.
However it is good design practice to add pullups on /CS and /RST pins.
External devices on the SPI bus should have a known state before the MCU starts running.
It is especially important for AVR designs that use SPI for ICSP.
Arduino Uno, Mega, ... use bootloader over UART pins.
So ICSP is not important.
Questions on this forum seldom provide the necessary information e.g.
link to display
schematic or photo of wiring.
library version numbers (or link)
sketch code.
Unfortunately, no success. Are the resistances too big perhaps? The level shifter was still around here . The Display works fine. My display has an SC Card with two CS Pin. (SD_CS and f_CS)
Hey,
I had a partial success. I get access to an external SD card. I use new Level shifter for TFT and SD Card with Soft-SPI and SdFat Lib. The internal SD Card is not access.
This is the part of my code:
void Display::init() {
tft.begin();
tft.setRotation(1);
_isRefreshDisplay = true;
#if ENABLE_SOFTWARE_SPI_CLASS
// Serial.println("Type any character to start");
// while (!Serial.available()) {
// SysCall::yield();
// }
if (!sd.begin(SD_CS)) {
sd.initErrorHalt();
}
if (!file.open("SoftSPI.txt", O_RDWR | O_CREAT)) {
sd.errorHalt(F("open failed"));
}
file.println();
file.println(F("This line was printed __DATE__ __TIME__New."));
file.rewind();
while (file.available()) {
Serial.write(file.read());
}
file.close();
Serial.println(F("SD card init is done."));
#endif
intro();
drawCompassRose();
drawDatalegend();
drawBarScale();
}//-------------------------- end of init -----------------------------------------------
Error message:
Can't access SD card. Do not reformat.
No card, wrong chip select pin, or SPI problem?
SD errorCode: 0X20,0XFF