Dr Jefyll wrote:
backspace119 wrote:
VP\ I have no idea how to use, as in, I'm not sure how it could be useful.
Relax; /VP is useless for the vast majority of designs. I'm a "feature creep" kind of guy myself -- have always been that way!
-- and even I have trouble dreaming up a reason to use /VP!
I suggest you simply leave that pin unconnected.
VDA (and, to a lesser extent,
VPA) are more tangibly valuable.
V
PA is always high when
Program bytes -- actual opcodes and operands -- are fetched. V
DA is always high when
Data accesses (including stack, general memory and I/O) occur. VDA and VPA can be used to prevent rare but nasty problems involving two groups of I/O chips:
- chips not from the 65xx family, which may have problematic timing restrictions
- any chip which includes registers whose status gets altered when the register is read.
A common example of the latter is the Interrupt Flag Register, as found in the 6522 VIA.
Reading the IFR causes its bits to get reset. It's built that way, in order to streamline interrupt service routines.
If your computer doesn't include I/O chips from these groups then you can safely ignore VDA and VPA. [see note]The potential problem has to do with "dead" or unused bus cycles which all 65xx CPU's occasionally produce. During an unused cycle, the address bus isn't necessarily valid and meaningful, which results in a risk that the dead cycle could read an I/O device. Luckily, the invalid addresses are predictable. Some workaround solutions involve a change in programming (for example, avoiding the use of indexed address modes to access I/O). Changes to the system memory map (ie, changing the address where I/O resides) can also help.
Those workaround fixes don't require the use of VDA or VPA. There are two other alternatives:
- If you ignore VPA but do use VDA to qualify I/O accesses then data accesses can touch I/O but dead cycles and operand accesses cannot. This simple solution is usually the most desirable. (The 6522 VIA is especially easy, as it has two Chip-Select inputs. Just run the address-decode signal to the VIA's active-low CS, and drive the active-high CS directly from VDA! )
- Somewhat slower and more complex is OR'ing together VDA and VPA, and using the result as the qualifying signal. I can only think of one reason you'd do this [can anyone else suggest reasons?], and that's when the plan is to use that signal to enable a decoder IC which is responsible for selecting both I/O and memory. It's the shared decoder that makes the OR gate necessary. The decoder needs to be active when code is fetched (from memory); therefore the qualifying signal must account for VPA.
Hope that helps! Cheers,
Jeff
Note: I don't have EEPROM experience, but it occurs to me that spurious reads may be an issue (reads may play a role in the programming procedure). Best to review the programming procedure with that in mind, and if necessary protect the EEPROM from spurious reads.
So, I think that I just realized I fried my brain last night by staying up way too long, and I don't need to use VPA to qualify IO access at all. I was using it in a 3 to 8 decoder that
doesn't interact with memory at all, it only interacts with IO devices, somehow I was thinking about loading program
data from an EEPROM as loading
operands and opcodes which is not the case. I'd simply be loading bytes from an IO device into memory and setting the PC to point to the starting area.
This removes the need for the OR gate that fully qualifies using VPA and VDA. I should mention, what had me thinking about all of this was the circuit in the 28L92 documentation for full address qualification. I don't think that VPA is ever needed for an IO access, although I may be wrong.
So I can get rid of the quad or chip now. I'm going to look through and see if I can get rid of some other logic chips by reorganizing gate usage.
I'll probably see about integrating the RTC today, does anyone have ideas on integrating the one with the multiplexed data/address bus? I'd prefer to use it because it's an all in one package, although it plus the circuitry to integrate it may be more expensive than a chip that is SPI addressable but requires a battery and oscillator.
I'm still looking at the cartridge stuff too, hopefully with fresh eyes I'll be able to figure them out. I ended up reading about ZIF sockets last night (was related to the page on card edge connectors on wikipedia) I remember seeing someone talk about them here, should I opt for them? or are they a waste of space/money.