A program in c using termios works well if the port is ttyusb0, but misses/garbles data if got through ttys0 i.e comport com1.
proogram runs under ubuntu 9.04 & 10.04
Please suggest the remedies cause for this discrepancy.
A program in c using termios works well if the port is ttyusb0, but misses/garbles data if got through ttys0 i.e comport com1.
proogram runs under ubuntu 9.04 & 10.04
Please suggest the remedies cause for this discrepancy.
Garbled serial data is usually due to using the wrong serial speed. The default might be different for the usb port vs normal serial port. Are you calling cfsetispeed
and cfsetospeed
?
Are you using the same serial cable for both tests? At higher baud rates, a bad cable can result in noise. If ttyusb0
has a short cable between the USB adapter and the device, but ttyS0
is a long ribbon cable, you'd easily see noise on ttyS0
but not ttyusb0
.