GARTHWILSON wrote:
VPA and VDA do not become valid any sooner than the address (according to the spec.s-- which don't have a very good record for being error-free).
Yes, that's what the timing diagram says, but it isn't the way the device behaves. During intermediate steps in program execution, the diagram is not completely valid. Specifically, an invalid address may be placed on A0-A15, a condition that will be trapped by accounting for the state of VDA and VPA.
Any asynchronously clocked I/O device is potentially vulnerable to undocumented effects due to invalid address bus states. It was that characteristic of the '816 that caused the DUART in my POC unit to malfunction when ABS,X addressing was used to access chip registers. The clock cycle immediately before the address bus became valid included an invalid address that while in the same page, resulted in a different register being selected (and read due to an invalid read operation). It was as clear as day once I started observing what was going on on the bus. Qualifying I/O device selects with VDA and VPA completely fixed the problem. There was *no* fix possible in software, except by avoiding ABS,X.
BigEd wrote:
'm with Garth on this: in most situations, a simple beginner's design doesn't need to worry about VPA or the other advanced bus signals.
We should make an effort not to scare people off with our war stories.
There is no intent to scare anyone with "war stories." The idea is to make sure someone else will not get tripped up by the same oversight that got me.
Quote:
BDD, you had a specific case with a slow peripheral which objected to rapid reads in succession, and you'd happened to use an indexed addressing mode. Once you knew the cause, you could have fixed it in software but you chose to fix it in hardware.
Actually, it wasn't a case of a slow peripheral at all, but rather the result of driving the input side of an asynchronously clocked device (2692 DUART) with a synchronously clocked bus. A specific register in the DUART does not internally update until three clocks have passed, clocks referring to the 3.6864 MHz clock used by the DUART for internal timing. If that register is accessed before that 3X period has elapsed the data that was written to it will be lost.
As it turned out, the invalid address placed on A0-A15 during the fourth cycle of an ABS,X instruction was hitting that register and causing the trouble. The qualification of I/O device select with VDA and VPA was all that was required to fix it.
A point to be made, I think, is that folks visit this forum looking for information that may not be readily gleaned from reading a data sheet. I believe we should put forth our experiences so the new designer can go into his/her project better informed. Accounting for some signals that could make or break a design isn't scaring anyone.