Re: pl2303.c and the pin status

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

 



On 22/03/2012 10:08 AM, Alan Stern wrote:
On Wed, 21 Mar 2012, Gerald Villemure wrote:

Alternatively, why not write a program that opens the serial port and
provides an easy interface for reading and writing the values of the
line settings (or are these the modem settings? -- I never can remember
which are which).

Alan Stern
Actually there is a program like this called statserial. Its an easy
install in debian.

You can see an example of it here:
http://dereenigne.org/computers/linux/statserial
Does statserial give you a way to change the settings as well as view
them?  You need to do both.

Its read only.
The problem is that by simply calling up the program you alter RTS and DTR

At this point there is no way, at least to my knowledge, to simply query
the status of the RTS/DTS pins.
There's a simple solution to that problem.  Just start running
statserial (or whatever program you like) _before_ plugging anything
into the serial port.  Then you can set RTS and DTR to their proper
values right away and afterwards watch what happens.
You are correct.  But its not very practical for production use.

Most people use a windows program called RealTerm for playing with the Serial port pins. Which for debugging is fine. But I would prefer to have the final product work under Linux

(However, I suspect you won't be able to use the serial port in
another program while statserial is running.  Maybe that's okay for
what you want to do.)

Actually the TIOCMSET call works even when statserial is running so its not blocking.

Alan Stern



I think we need to separate 2 distinct issues here:

1. The inability to read the pin status without altering the status of DTR/RTS
2. The simplification of working with the pins.

Issue 1 is somewhat of a show stopper for some projects but fixing this by itself would likely create more problems than it fixes. In truth, this issue is NOT where I want to focus my attention.

Issue 2 is about finding a long term solution to this particular need that home based electronic projects have. I realize that using the pins on a RS232 port as a simple form of IO is a strange and unexpected use of the technology, but we could say that for much of what we use today.


Gérald
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux