Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!snorkelwacker.mit.edu!ira.uka.de!smurf!incom!orfeo!jrix!joachim From: joachim@jrix.radig.de (Joachim Riedel) Newsgroups: comp.os.coherent Subject: Re: Catching COM port interrupts Keywords: COM Message-ID: <1991May03.051405.18412@jrix.radig.de> Date: 3 May 91 05:14:05 GMT References: <1704@richsun.cpg.trs.reuter.com> Organization: Joachim Riedel, Offenbach, West Germany Lines: 44 marke@richs118.cpg.trs.reuter.com (Mark Ellis) writes: >Also, I don't really understand the different device drivers for the com >ports. >According to the manual, each port has corresponding drivers for polled mode or >interrupt driven mode. Well, where to the interrupts go when they occur? It's difficult to describe if you are a foreign non english speaking guy but I will try it: Interrupt mode: The UART (8250 / 16450) is initialized for interrupt mode. That means: if a character is received, a hardware signal is is given to to the interrupt controller chip (IRQ 3 (COM2) or IRQ 4 (COM1)) and this chip tells the CPU that it is now time to start an Interrupt service routine This routine will be called and gets the character from the UART. ALso the other way round is possible, that means after sending a character an interrupt is issued if the UART is ready for the next one to send. Polled mode: The UART has several register with several status bits. One bit says if the UART has a character received. In polled mode you continually control this bit "character arrived ?" and then you will get the character from the receive register. For 9600 Baud you have to poll the UART 960 times a second. If only 10 characters at 9600 Baud arrive you polled 950 times just for fun. So polled mode is a waste of cpu time. Interrupt mode is the better solution. > Is there any way to catch com port interrupts for reading the com port > when data is present rather than polling the port? I was hoping to find No Ideas, don't think that there are now such signals you asked for. Maybe when you modify the source for the driver. Joachim +---------------------------------------+-------+-------------------+-------+ | Joachim Riedel | @ @ | Don't worry, | @ @ | | Geschwister-Scholl-Strasse 48 | \_/ | keep smiling | \_/ | | D-6050 Offenbach am Main +-------+-------------------+-------+ | Tel. +49 69 85 62 25 | joachim@jrix.radig.de | +---------------------------------------+-----------------------------------+