Article View: comp.os.msdos.programmer
Article #3549Re: Serial Driver Problem
From: Patrick Klos
Date: Tue, 10 Nov 1992 12:19
Date: Tue, 10 Nov 1992 12:19
56 lines
2896 bytes
2896 bytes
In article <1992Nov10.015504.21169@speedy.aero.org> don@surtsey.aero.org (Don C. Hancock) writes:
>From: don@surtsey.aero.org (Don C. Hancock)
>Subject: Serial Driver Problem
>Date: 10 Nov 92 01:55:04 GMT
>Serial Driver Problem
>
>I hope this is the right place for this. If not, please
>let me know.
>
>I'm trying to program the serial port to control some equipment. I
>can't seem to get it (i.e. the port) to generate interrupts (such as
>the data received, or transmitter empty)
>
>What am I doing wrong?
>
>Here's what I've done so far (briefly, sort of).
>
>1. Replaced vector 0x0c with my interrupt service routine. I'm
>pretty sure this right, because a geninterrupt(0x0c) gets to my
>routine.
>
>2. Set up the serial port to interrupt on everything but the modem
>status change by writing 0x07 to the interrupt enable register.
>
>3. Set 8259 interrupt controller to enable interrupts from IRQ3
>and IRQ4 with outp(0x21, inp(0x21) & 0xe7);
>
>4. End my interrupt service routine with outp(0x20, 0x20).
>
>When I do a write followed by a read, I get the data I sent. I've done
>this using the loopback feature (set bit 4 of the modem control
>register) and by wiring pins 2 & 3 together, so the connections are
>right. I've also done the above for the second serial port, I just
>can't get the hardware to generate interrupts.
>
>Any ideas. I'll post (or email) code if it'll help me get an answer.
>Please email or post any replies (but email is preferred).
>
>Thanks for any help you can give me. I'm really troubled by this. I'm
>sure I'm doing something dumb here.
>
>Don
You forgot one critical element... and now I can't recall it completely
myself. Anyway, the Modem Control Register (I think that's what it's
called) allows you to control 4 signals: Data Terminal Ready (DTR), Request
To Send (RTS), OUT1 and OUT2. Now it's coming back to me... the modem
control register is I/O base+4 (03fcH in your case). In order for the
controller to generate an interrupt, you MUST set OUT2 (which is bit 3) to
one. I'm sure that will solve your problem!
Good luck!
========================================================================
Patrick Klos Internet: klosp@rimail.interlan.com
Klos Technologies, Inc. Compuserve: 71521,145
(603) 424-0138
========================All opinions are my own!========================
Technical Details
Message-ID:
<klosp.30.721397974@rimail.interlan.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!interlan.InterLan.COM!rimail.interlan.com!klospReferences:
<1992Nov10.015504.21169@speedy.aero.org>Show Full Headers
Complete Article Headers
Newsgroups: comp.os.msdos.programmer Path: arc1-ca.pugleaf.net!sparky!uunet!interlan.InterLan.COM!rimail.interlan.com!klosp From: klosp@rimail.interlan.com (Patrick Klos) Subject: Re: Serial Driver Problem Message-ID: <klosp.30.721397974@rimail.interlan.com> Lines: 56 Sender: news@Interlan.com Organization: Klos Technologies, Inc. (603) 424-0138 References: <1992Nov10.015504.21169@speedy.aero.org> Date: Tue, 10 Nov 1992 12:19:34 GMT