TFT library Bug? - Arduino Due: remapping pin because pin-names do not match ISP [SOLVED]

Hello there.

First of all, yes there are many posts about similar issues. However, i have spend over 5 hours now and cannot get this thing to work. I tried diffrent libraries but i run into the same issues at some point. There is not much information out there on how to connect the due to the TFT screens.

My main issue right now is that the standard library does not work the way it is intended.
According to this page: Arduino - TFTConstructor
It should be possible to do this:

#define CS      10
#define MOSI    6
#define RESET   7
#define DC      20
#define SCLK    21


But during compiling i get an error saying that it is not possible to pass on 5 arguments (only room for 3).

The reason i need to remap this is because all examples and standard pin configurations seem to be build on the pinout of other bords (expect for the due).

And on top of that i am really confused by the pinouts of my TFT screen. I wish they had the same name, but a simple trail and error could resolve this (if remapping would be possible).

If anyone could point me into the right direction? That would be great, but, ideally it would be nice if someone already knows how to hook up this TFT screen directly to the ISP bus.

Its a 128x160 RGB screen from aliexpress. No model name but i think that it should be similar to the ST7735. It has no SD card on the back.


Why are you not able to connect the display to the DUEs hardware SPI ports ?

Well my point is HOW? Please tell me how :smiley:

Because i dont know how to set it up. The names of the pinouts of my tft screen are confusing me so i dont know what should be connected to what.

And like i said in my post, if i could remap the pins with the software i can figure it out so that i dont have to guess the correct pins on my due. So why does it not work to pass on 5 arguments? It clearly says on the arduino website it can handle 5…

by default it requires 3 arguments: TFT TFTscreen = TFT(CS, DC, RESET);
Then it needs only 3 pins from me, do i need to pass on the hardware ISP pins here? I dont see CS or DC pins on my ISP bus. What do i do with my other pins of my TFT screens? Leave them unconnected or is it assumed they are also connected to the ISP bus.

Im so confused i wish documentation was more clear. Thats why i need help figuring this out.

So let me rephrase that.

How do i connect this:

To this

And then how do i need to setup my pin configuration here, tot use the Hardware ISP bus:

#define CS      ??
#define DC      ???
#define RESET   ???


and why does this, not work?

#define CS      ?
#define MOSI    ??
#define RESET   ???
#define DC      ????
#define SCLK    ?????


I’d start with the datasheet for your TFT Display. It should explain the function of all the pins. SDA is typically the name for the bidirectional data signal on an I2C interface. But, you have to expect some non-standard nomenclature when using cheap Chinese no-name boards. Perhaps it’s really MOSI.

A Google search on;

‘Arduino 1.77" 160 x 128 tft’

Found this link which has connection details, pins for SPI etc.

1 Like

Thanks! I got it to work now.

One thing i dont understand is that the reset pin on the hardware ISP bus cannot be used with this library. The due doesnt have a digital pin for the hardware ISP reset pin so i cannot configure that in my code. Sinds its an essential argument it seems strange to me.

Your confused, the reset pin on the ISP connector is the reset pin for the processor, its not an I\O pin in the normal sense.

The reset pin for the display can be any normal I\O pin.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.