BigDumbDinosaur wrote:
What the priority encoder is doing is producing an eight bit index.
So your ISR would start by pushing the registers as required and then loading the interrupt index into, say, .X.
Sorry, the ISR isn't involved.From what I have figured so far, the basic idea of the schematic from the Synertek manual seems to be
to decode when the CPU reads the memory addresses in the ROM which contain the IRQ vector.
If the CPU reads those two Bytes in memory (while responding to an IRQ for instance),
a 4 Bit 2:1 multiplexer is used for tweaking some of the address lines to make the CPU read
from different memory locations.
The priority encoder then selects from which memory locations the IRQ vector is fetched
according to the IRQ level.
Quote:
Don't forget that upon responding to an IRQ the MPU will do the equivalent of an SEI instruction
after it pushes PC and SR, thus preventing the pending interrupt from being interrupted by another IRQ source.
True, but unfortunately this doesn't affect the priority encoder.For instance, if /IRQ6 at the 74148 priority encoder input is active, and the CPU starts fetching
the IRQ6 vector, it reads the low_Byte of the IRQ6 vector.
If /IRQ7 goes active shortly after the CPU has fetched the low_Byte of the IRQ6 vector,
the encoder would generate the address for fetching the high_Byte of the IRQ7 vector,
because IRQ7 has a higher priority than IRQ6.
Would suggest to place a 74574 latch clocked by SYNC at the inputs of the priority encoder,
this probably would fix this problem and the 74148 would have nearly one CPU clock cycle of time
(minus SYNC setup time and the other setup and propagation delay times etc.) for decoding.
// Maybe 74573 might work, too... somebody please post the schematic after building something like that.
Quote:
Incidentally, priority encoders are relatively slow devices, as they have a lot of gates.
Priority encoding is a good job for a PLD.
A simple GAL\PAL probably would do.
74F148 seems to be out of production, and there seems to be no 74AC\ACT148.
BTW: maybe 20ns propagation delay at 5V for a 74HC148 from TI.
But another problem is to decode when the CPU tries to read the memory addresses containing the IRQ vector.The 74688 comparator is quite slow, and it isn't available as AC\ACT.
7430 eight input NAND gate is available as ACT, namely the 74ACT11030, but there seems to be no 74AC version of the 7430.
74133 (13 input NAND) only seems to be available as ALS.