Since day zero, VPB output tempted me to do something interesting with it
I don't have access to my workbench SBC at the moment to probe VPB, so I decided to do some brainstorming with my favorite circuit emulator while making some assumptions about how dose VPB really work.
According to WDC 65C02 datasheet,
Quote:
The Vector Pull (VPB) output indicates that a vector location is being addressed during an interrupt
sequence. VPB is low during the last interrupt sequence cycles, during which time the processor reads the
interrupt vector. The VPB signal may be used to select and prioritize interrupts from several sources by
modifying the vector addresses.
Here's the virtual problem I'm solving here, for fun and science: imagine we have 8x 6522 VIAs (yikes!) and we want to service them without having to poll each VIA when the IRQ line is pulled low.
My solution is:
- Peripheral IRQ lines are encoded into 3-bit address using '148
- VPB enables ROM that contains ISR addresses (6502 fetches ISR vector address in 2 cycles, so a D trigger tracks current byte)
- ROM puts 2-byte ISR vector address on the data bus, 1 byte at a time
Here is the circuit I came up with.
Attachment:
prio_interrupts.png [ 203.38 KiB | Viewed 13458 times ]
I used generic ROM for the sake of presentation. Actual EPROM can be used here. Also, 7400 family seems to have cute little ROMs, such as '88, but I've never used them.
In general, this approach gives you ability to have separate ISRs for each IRQ line with zero software overhead, with up to 8 individual IRQ lines (or 16 IRQs if you use '147 instead of '148).
I wonder if y'all did anything similar, or if there were similar solutions in real '02 systems.
EDIT: Here's a circuit file in case you want to emulate it yourself (yes, it actually works) - you'll need this tool:
https://github.com/hneemann/DigitalAttachment:
vpb.zip [3.53 KiB]
Downloaded 40 times
_________________
/Andrew
deck65 - 6502 slab with screen and keyboard |
ПК-88 - SBC based on KM1810VM88 (Ukrainian i8088 clone) |
leo80 - simple Z80 SBC
nice65 - 6502 assembly linter |
My parts, footprints & 3D models for KiCad/FreeCAD