[comp.sys.amiga.tech] Interrupt Server, Parallel port

phil@eos.UUCP (Phil Stone) (04/28/88)

I have built a UART interface that connects to the A-1000 parallel
port. (I've gone through this hell so I could have an RS-232 port *and*
a MIDI port running concurrently).  I think I've got everything ready to
go on the software end except dealing with interrupts.

I understand that I will have to add an interrupt server to the chain that
is already attached to the 8520 (called "PORTS", I think).  I have set up
my UART to assert the "FLAG" interrupt on the 8520, but my question is,
how do I check this bit in the interrupt register without clearing the
whole register?  Actually, since somebody higher up in the chain (timer
interrupts, for example) already had to check this register, it must
*already* be cleared (it automatically clears on reading).

Perhaps the PORTS server passes this register along somehow, but if it
does, I have no way of knowing.  As far as I can tell, the system
interrupt servers are undocumented (correct me if I'm wrong - I've got
the original "white" manual set).

Can anybody help?  Thanks in advance, especially if you can get a reply
(email or post, your judgement on generality of interest) to me before
the weekend.

Phil Stone
phil@eos.arc.nasa.gov
phil@eos.UUCP
{ uunet, hplabs, hao, ihnp4, decwrl, allegra, tektronix } ames!eos!phil

dillon@CORY.BERKELEY.EDU (Matt Dillon) (04/29/88)

>I understand that I will have to add an interrupt server to the chain that
>is already attached to the 8520 (called "PORTS", I think).  I have set up
>my UART to assert the "FLAG" interrupt on the 8520, but my question is,
>how do I check this bit in the interrupt register without clearing the
>whole register?  Actually, since somebody higher up in the chain (timer
>interrupts, for example) already had to check this register, it must
>*already* be cleared (it automatically clears on reading).

	Exactly.  There is *Nothing* you can do!  You can't read the
register manually because it will screw up all the other servers on
the chain, meaning that you *MUST* use FLAG as an interrupt only.

	Also, note that PC/FLAG is activated/acknowledged by a read
or write to (port B?) and you can't get around that either.

>Perhaps the PORTS server passes this register along somehow, but if it
>does, I have no way of knowing.  As far as I can tell, the system
>interrupt servers are undocumented (correct me if I'm wrong - I've got
>the original "white" manual set).

	If you set up your server to work with the FLAG interrupt, the
server will be run when a FLAG interrupt occurs.  Perhaps I am 
confused as to your use of the line.  If you want to use FLAG as a
digital input, you can't.  Also, if you are trying to receive serial
data on the line, good luck... the timing is too critical to be able
to do it with an interrupt on that chain.

>phil@eos.arc.nasa.gov

			-Matt

bryce (Bryce Nesbitt - Acting Ensign) (05/04/88)

In article <631@eos.UUCP> phil@eos.UUCP (Phil Stone) writes:
|I have set up
|my UART to assert the "FLAG" interrupt on the 8520, but my question is,
|how do I check this bit in the interrupt register without clearing the
|whole register?

You don't.  At least not directly.

One solution would be to get MOS technology to change the 8520, and
then send out free updates to every Amiga owner.  A quick chat with the MOS
director of stratigic marketing, and midnight exchange of
Gold, Platinum, or other precious metal and you will be all set. :-)

Or perhaphs you want a slightly cheaper solution?  Try this:

The system already has to deal with multiple interrupts from this
chip.  The "ciaa.resource" and "ciab.resource" have mechanisms for
doling out the proper IRQs to the proper handlers.  Get out your
Captain Amiga secret documentation decoder ring, and start compilin'.
.

		-Bryce