delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/09/16/08:15:17

From: neil AT robots DOT ox DOT ac DOT uk (Neil Townsend)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: More Q's about IRQs
Date: Wed, 16 Sep 1998 12:05:33 GMT
Organization: None evident here.
Lines: 39
Message-ID: <1998Sep16.120533.6911@catorobots.ox.ac.uk>
References: <35F703E7 DOT AE7F8896 AT res DOT raytheon DOT com>
NNTP-Posting-Host: cato.robots.ox.ac.uk
NNTP-Posting-Date: 16 Sep 1998 12:05:36 GMT
Originator: neil AT cato
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

In comp.os.msdos.djgpp default <@res.raytheon.com> writes:
>Okay, here's the story.
>I have written an ISR to service an HW interrupt generated by Com Port 1
>on a Pentium PC.
>I have set up the port in the conventional manner, ie:
>(Note that this configuration has been proven to work fine in RM.)
>-9600-8-1-n,
>-system interrupts enabled through OUT2 based on DataReady.
>-HW setup: I've simply tied pins 2&3 together to route outbound data
>inbound.
>
>Now I want to do it in PM.
>The interesting part comes when I actually hook the protected mode
>interrupt and try to get the port to respond.
>
>_However_, when I read the port directly from my main program, the
>interrupts suddenly start working, my variable is incremented, and the
>"write - head" of my serial-in data ring buffer accelerates compared to
>the "read - head" of the same buffer, indicating that the interrupts are
>being generated properly. Here is the code fragment from main():

I may have missed the mark here, but I suspect that your counter does in
fact increment, but only once. From memory, the UART will not issue a second
data to read interrupt until (a) the first one has been acknowledged
(which you say you're doing) _and_ (b) the data byte is read (which you only
do in the working version your main programme, as described above).

So, I would suggested reading the byte to be read in the interrupt, and see
if that solves the problem.

Incidentally, why not use one of the available serial packeges (Dim's dzcomm
or Bill's bcserio) as a base rather than doing all the hard work from
scratch?

Neil


-- 
Neil Townsend   +44 (1865) 273121   neil AT robots DOT ox DOT ac DOT uk

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019