Go Down

Topic: maxrs232 softwareserial never detected (Read 1 time) previous topic - next topic

Akubra

I have attached a maxrs232 board to my Uno, hooked it up as follows:
Uno RX pin (10) - maxrs232 TX
Uno TX pin (11) - maxrs232 RX
Gnd/3.3v


#include <SoftwareSerial.h>
SoftwareSerial softSerial(10, 11); // RX, TX

void setup()
{
softSerial.begin(4800);
}

void loop()
{
  if (softSerial.available()) {
    Serial.println("Soft Serial available");
  }
}

But available() never becomes true.


robtillaart

have you tried switching the lines?
can you post a datasheet of the - maxrs232 board -
which version of the IDE do you use?
which version of software Serial?
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

AJITnayak

Change baudrate to,9600.
just do this

Code: [Select]


#include <SoftwareSerial.h>
SoftwareSerial softSerial(10, 11); // RX, TX

void setup()
{
softSerial.begin(9600);
}

void loop()
{
  softSerial.println("hello");
delay(1000);
}

AMPS

Akubra

#3
Sep 13, 2014, 09:13 am Last Edit: Sep 13, 2014, 09:51 am by Akubra Reason: 1
Thanks both of you for the reply. Had to change the rx/tx lines on the maxrs232 (pins incorrectly labelled) and set the baudrate to 9600. After that, maxrs232 is detected.

However, when I connect a cable up to the maxrs232 and use the read() command, it only returns a value of 255.


Robin2

Google does not know what a maxrs232 board is - you must not have the name exactly right - post a link to the datasheet of your device.

My undersatanding is that a Max 232 is intended to bridge between a serial TTL connection and proper RS232 device.

You have not told us what is on the other side of your max 232 to send or receive data to/from the Arduino.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

robtillaart


Thanks both of you for the reply. Had to change the rx/tx lines on the maxrs232 (pins incorrectly labelled) and set the baudrate to 9600. After that, maxrs232 is detected.

However, when I connect a cable up to the maxrs232 and use the read() command, it only returns a value of 255.

255 means there is no data available. Use the Serial.available()  function to get the amount of chars in the input buffer.

Code: (snippet) [Select]
if (Serial.available() > 0) c = Serial.read();
else c = '';
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Akubra

All, sorry for the type: it is a max3232 board.

Board details in the following thread:
http://forum.arduino.cc/index.php?topic=266582.msg1879720#msg1879720

Thanks,
Mike

Go Up