www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/08/18/21:44:39

From: "Martin Peach" <martin AT loplop DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: COM port interrupts don't happen?
Date: Wed, 18 Aug 1999 20:34:08 -0400
Organization: Communications Accessibles Montreal, Quebec Canada
Lines: 33
Message-ID: <7pfje5$81t@tandem.CAM.ORG>
References: <199908180539 DOT IAA10495 AT ankara DOT Foo DOT COM>
NNTP-Posting-Host: dialup-674.hip.cam.org
X-Newsreader: Microsoft Outlook Express 4.72.3110.5
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Mitch Halloran says
>You might then set your MCR to activate the OUT2 line (as DTR and RTS) and
baud after setting the latch in the LCR, then enable interrupts.


Yes, that's it! Thanks a lot! OUT2 is the master interrupt enable for the
UART. Nowhere had I seen this in any documentation until I found the 82C721
data sheet which says OUT2
"is used to enable an interrupt (OUT2 pin of UART). When OUT2 = 0 (default),
the serial interrupt is forced into high impedance. When OUT2 = 1 the serial
interrupt output is enabled. Note OUT2 is an internal chip signal."
(So much for using a scope to see what's going on).
Has OUT2 always been used for this purpose?

>Then just before leaving your ISR, you should do the following:

1. signal the PIC of an end-of-interrupt (EOI)
2. make sure the OUT2 line is set in the MCR
3. finally, create an interrupt edge by setting the IER to zero after
getting
its present value, then re-setting.


I don't find any need to create an edge. The chip interrupts fine at least
for received characters by just leaving IER alone after setting the
interrupts. It might be necessary if you have multiple simultaneous
interrupts on the same chip, though, like simultaneous receive and transmit
interrupts...

\/\/\/*= Martin



- Raw text -


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