Re: Is blocking I/O possible with 3-wire RS232?
Re: Is blocking I/O possible with 3-wire RS232?
- Subject: Re: Is blocking I/O possible with 3-wire RS232?
- From: David Leimbach <email@hidden>
- Date: Tue, 5 Jan 2010 07:59:48 -0800
In general I think the answer to your question is yes. IO on a serial port blocking is a function of data being ready or not at the kernel to be read from the application space. At least with other systems I've programmed on, 3 wire serial is not a show stopper for blocking IO.
If there's no pins in your cable for the DSR, how is this causing you problems unless you need the data, or the other side needs the data on that pin? I would expect the DCD would be used for detecting presence or nonpresence of a device, not so much the DSR, although I guess I can imagine some instances of that as well. You may have to have a pull up resistor in order to keep that from floating around while you're working. I've had this problem with DCD on a Raritan power stip interface, when connecting to it with a 3 pin interface that someone had made that had more than 3 pins pinned out. Nothing like a 16 foot antenna to make voltages float around :-).
That said, that's got nothing to do with your software issues, however the software is likely not at fault here.
Whether or not you disregard the DSR signal in your software, you may need to fix the floating voltage problem on the other end if there is one.
You're going to have to measure! Get out your voltmeter. :-)
Dave
On Tue, Jan 5, 2010 at 6:49 AM, Michael Ellis
<email@hidden> wrote:
Hi folks.
I am writing a program that communicates with an 8-bit, 64K computer. The communication protocol is similar enough to RS232 that it is possible to build a cable based on a USB-Serial project board and TTL-level signals. In my case, I have built such a cable, and I am able to use it to communicate with the remote machine successfully.
The problem I am having is in configuring my software to work with other cables that wire the DSR input to an out-of-band signal. That is to say, some people are using cables that have an unrelated signal wired to the DSR input, and this seems to case trouble for my software. From what I can tell, the serial communication driver perceives that the remote device "comes and goes" as the signal level changes on the DSR input.
The documentation for programming serial ports suggests that opening the tty device-file with the FNODELAY argument will cause DSR signal to be disregarded, but doing this requires aggressive polling (in the form of repeated read() calls) that negatively affects the performance of my application. Furthermore, I cannot simply call read(), sleep() for a quantum, and then rely on the serial buffer to catch any data the arrives in the meantime because the remote computer has very tight timing requirements. The remote computer requires that responses to commands arrive within a very narrow time window.
So, my fundamental question is this: "Is there a way to configure a serial port to disregard the DSR input altogether and still have it perform blocking I/O?"
Thanks for your thoughts.
=========================
Michael F. Ellis
President
Ellis Softworks Inc.
----------
Phone: (941) 713-0361
Email: email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden