TFT display ILI9341 with SD card an a NRF24

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.

Regards Willi

The instructions from the Net is ambiguous.

A schematic of the project would be very helpful. Especially how the level shifter is connected.

CS pins do not use pullups as far as I know.

Does your project work? What is the problem, if not?

It all depends on the specific board.

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.

David.

Hey, thanks for the answers.
Here is the schematic.

Willy


How to post an image.

Hey David, I found this thread with your comment #57 ->#58. Is this instructable:

https://www.instructables.com/id/Arduino-TFT-display-of-bitmap-images-from-an-SD-Ca/

a good and safety method.?

+5V to display pin 1 (VCC) +5V through a 56 Ohm resistor to display pin 8 (LED) 0V (GND) to display pin 2 (GND)

I use a MEGA2560.

Willy

The instructable was written by Bodmer. Not by me. I am sure that everything will be good.

David.

That tutorial talks about using an Uno with the display. The SPI pins on a Mega are different.

MISO = pin 50 MOSI = pin 51 SCK = pin 52 CS = pin 53 (default chip select)

Yes, thank you. I'll contact you when I've tried it.

Willy

Unfortunately, no success. Are the resistances too big perhaps? The level shifter was still around here :confused: . 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

Willy