delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/09/10/12:30:23

From: default <@res.raytheon.com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: More Q's about IRQs
Date: Thu, 10 Sep 1998 10:34:14 -0400
Organization: Raytheon Electronic Systems
Lines: 139
Message-ID: <35F7E365.A765E58A@res.raytheon.com>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 980910110155 DOT 8510C-100000 AT is>
NNTP-Posting-Host: neomar1.res.ray.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

--------------D43330DE39474D884A44BA85
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit



Eli Zaretskii wrote:

> On Wed, 9 Sep 1998 default AT  DOT MISSING-HOST-NAME. wrote:
>
>
> Of course the wrappers don't issue EOI!  How can they?  For starters, the
> wrapper doesn't know which IRQ are you hooking, and the EOI code differs
> depending on whether you use IRQ0-IRQ7 or IRQ8-IRQ15.  Also, the
> programmer could decide not to EOI the PIC from the handler, but from
> some other point in the program, and the wrapper has no buisness
> second-guessing that.

Hey, relax. I issue a general EOI to clear all ints. I just wasn't sure how
automatic the _go32 routines were.

> Interrupt-driven transmitting is tricky.  Please post the code that
> initializes the UART, the key to this mystery might be there.

 The big problem is not the Initialization, everything works fine in real
mode, the problem is converting the code to PM. The only initialization
concern is whether or not loopback mode is enabled (which it isn't) anyway,
because Tx and Rx are tied together, which means data out goes straight to the
data in buffer on the same chip, so that the parameters(whatever they may be)
are the same. The interrupt only seems to be responding when I physically read
the port from the main program with an iniob(COM_BASE). It is also evident
that more than one interrupt is being generated for every port read I perform.
It just seems like there is some subtle point that I'm missing in declaring
the PM interrupt. Maybe my main loop is performing a mode switch somewhere?
Would that do it? Anyways, I'll post it again. Thanks for trying to help.

<MAIN()_CODE_FRAGMENT>
 int i = 0x00;
 while(kbhit() == 0) {
  if(bufrdptr != bufwrtptr) {    /* i.e. if data has been written to
buffer since last read*/
   gotoxy(5,5);
   cprintf("com_buffer:%s\n\r", com_buffer[bufrdptr]);
   bufrdptr = (bufrdptr < 0x400) ? (bufrdptr + 1) : 0;
  }
  gotoxy(10,10);
  cprintf("Read: % 3d  Write: % 3d", bufrdptr, bufwrtptr);
  delay(100);
  gotoxy(10,11);
  cprintf("Writing % 2d to port\n\r",i);
  outportb(BASE, i);
  gotoxy(10,12);
/*************************************************************/
/* here is the magic mystery: */
 cprintf("Reading Port % 2d \n\r", inportb(BASE));   /* note BASE =
0x3F8*/

/*************************************************************/
i += (i < 0xFFF) ? 1 : 0;
  }

<\MAIN()_CODE_FRAGMENT>





--------------D43330DE39474D884A44BA85
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<HTML>
&nbsp;

<P>Eli Zaretskii wrote:
<BLOCKQUOTE TYPE=CITE>On Wed, 9 Sep 1998 default AT  DOT MISSING-HOST-NAME. wrote:
<BR>&nbsp;

<P>Of course the wrappers don't issue EOI!&nbsp; How can they?&nbsp; For
starters, the
<BR>wrapper doesn't know which IRQ are you hooking, and the EOI code differs
<BR>depending on whether you use IRQ0-IRQ7 or IRQ8-IRQ15.&nbsp; Also, the
<BR>programmer could decide not to EOI the PIC from the handler, but from
<BR>some other point in the program, and the wrapper has no buisness
<BR>second-guessing that.</BLOCKQUOTE>
Hey, relax. I issue a general EOI to clear all ints. I just wasn't sure
how automatic the _go32 routines were.
<BLOCKQUOTE TYPE=CITE>Interrupt-driven transmitting is tricky.&nbsp; Please
post the code that
<BR>initializes the UART, the key to this mystery might be there.</BLOCKQUOTE>
&nbsp;The big problem is not the Initialization, everything works fine
in real mode, the problem is converting the code to PM. The only initialization
concern is whether or not loopback mode is enabled (which it isn't) anyway,
because Tx and Rx are tied together, which means data out goes straight
to the data in buffer on the same chip, so that the parameters(whatever
they may be) are the same. The interrupt only seems to be responding when
I physically read the port from the main program with an <I>iniob(COM_BASE).
</I>It is also evident that more than one interrupt is being generated
for every port read I perform. It just seems like there is some subtle
point that I'm missing in declaring the PM interrupt. Maybe my main loop
is performing a mode switch somewhere? Would that do it? Anyways, I'll
post it again. Thanks for trying to help.

<P>&lt;MAIN()_CODE_FRAGMENT>
<BR>&nbsp;int i = 0x00;
<BR>&nbsp;while(kbhit() == 0) {
<BR>&nbsp; if(bufrdptr != bufwrtptr) {&nbsp;&nbsp;&nbsp; /* i.e. if data
has been written to
<BR>buffer since last read*/
<BR>&nbsp;&nbsp; gotoxy(5,5);
<BR>&nbsp;&nbsp; cprintf("com_buffer:%s\n\r", com_buffer[bufrdptr]);
<BR>&nbsp;&nbsp; bufrdptr = (bufrdptr &lt; 0x400) ? (bufrdptr + 1) : 0;
<BR>&nbsp; }
<BR>&nbsp; gotoxy(10,10);
<BR>&nbsp; cprintf("Read: % 3d&nbsp; Write: % 3d", bufrdptr, bufwrtptr);
<BR>&nbsp; delay(100);
<BR>&nbsp; gotoxy(10,11);
<BR>&nbsp; cprintf("Writing % 2d to port\n\r",i);
<BR>&nbsp; outportb(BASE, i);
<BR>&nbsp; gotoxy(10,12);
<BR>/*************************************************************/
<BR>/* here is the magic mystery: */
<BR>&nbsp;cprintf("Reading Port % 2d \n\r", inportb(BASE));&nbsp;&nbsp;
/* note BASE =
<BR>0x3F8*/

<P>/*************************************************************/
<BR>i += (i &lt; 0xFFF) ? 1 : 0;
<BR>&nbsp; }

<P>&lt;\MAIN()_CODE_FRAGMENT>
<BR>&nbsp;
<BR>&nbsp;
<BR>&nbsp;
<BR>&nbsp;</HTML>

--------------D43330DE39474D884A44BA85--

- Raw text -


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