Serial ports on Opta

Hi, I'm trying to use an existing code for Arduino on Opta Wifi . Key part of this code is the use of UART to communicate to an external sensor on RS485, using a proprietary protocol (unfortunately it is NOT Modbus).

I have two problems:

  1. I don't know which of the serial ports of the microcontroller is used for RS485 interface on Opta
  2. I'm not sure if there is a way to "bypass" Opta OS and write directly on the UART in the same way I do with Serial1 or Serial2 on Arduino Mega2560.

I'm using Arduino IDE.
Thank you for your help!

According to the pins_arduino.h file, the RS485 port is driven by Serial2.

But I want RX/TX pins mapped to any of I1-I8 from Serial3 if possible. Still trying to work out if I can achieve this. Looks like Serial -> USB, Serial1->Wifi, Serial2->RS485 but no idea what Serial3 is physically wired to. The pins file states

#define SERIAL3_TX			PB_9
#define SERIAL3_RX			PH_14
#define SERIAL3_RTS			PA_15
#define SERIAL3_CTS			PB_15

Will report back if I find anything out.

Same question here. I wanto to make use of serial port of this PLC, not RS485 Modbus, my question would be: ¿ Can i use the serial2 to program serial comm on the arduino ide? Do i have to use a RS485-RS232 converter in order to use the UART? Please help.

Ive been thinking using serial libraries in serial2 and use a RS485-RS232 converter to connect to a the RS232 device. Could this do the trick?

1 Like

Hi @gibo_23

Have you found a solution to use any serial ports on Arduino Opta?

Thanks,
marian

In the OPTA WiFi documentation, I found information that the AUX connector for the expansion module has RX and TX pins. I haven't figured out how to use them yet. If anyone knows which Serial it is, please help.
From what I understand, the connections marked in red are actual connections, while those in blue are not present on the board.

I am also trying to connect a 3.3V TTL device (RX/TX) to the RS485 via a converter. I will let you know if I succeed.

EDIT
I just discovered that AUX is Serial1 (UART 3V3), so you can read data using as simple code as follows:

void setup() {
  Serial.begin(9600);
  Serial1.begin(9600);
}

void loop() {
  if (Serial1.available() > 0) {
    char received = Serial1.read();
    Serial.print(received);
  }
}
2 Likes

So how did you connect rx and tx pins to it? Or how did you connect to it in general?

Maybe this can help. It shows the TX and TX pin is location on the Expansion Port.

2 Likes

For testing purposes, I simply soldered the wires to the AUX. I don't have any knowledge about a socket that fits this connector.