🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.os.msdos.programmer
2 messages
2 total messages Started by Russell Trotter Thu, 07 Jan 1993 14:40
Serial Communication Question
#7504
Author: Russell Trotter
Date: Thu, 07 Jan 1993 14:40
21 lines
1467 bytes
Hello,
 
  A few days ago, my boss posted a question needing some info
on setting up/initializing the com port and read/write howto's.
After digging through the code we got from replies, we found that the best way 
to do this was to use some code that would actually access
the UART? directly, install an interrupt handler for the 
Data Available Interrupt.  Now, the problems we had came from
the fact that the original code we got, checked not only for
the Data Avail. Int, but also the Modem Status Int and the Receiver
Line Status Int.  In test runs, when these to interrupts were handled,
our little 'teeny terminal' program hung.  However, when these two
status ints were 'ignored' (by unsetting them in the Int. Enable Reg.)
then things went fine. (i.e. we could dial up some place, log in,
do a few directory listings).  My question is, what, precisely, are these
status interrupts for, and are they absoultely necessary?  I'm
no PC techie, which is why I ask the Real PCers' (c.o.m.p ) :) 

Thanks for any help.

Russ
Re: Serial Communication Question
#7540
Author: Marko Kohtala
Date: Fri, 08 Jan 1993 18:30
52 lines
2681 bytes
In <1993Jan7.144009.10363@panther.mot.com> asu@server2.panther.mot.com (Russell Trotter) writes:

>Hello,
> 
>  A few days ago, my boss posted a question needing some info
>on setting up/initializing the com port and read/write howto's.
>After digging through the code we got from replies, we found that the best way 
>to do this was to use some code that would actually access
>the UART?

Yes. If you do not want to access the UART directly, you can get a
FOSSIL device driver that does it for you and use the FOSSIL. Most BBS
programs use this approach.

Two popular FOSSIL device drivers are X00 and BNU. They come with all
the necessary API documentation.

>My question is, what, precisely, are these
>status interrupts for, and are they absoultely necessary?

Receiver Line Status
	Source: Overrun, Parity or Framing error or Break
	Reset: Read the LS register

Modem Status
	Source: Clear to Send or Data Set Ready or Ring Indicator or Data
		Carrier Detect. 
	Reset: Read the MS register

They are not absolutely necessary. Modem Status can be used to
implement hardware flow control: change in Clear to Send causes an
interrupt and if it is set, the interrupt routine should start to
transmit if there is data in the transmit buffer.

Also, for these to work, you must make sure that the interrupt
conditions are reset. The thing to do to reset is shown above. If you
do not reset the interrupt, it will stay on and there will not be
another interrupt on AT bus. In MCA I think it will cause the
interrupt handler to be called constantly untill the interrupt is
reset thus hanging the machine.

Received Data interrupt can be reset by reading the Receive Buffer
register. Transmitter Holding Register Empty interrupt can be cleared
by reading IIR or writing to THR.

If you have any problems, I am willing to write you a tailored comm's
module for a reasonable compensation. I have written the one used in
Telemate communications program. 
-- 
---
Marko Kohtala - INTERNET:Marko.Kohtala@hut.fi, mkohtala@otax.tky.hut.fi
Student at (not representative of) the Helsinki University of Technology
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads