This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RS232 connection to switcher

Other Parts Discussed in Thread: MAX232

Hi all, RS232 newbie here.

I'm trying to control a switcher through an arduino which is attached to a MAX232 board, but don't understand what the manual is saying.

The issue I have is that under the RS232 commands section, it doesn't make any sense to me. For example, it says 'Turn on the HDMI output', and then it says the command is '0B2.' - What does this mean and how can I use it?

Here's the manual: 

  • Hi Steve,

    You may need to check with SY on what these commands really mean, but the way I interpret it is that they are a series of ASCII-coded characters sent via a serial port using the RS-232 interface. For example, to select input 1 you could send the code for numeral 1 (0x31), followed by the letter B (0x42), followed again by 1 (0x31), and terminated with a period (0x2E). You should then get the defined response in a similar format. Each of these bytes would need to have a start bit (0) prepended and a stop bit (1) appended on them to match the UART formatting defined in the manual you linked. The manual also defines the data transfer rate, which in this case is 9600 baud.

    You can find some information on using the Arduino's serial port here: www.arduino.cc/.../. It looks like the Serial.print() command would do what you want. I believe the default UART configuration uses 8 data bits, no parity bits, and one stop bit so this should line up with what your switch is expecting.

    Hope this helps - let us know if you have further RS-232 questions.

    Regards,
    Max
  • Thanks for the response!

    I don't know whether coding problems come under the umbrella of this forum, but I'll post my problem anyway:

    My MAX232 board isn't arriving for a few days, so I want to make sure I understand the code fully before it gets here.
    So is the following all I need to do:

    // Begin at correct baud-rate.
    Serial.begin(9600);

    // Send "0B2." ASCII using 'Serial.print' defaults: 8 data bits, no parity, one stop bit.
    Serial.print("0B2.");

    It says it defaults to the RX & TX pins so I don't need to set up any pins.
    As for the 'Serial.print', is all I need to do as above in the code snippet? - because it almost seems too simple...

    Thanks for the help!
  • Steve,

    Yes, that's my understanding in reading through the Arduino documentation. I can't claim to be an expert there, though.

    Before you get your MAX232 board you should be able to either connect two Arduinos together or loopback a single one's TX to its RX to make sure communication works as expected. You could do the same thing once the MAX232 is available as well. Then, when you connect to the switch if it doesn't work then you at least know that issues are more likely to be with data formatting than with the physical signaling (assuming you are using a cable capable of RS-232 communication and pinout assignments are all compatible).

    Max
  • Awesome thanks! I'll do some testing and hopefully I'll be able to get it working with your advice!
    I've marked your first post as the answer.