I'm working on a project with an Arduino Mega 2560. I connected the board to a MAX232CPE in order to communicate in serial mode with a thermal printer. I connected the MAX232 to one of the 3 extra serial ports of the Mega 2560 and did all the required wiring adding capacitors. I did not connect the RTS terminal. No message seems to be sent to the thermal printer, but the communication works perfectly when trying to send a message to the debugging computer. The very same computer communicating with the printer works perfectly, opening a serial port and sending some data. In example, If I send the command PRINT XYZ, the printer will print the message when communicating with the computer, but nothing when communicating with the arduino. the very same message has been successfully read by the computer when connected to the RS232 port of the arduino. What could the problem be?
RS232 signal lines have fixed directions.
If the arduino is talking to the computer, and the printer is talking to the computer, using the same cable, then I'm pretty sure you will need a null modem connection (RX / TX etc crossed over) between the Arduino and the printer.
Also the printer may use hardware flow control. If so, you will to connect up RTS / CTS and perhaps assert DTR.
When encountering a problem with RS232, my first instinct is always to swap TX and RX.
If you're still having problems. Use a scope, LED or buzzer to check which line is really TX at each end.
Next, I would check the baud rate. Check the manuals first. Then, use a scope to measure the pulse widths for the two systems and compare.
Check you are using the right number of bits and parity.