Free pins. TFT screen

I have TFT screen mounted on top of Arduino UNO:

3.5 Inch TFT LCD Touch Screen Display Module 3.5" 480*320 LCD for Arduino UNO Mega2560 Mega 2560 - AliExpress 502

It reports TFT ID = 0x6814.
I found mixed information so far.

Please advise which pins I can use for SoftwareSerial communication for two 485 cards?

At the moment I use 0,1 forTx,Rx for one board, but I need two boards.
Thanks!

Are you asking which pins are not used by the screen ?

Which library are you using for the screen ?

And what, exactly, "mixed information" you have found so far?

Do you have any idea what the F_CS pin connected to A5 is used for? Most display boards of this type do not have any labeling for the A5 pin, and it is unused.

The LCD_RST pin can be disconnected from A4 and instead connected to RST of the Arduino. I've done this so that the I2C bus can be used.

Easiest solution is to use an Arduino Mega, display will still fit, you have plenty of memory, and hardware serial ports instead of SoftwareSerial.

Please don't tell me you are using SoftwareSerial on pins 0 & 1.

< edit >
If you do not need the SD card, then you could disconnect all the pins that are labeled SD_xxx.

That’s a really bad choice. Uploading code will not work and debug prints via Serial don’t work.

Library used for TFT is:

#include "Adafruit_GFX.h" // Core graphics library
#include <MCUFRIEND_kbv.h> // Hardware-specific library for MCUFRIEND shields

Maybe modified accordingly as I use UNO R4.

Easiest solution is to use an Arduino Mega, display will still fit, you have plenty of memory, and hardware serial ports instead of SoftwareSerial.
Yes, I tend to start using MEGA. Thanks!

Do you have any idea what the F_CS pin connected to A5 is used for? Most display boards of this type do not have any labeling for the A5 pin, and it is unused.
The LCD_RST pin can be disconnected from A4 and instead connected to RST of the Arduino. I've done this so that the I2C bus can be used.
Please advise where to read how to do this.

If you do not need the SD card, then you could disconnect all the pins that are labeled SD_xxx.
Thanks.

I found by experiement, that I can use A5 to toggle relay and pin 12 for input testing. Not sure if I did this correct, but it works. Maybe it is not good idea.

From answers as I see, no free pins in reality.

It's important to be accurate about what model of Arduino you are using in your first post. If you say "Uno" everyone will assume you mean R3 (not R4, which is a new model).

It works prefectly. I use Serial for debug output.
I use UNO R4 - maybe this is the reason.

On Uno R4, pins 0 and 1 are the Serial1 hardware serial port. Don't use Software Serial for those pins!

Question: why do you need 2x RS485 boards? RS485 is a serial bus, so it should not be necessary to use 2 of them.

On the Uno R4, the Serial interface goes to the USB port and does not use pins 0 and 1. Those pins are used by the Serial1 interface, which is what I presume you are using, or are you ?

I am not sure whether you can use SoftwareSerial with the Uno R4 but it would be helpful if you posted your full sketch, using code tags when you do

I have TFT screen additionally, relay, power indicator pin and not sure what other pins I can use for software Tx/Rx.

I need two 485 cards, as I want to connect to two let's say sensors. I need info from both of them to make decision.

Yes, I use pins 0,1 for Tx/Rx.

Softweare serial works 5 mins for me, then hangs. Only reset helps.

Code is posted both for Software and Hardware. Software works shaky, Hardware works perfectly fine.

As I said, pins 0 and 1 are used by the hardware Serial1 interface on the Uno R4. The pins should not be used with SoftwareSerial and there is no need to do so.

Change your sketch to use the Serial1 interface with the device connected to pins 0 and 1. That should work and you will only need a single instance of SoftwareSerial if it works with the R4

Do these sensors have the same address on the bus and it is not possible to change the address of one of them?

Two different addresses. I can distinguish response from every of them. I guess I can connect to two sensors in parallel.

So do you need 2x RS485 adapters for the Uno?

After discussion looks like not. Two sensors can sit on one bus and I can distiguish data from both of them

So question about free TFT pins for screen which I have boild down to:

It is for UNO R4 and 485 hardware serial communication.

Can use A5 to toggle relay and pin 12?

I guess we would need to see the internal schematic for your TFT shield to answer that. Can you post a link?

I saw this pinout on the page you linked to:


Maybe you can figure out from this?

It looks like D0, D1 are not used.

It may be that D14, D15 are not used, but maybe they are internally connected to A4 & A5 on R4 like they are on R3.

It may be that D10 to D13 are not used if the SD card is not required, however, the 5V<-->3.3V level shifter chips that you can see on the reverse of the TFT shield may interfere with those pins.