Help with TTL RS232 Shield, Arduino Uno and Lab equipment interface

I am trying to communicate with a piece of lab equipment using an Arduino Uno and a TTL to RS232 board (has the MAX2232 chip on it).

I’ve connected the converter board to 5v VCC, ground and to digital pins 6 (rx) and 7 (tx) on the uno. The converter board and equipment are connected by a straight through serial cable. On trying the code below although the tx light of the uno flash nothing happens on the equipment. To test the commands given by the manufacturer actually work I have connected the equipment up using a USB to serial and interfaced through hyperterminal. This does work.

I’m wondering how to test if the converter board is sending anything?
When using hyperterminal I had to configure the port (with parity, stop bits etc) - do I need to incorporate this into the code? or does the library take care of this? I am using the recommended baud rate of 9600 already.

I appreciate any help and suggestions. Apologies for my lack of expertise, I am very new to Arduino and have limited knowledge of the serial interface.

#include <SoftwareSerial.h>
#define RxPin 6
#define TxPin 7

SoftwareSerial mySerial(RxPin, TxPin); // Receive & Transmit pins

void setup()  
{
  Serial.begin(9600);
  mySerial.begin(9600);
  mySerial.println("START_4");
}


void loop()
{
}

Quickly make yourself an RS-232 tester. Take two know good LEDs. Place them in parallel, but opposite polarity and solder the legs together. Now, add a 1000 to 1200 ohm resistor to one leg.

Place one leg of the tester on the RS-232 ground and the other leg on the lead to be tested. Both LEDs will flash when you are getting RS-232 data.

You don't solder? Then use a breadboard to set up the same circuit and use test leads to go to the RS-232 connection.

Us really old farts still have RS-232 break-out boxes. Now you have the equivalent.

Paul

Hi Paul,

Thanks for your reply. Tried the board you suggested, although the LEDs blink (with the correct timings, as per delays in my code) there is still no communication upon hooking up to either equipment (via RS-232 cable) or hyperterminal (via USB to RS232 cable).

I have tried communicating with both hyperterminal and a Python serial read script in Windows, but I get nothing. Not even garbled characters (if i had incorrect parity, baud etc). Nothing…

I have set up your LED idea on a breadboard on the Tx line on a new interface with another MAX232 chip (following the instructions: http://www.arduino.cc/en/Tutorial/ArduinoSoftwareRS232) and it pulses each time my code sends a pulse. So something is being sent - multimetered +/_ 8.5 V.

I am using this code at the moment, which sets up 2-way comms between Arduino’s serial monitor and hyperterminal: (from http://stackoverflow.com/questions/18376468/arduino-using-serial-and-software-serial-with-bluetooth-module

#include <SoftwareSerial.h>

#define rxPin 6
#define txPin 7

SoftwareSerial mySerial(rxPin, txPin); // RX, TX
char myChar ; 

void setup() {
 Serial.begin(9600);   
 Serial.println("Goodnight moon!");

 mySerial.begin(9600);
 mySerial.println("Hello, world?");
}

void loop(){
 while(mySerial.available()){
   myChar = mySerial.read();
   Serial.print(myChar);
 }

 while(Serial.available()){
  myChar = Serial.read();
  mySerial.print(myChar);
 }
}

This allows me to type into Serial monitor and see the LED flash as it sends my data down the cable. However, I still get nothing at all in hyperterminal, or vice-versa. All my settings are the same (9600 8-N-1)

I know the hardware works (USB-Serial cable and commands to equipment), as I wrote a Python program which communicates on the same port settings.

I am close to despair, having felt like I’ve tried everything…I appreciate any advice you could offer. Thanks.

Oh, you are a long ways from having tried everything.

I don’t know if your equipment uses 25 pin DB25 connectors, or 15 pin DB15 connectors, so I can tell you which pins to jumper on the test equipment. But, you will have to try jumpering it’s request-to-send pin to it’s clear-to-send pin. RTS to CTS. And you can also try jumpering it’s data-terminal-ready pin to its data-set-ready pin. DTR to DSR. These jumpers tell the test equipment it is connected to a modem or other compatible equipment and that equipment is powered on and is ready to receive data.

Have you tried reversing the transmit data pin with the receive data pin on the test equipment. The nice thing about RS-232 is there is no chance you can damage anything by any of the above connections.

Good luck.

Paul