I have the following problem with the serial communication of an Arduino UNO:
I need to send and receive data through the serial port to a PC, through the default pins (0,1) for this communication through a USB TO RS485 converter.
The project consists of sending a command to a PC and it responds to another command,
In the tests that I have done, the arduino sends the communication, but when the PC responds the arduino does not receive it, when I exchange the RX and TX pins of physical position, the arduino does not send the communication but it does receive it. In other words, there is only one way communication. But when I do the tests through the USB cable it does send and receive without problems, The problem is when I do it through the physical pins of the arduino
What could be the problem? The USB to RS485 module ?, the configuration of the serial port
These are the lines I use for the connection, and they work, but only one option at a time, and when I swap pins 0 and 1
SoftwareSerial mySerial(0, 1); //your pins to serial communication mySerial.begin(9600); //Inicializar comunicacion serial mySerial.print(isla+codigo+"*$"); //comando que se envia size_t count = mySerial.readBytesUntil(',', data, 3); //Recive datos