[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RS-485 vs 232

Hi there,

Is there a difference (in software) between reading data from serial 3
(485) or serial 0 or 2 (232).
I have a program capturing binary data from serial 0 or 2.
If I switch to serial 3, CR and LF (0x0D and 0x0A) are replaced in the
data. I have the port opened in raw mode. This is the code for setting
the COM port options

// Set baudrate to 115k2


// Enable the receiver and set local mode
options.c_cflag |= (CLOCAL | CREAD);

// Set character size to data bits and set no parity Mask the characte
size bits
options.c_cflag &= ~(CSIZE|PARENB);
options.c_cflag |= CS8;		// Select 8 data bits

// Disable hardware flow control
options.c_cflag &= ~CRTSCTS;
options.c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);
// Disable software flow control
options.c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP

options.c_oflag &= ~OPOST;
// Timeout 0.1 sec for first byte, read minimum of 25 bytes
options.c_cc[VMIN]     = 0;
options.c_cc[VTIME]    = 1;

// Set the new options for the port

Any suggestions to what may be my problem?