Changing pins 2/3 to another pair?

Hi there, I want to read from an RS485/TTL-device, connected to pin 2/3. But these pins are occupied, when I want to add a TFT shield. Can I use another pair of pins for the RS485 input ...and how?
Thank you!

What is your board?
Do you use Software Serial for connect to rs485?

Sorry, it is an Arduino Mega. I would try Pins 45/46.. I use the ModbusMaster for accessing the data.

Why do you want to use SoftwareSerial on a Mega; there are three spare UARTs (Serial1 to Serial3) on a Mega.

So I guess you're using SoftwareSerial.

With shields usually all pins are occupied; it does not mean that they are used. As we don't know which shield, it's difficult to say.

If it's SoftwareSerial, yes.

Assign different pins in the constructor.

Modbus can't work with uart without Serial or Software Serial interface.
Running it on Mega, you shouldn't use a Soft Serial. Use a one of hardware Uarts, l.e. Serial1, Serial 2 and so on. The pins must corresponds to pins of selected Serial

1 Like

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