1.8 in TFT LCD Display Works with Nano and not with Mega

My question is:

Is there a difference between the NANO and MEGA that would account for ST7735 displays working on NANO and not working on MEGA? I'm using the same pins on both....

Pin 8 is RS (RS/DC)
Pin 9 is RST (RES)
Pin 10 is CS
Pin 11 is SDA
Pin 13 is CLK (SCL)

The displays have slightly different labels for the pins (hence the labels in parenthesis).

MORE DETAILS

I'm relatively new to Arduino and just bought two 1.8in TFT LCDs from different manufacturers.

I am having problems getting them to work on my Arduino MEGA 2560.

After experiencing failure with the MEGA using both displays and 2 different sketches, I finally decided to try the displays and sketches on a Nano.

Both displays work with both sketches on the NANO but not with the MEGA.

I'm using Adafruit_GFX and Adafruit_ST7735 libraries.

Im guessing there is a difference between MEGA and NANO that I am overlooking or that my MEGA has some problem....

Thanks in advance.

Post a link to the actual display(s) that you have bought. e.g. Ebay sale page.

The Sitronix ST7735 controller is specified for maximum 3.3V but it seems to be input voltage tolerant. Other controllers from other manufacturers are not 5V tolerant.

If your pcb does not match the photos in your link exactly, say so. Describe any differences in components, printing, copper traces, …

David.

One is from Sainsmart.com 1.8" TFT SPI LCD Screen with MicroSD Socket
1.8" TFT SPI LCD Screen with MicroSD Socket for Arduino – SainSmart.com

The other is
DSD TECH 1.8 Inch TFT LCD Display Module with SPI Interface for Arduino and MCU
https://smile.amazon.com/gp/product/B07WDJ3TV6/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1

Both displays are an exact match for what you see in the photos.

Both displays work with no problem with Nano. If I use same exact pins and same exact sketches with Mega they do not work. (I do change the board type when I upload). Processor for Mega is AT2560 and for Nano is ATmega328P.

Of course you must use different pins on a Mega when you use hardware SPI.

The Nano has hardware SPI on 11, 12, 13 for MOSI, MISO, SCK
The Mega2560 has hardware SPI on 51, 50, 52

If you are not using the microSD card, you only need MOSI, SCK pins for hardware SPI.

The Red display can plug directly into A5 - 5V pins on a Uno or Mega.
I presume that it comes with the appropriate sketch that uses software SPI on A5…A1 pin.
You line up the pins as shown in the Amazon photos.

You can drive either display on any random pins with the software constructor.

If you are using a public library, quote the example sketch by name.
If you are using an exotic custom library, post a link to the custom library and link / attach any sketch.

David.

David,

Thank you. That was the explanation I needed.

I did not understand that SPI pins are different on different hardware. I was simply pattern matching between hardware platforms without understanding what I was doing. Your posting gave me the answer I needed and prompted me to do some homework to learn more about SPI.

For others who have similar issue, here is a link to a reference that explains things in more detail.

https://www.arduino.cc/en/reference/SPI