Reading Message from Arduino to Macintosh Terminal via TTL to RS485

I have

  1. a RS-485 to USB Converter.
  2. a TTL to RS-485 Converter.
  3. an Arduino UNO
    My Aim is to that Arduino send a text message using Serial.println function to TTL to RS-485 converter, which subsequently send the same message to RS-485 to USB converter and finally same message is printed on terminal window of a Mac using 'screen /dev/tty-USB 9600' command.

Can you please guide me how to proceed?

It's an UNO, so only 1 true serial port. I would suggest the use of a software serial port using the SoftwareSerial library or the AltSoftSerial library for your RS485 messages. That would keep the hardware serial port free for debugging messages etc.

Note the baud rate limitation of a software serial port - 9600 or maybe 19200 maximum.

Which TTL-RS485 converter do you have? Does it have pins marked RE & DE on it? If does, then you need 2 (or 1 if you join the RE & DE signals together) pins to drive those pins.

If your RS-485 module doesn't have pins marked RE & DE, then it may be an auto switching RS485 module. In which case you don't need to worry about the RE & DE signals.

If you do need to drive RE & DE, then they are usually both driven high (transmit mode) or low
(receive mode) together.

To send a message, you would:

  • set RE & DE high
  • print your message to the software serial port
  • wait for the message transmission to complete
  • set RE & DE low

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