I took over BDD’s address qualification. Is this only necessary for the I/O block?
Address qualification needs to be applied to all cases, not just the I/O block. The reason has to do with how the 65C816 handles the data bus during Ø2 low, as well as the potential for false address bus states that may confuse some hardware (the 2692 is in that category). The data sheet alludes to this but doesn't really explain it well. In the following explanation,
&& means logical AND,
|| means logical OR and
! means logical NOT.
The general rule to follow with the '816 is that no RAM, ROM or I/O should access the data bus unless the expression
Ø2 && (VDA || VPA) is true. If the condition is
!Ø2 && (VDA || VPA) then the '816 is multiplexing the A16-A23 component of the effective address onto D0-D7, which constitutes a write operation by the '816,
regardless of the state of RWB. Therefore, a chip's /OE or /WE (output-enable or write-enable) should not be asserted when Ø2 is low, as the bit pattern on D0-D7 would be A16-A23 at that time. If a chip's /OE is asserted at that time bus contention will occur. If /WE is asserted, the A16-A23 bit pattern will be written into the device. The lone exceptions to this rule are WDC's 65C21, 65C22 and 65C51, which are slaved to Ø2 and "know" what the bus states are during the instruction cycle.
As a general rule, note that no RAM, ROM or I/O should ever be selected unless
VDA || VPA is true, as otherwise the address bus may be invalid. This applies to the WDC I/O devices, as well as others.
As Garth noted, you normally wouldn't expect the '816 to be fetching instructions from the I/O block. I don't make that distinction in POC V1.1, but it should be made to forestall accidental access to I/O device registers during an opcode fetch that is directed to the I/O block caused by an errant value in PC. Opcode fetch is indicated by the expression
VDA && VPA being true. So if you want to be really careful with I/O device selection, only allow it when the expression
VDA && !VPA is true.
To summarize, the possible states of VDA and VPA, and what they mean are as follows:
Code: Select all
VDA VPA Ø2
—————————————————————————————————————————————————————————
0 0 X buses are invalid
1 0 0 data address setup: DB —> D0-D7
X 1 0 instruction address setup: PB —> D0-D7
1 0 1 data read/write
0 1 1 operand read
1 1 1 opcode read
—————————————————————————————————————————————————————————
X = don't care
In the above, DB refers to the data bank register and PB refers to the program bank register.