Arduino industrial and RS232

Here what I think is a banal question, but I can't quite find the information :

I have a standard serial device (RS232, 9600 baud or more) and want to connect it to
the Arduino Industrial 101. I've got this port converter (to deal with the voltage level
issue) from Digilent (PmodRS232) that has 6 pins. Is this directly pluggable on the Arduino ?
Looking at the pins on J7 at least I can get it powered (5V and GND on pins 4 and 5) -
but after that RX (from the port converter) goes to IQ13, TX to D6 and RTS to D5 and CTS to A0.
What is IQ13 ? Is that digital pin 13 ? Are D6 and D5 digital pins 6 and 7 ? Should this rather be on J3 -
where then it won't fit so I'll have to do a cable ?

I can't seem to find documentation that actually tells me what IQ13, D6 and D5 refer to on J7... ?

Thanks,
Niels

Diligent documentation

Yes, that's how I know what's on the PmodRS232 - it's the Arduino part I'm unsure about.

Digilent - Arduino
J1-3 D0
J1-4 D1

That way the serial connection is on Serial1.

Unfortunately for the Aduino industrial pin0 and 1 are busy (not accessible) :

“Digital pins 0 and 1 , not reported on final layout , are used for serial communication between the 32U4 and the AR9331. You can use to communication between the processors the Ciao library.”

I’ve now tried to do this with SoftwareSerial on pins 5 and 6 - but doesn’t seem to work. I’ve also tried pin 13 - but since it’s connected to the led you’d need a resistor on the circuit to make it work as a digital output - so this obviously failed. I think pin 5 and 6 should have worked - so I’m rather stuck here.

Unfortunately for the Aduino industrial pin0 and 1 are busy (not accessible) :

They are only busy if you need the AR9331 part. You didn't told us that you do need this part. Even if you need it, the ATmega32U4 and the AR9331 are also connected by SPI, so theoretically you can have both (althought the library support for this is sparse).

I've now tried to do this with SoftwareSerial on pins 5 and 6

Dont' use SoftwareSerial! If you need a software UART emulation, AltSoftSerial is the first choice (you cannot select the pins, they're fixed) or NeoSoftSerial is next. Both don't block the processor for that long as the SoftwareSerial library does.

Please post a wiring diagram of your setup and the code you use for testing.

I’ve connected pin 5 and 6 as illustrated. I’ve succeeded in receiving something sent from the Arduino Industrial now (still using software serial, as I can get to the pins of AltSoftSerial (at least the diagrams don’t suggest how). I’m not worried about time consumption yet.

However, I can’t get it to receive anything - I suspect it’s something to do with interrupts on pin 5 (and 6) - that doesn’t allow them to be used for receiving? I can’t even get it to confirm it’s listening. See one instance of my test code below. Any ideas ? [I’ve checked that there’s signal on the receiving pin, so the MAX3232 is doing it’s job]

#include <SoftwareSerial.h>

// software serial #1: RX = digital pin 13, TX = digital pin 6

SoftwareSerial mySerial(5, 6); // RX, TX

void setup() {
// initialize both serial ports:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
mySerial.begin(9600);
mySerial.listen();
// pinMode(LED_BUILTIN, OUTPUT);
Serial.println(“Testing with Laser Ranger”);
}

void loop() {
// read from port 1, send to port 0:
mySerial.println(“SA1”);
mySerial.listen();
delay(500);
if (mySerial.isListening()) {
Serial.println(“Port One is listening!”);}
delay(1000);
//Serial.println(“SA1\d”);
while (mySerial.available()>0) {
char answer = mySerial.read();
Serial.write(answer);
}
delay(500);
}

However, I can't get it to receive anything - I suspect it's something to do with interrupts on pin 5 (and 6) - that doesn't allow them to be used for receiving? I can't even get it to confirm it's listening. See one instance of my test code below. Any ideas ?

From the SoftwareSerial reference page:

Not all pins on the Leonardo and Micro support change interrupts, so only the following can be used for RX: 8, 9, 10, 11, 14 (MISO), 15 (SCK), 16 (MOSI).

Yeah, do you happen to have the equivalent information for the Arduino Industrial 101 ? Only pins 5 and 6 are easily available (on a break-out) - so it seemed like the idea to use thoses...

Yeah, do you happen to have the equivalent information for the Arduino Industrial 101 ? Only pins 5 and 6 are easily available (on a break-out) - so it seemed like the idea to use thoses...

As it uses the same processor this is the information for the Industrial 101.

BTW. the Arduino Industrial 101 store page explicitly repeats this:

You can create up to 3 SoftwareSerial ports using the pins 13, 5 and 6 for TX and 14, 15 and 16 for RX.