Dave wrote: Sun Sep 07, 2025 8:00 pm
Can an interrupt be too frequent? Even in the fastest system? Is there any case where an interrupt over, say, 8096 Hz is useful?
Of course it can. Interrupt handling is expensive, on a 68k it's 44 cycles, which is roughly 2-3 instructions (not counting the handler and the rte, and this is for auto vector interrupts. When the device provides the vector, its even worse - remember, for a 6502 its 13 cycles...). All in all, I would assume you can't write even a do-nothing interrupt handler (other than the bare necessities) using less than 200-300 cycles. With a cyclic interrupt, you're taking away these cycles from the rest of the system, effectively slowing it down.
Dave wrote: Sun Sep 07, 2025 8:00 pm
I ask this very cautiously because the creation of registers is expensive in terms of logic if the logic is to remain in scope of a modest CPLD. In an FPGA this is not a concern, but at this stage an FPGA is an excess.
The issue is I would like a divider to be set, but also an interrupt number associated with that interrupt. The flip flop cost of a 16 bit counter, a 3 bit IRQ number and an up to 8-bit vector is expensive. Limiting the system to 16 expansion cards maximum does allow a limit of 16 vectors within the possible range to be used.
Reminder: Jumpers are the cheapest registers.... And would even be "period-correct" considering what PCs did after the QL had died.
Dave wrote: Sun Sep 07, 2025 8:00 pm
This is disappointing because it limits the number of different cards that can uniquely interrupt to 4. Past that, alike cards would need to share an interrupt. I am sure if two identical cards in different slots share an interrupt, the person who develops them can write the handler to query the cards and have only the relevant one respond.
That shouldn't be much of a problem. Note the driver needs to know where in the address space the interrupting card is anyways - and detecting which of several cards triggered it is not much more work. But remember, the QL system architecture has no concept of "multiple cards the same" to occupy one single ROM space. I guess the simplest (maybe dumbest) approach would be to load two identical drivers into non-shared address space and two separate interrupts. I feel that's a waste.
Dave wrote: Sun Sep 07, 2025 8:00 pm
This does mean only one card in the group can issue an interrupt at a time. The other card would have to be held up until the first card is acknowledged and negates its own interrupt request. You can see why this isn't ideal.
Well, that is a problem if the device provides the vector, and that is why auto vectoring is so much simpler. I'm not sure a system with a QL background justifies the effort of supporting vectored interrupts.