From: Chuck Messenger <chuckm@rochester.rr.com>
To: linux-serial@vger.kernel.org
Subject: DTD required (was Re: Trouble reading from my serial device (a microcontroller))
Date: Thu, 20 Nov 2003 16:13:06 -0500 [thread overview]
Message-ID: <bpja5d$mua$1@sea.gmane.org> (raw)
In-Reply-To: <11E89240C407D311958800A0C9ACF7D1A34048@EXCHANGE>
Thanks, Ed.
I just got done trying out connecting DCD to +12 before reading your
message - it did the trick.
I did not call open() with O_NONBLOCK, but open() did not hang. The
documentation I've read suggests that open() would hang in this case,
without DCD, but since I found that open() didn't hang, I figured DTD
wasn't necessary.
I guess the documentation is wrong.
Thanks for the fast response!
On another note: why should the Linux device driver require DTD to be
on? This seems like a bad design -- surely it should be controllable
via tcsetattr() or an ioctl or something...? And, it would be useful if
the requirement was documented.
- Chuck
Ed Vance wrote:
> On Thu, Nov 20, 2003 at 11:23 AM, Chuck Messenger wrote:
>
>>I'm unable to read from a serial device under Linux (Mandrake 9.1,
>>2.4.21-0.13mdk kernel), but the device works find in Windows. I'm
>>hoping someone can offer me suggestions.
>>
>>My device is a Basic Stamp microcontroller, which I've programmed to
>>spit out a certain byte continuously -- 0x40 -- at 38400
>>baud,n,8,1. The
>>device loops RTS back to DSR (i.e. it connects pins 6 and 7
>>of the 9-pin
>>serial connector -- DSR and RTS). Other than that, only Rx
>>and Tx are
>>connected (and ground, of course).
>>
>>I know the hardware works (both controller and PC), because I
>>can boot
>>Win2k on the same machine and run a short program I wrote which
>>continuously dumps to the console whatever comes in.
>>
>>Also, I know that things are _basically_ configured right, in
>>my Linux
>>boot, since I can run "statserial /dev/tts/0", which shows, in real
>>time, the status of the DSR line. When I unplug from my device, DSR
>>goes low; when I plug it back in, DSR goes high.
>>
>
> [snip]
>
>>However, the program fails to read any bytes -- it hangs at
>>the read().
>>
>>I've tried running serlook, but that, too, failed to see any bytes.
>>
>>Any suggestions?
>>
>>I've tried 9600 baud instead of 38400 -- still no luck (although it
>>works under Win2k).
>>
>>Poking around, I've seen mention of the DCD control line --
>>could that
>>be the problem (i.e. does the Linux serial driver require it,
>>somehow?
>>I don't have it hooked up.)
>>
>
> Hi Chuck,
>
> Your program works fine on my Red Hat 7.3 setup. A difference is that all of
> my modem status lines are driven. (could not find my breakout box) Try
> connecting your serial port's DTR output to its DCD input. Perhaps the
> program is hanging on the open instead of the read, because DCD is detected
> low and you are not opening with O_NONBLOCK (or O_NDELAY).
>
> cheers,
> Ed
> -
> To unsubscribe from this list: send the line "unsubscribe linux-serial" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
next prev parent reply other threads:[~2003-11-20 21:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-11-20 20:42 Trouble reading from my serial device (a microcontroller) Ed Vance
2003-11-20 21:13 ` Chuck Messenger [this message]
-- strict thread matches above, loose matches on Subject: below --
2003-11-20 21:38 DTD required (was Re: Trouble reading from my serial device ( a microcontroller)) Ed Vance
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='bpja5d$mua$1@sea.gmane.org' \
--to=chuckm@rochester.rr.com \
--cc=linux-serial@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.