in reply to Writing to serial port with a delay between each character
I am writing to an embedded system over a serial port. The system is extremely limited and writing to it any faster than 50ms per character causes data to be dropped/lost. ... What I believe is happening is that each character gets buffered and finally the entire string gets spit out to the serialport at once, which of course cannot respond fast enough.
It seems your embedded system does not use any kind of handshake, telling the "big" system that it can't handle more data. RTS/CTS and XON/XOFF can be handled in hardware or by the OS, so everything would be completely transparent to your application. In the worst case, the OS would tell you it could deliver only n bytes, when you wanted to write m bytes (with n < m). In that case, you would have to try writing the remaining bytes again. (Any serial I/O library should handle that for you.)
Try enabling (or adding) handshaking at RS232 level and all your problems should be gone. If the embedded device can handle really slow RS232 speeds, try connecting at a low speed, eg. 300 or even 75 bits per second. This should at least reduce your problem.
Alexander
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Writing to serial port with a delay between each character
by sidthakur (Initiate) on Apr 21, 2009 at 20:56 UTC |