Mail Archives: djgpp/1998/09/16/08:15:17
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 -