phs207k@vaxc.cc.monash.edu.au (09/17/90)
I've been trying to build some hardware external to an AT and I need this hardware to interrupt the pc at a fairly high frequency (approx 3000Hz). Now looking at the mother board manual for the 80286 I found interrupt lines 10, 11 and 12 are free on the slave 8259A PIC (pins 3,4 and 5 on the D side of the 16 bit expansion slot, although I only need two). So I stuck a wire in pin 4 (IRQ11) that is active high when interrupting and wrote a masm routine that is jumped to when the interrupt is accepted by the 8259A programmable interrupt controller (that is contained within the 82c206 Integrated Peripheral Controller). Ok, I have set up an interrupt vector at 0:1ccH in memory (the table for the slave 8259A) and I have sent commands to the 8259A slave via ports A0H and A1H to unmask the interrupt lines I want to use (OCW1). Do I need to send anything to OCW2 for end-of-interrupt ? or is the default mode ok. Now my outside hardware sends a pulse (that stays high because I haven't worked out a way yet for the computer to kill it once it has recognized the interrupt so I have to do it manually) and sure enough the pc stops executing the main program and jumps off and executes the interrupt routine and even returns to the main program. PROBLEM : After the interrupt has finished the computer refuses to accept any more interrupts from my hardware. Even if the main program terminates successfully, on going back into DOS and trying to use the hard disk (which uses IRQ 14 on the same 8259) the computer crashes. Now multiple interrupts from my stuff shouldn't really be a problem because the interrupt enable flag is cleared automatically in the interrupt routine. I'm basically trying to understand what has been affected to stuff things up when the interrupt has been executed and comes back to the main program. The setting up of the actual int. vectors and the int. mask and checking IS and IR registers in the 8259 do not worry it (ie. I can run the setup program and not crash anything as long as I do not do an actual interrupt). So what is the trick? I have followed all the instructions I can find and tried everything I can think of. What is so hard about getting something outside the PC to interrupt it, run a little program, and then go on with what it was doing? I you need more information then just mail me and I'll be happy to pour out my troubles to you but for me time is running out. HELP!
dgl292@pallas.athenanet.com (Doug Lee) (09/22/90)
In article <46762.26f56b86@vaxc.cc.monash.edu.au> phs207k@vaxc.cc.monash.edu.au writes:
[about his problems with externally-generated interrupts on an AT...)
You asked if you should send anything to the master interrupt controller
for EOI. In my experience, for interrupts above IRQ7, it seems to be
necessary to send a 20h to both ports (20h and A0h). Sending to only one
caused quite an array of bizarre results.
Another caveat (which you may already know): some BIOSes have the annoying
habit of masking "unusual" interrupts when they are called. The result is
that, if your routine chains to anything previously hooking that interrupt,
the chain may well reach BIOS, which may stifle any further interrupts.
Hope this helps.
Doug Lee (dgl292@athenanet.com or uunet!pallas!dgl292)