Dr Jefyll wrote:
But now you're getting distracted with new hardware!?
Yeah, I know,
but just look at all the fun we're having!
Quote:
It'd be better to increase the address setup time seen by the peripheral by having the OE and WE pulses endure for only half of the 2-cycle period.
Sold! Love your circuit.
The whole question of the right split between address setup time and pulse width is key ...
Address Setup time is quoted as 10ns for SC26C92 UART, whereas the minimum pulse width is fully 70ns! By those figures, it seems favouring the pulse width in the tradeoff may be best here. At 20MHz, a 25/75 split feels just right (100ns cycle with a wait-state), especially considering how quickly the WDC 65C02 gets an address on the bus. But the TTL CPU is much slower on that score. It takes 21ns for it to produce an address (in theory that is) and it really needs the additional setup time that a 50/50 split affords. However, that ratio likely would put the pulse width offside for the UART (I know the UART works with a 62.5ns pulse, but 50ns seems like a stretch). I need a 50/75 split
Quote:
But I'd be happier if it also allowed extra time after OE and WE go false.
Me too! An extra half-cycle would be just great ...
GARTHWILSON wrote:
I'd recommend putting a 22pF capacitor across that resistor
Does "across" mean "in parallel with" in this context?
ttlworks wrote:
Downside of this approach is, that there _always_ would have to be a wait state for generating the PHI2' signal, even if the CPU is running at 1MHz in "slow mode".
Currently, a wait state is only generated by the SBC if it's on the FAST clock. I think I can do the same when using RDY by adding a gate on the enable signal of the wait-state circuit. There is also a jumper which disables wait-states altogether when running with slower oscillators.
Quote:
But the only peripheral which needs /OE and /WE generated from PHI2' is the UART.
Yes! That little chip sure brings lots of subtleties along
Quote:
If everything but the RAM would have a wait state, the 6522\6526 would have a wait state, too... and I think this would generate two successive read cycles (or write cycles) to the same address on the chip. This probably would give us _another_ problem.
Agreed. For sure that's a problem. It's tempting to only invoke the wait state logic for ROM and the UART. After all, the VIA runs just fine at 20MHz now on the SBC. But, that probably changes with the TTL CPU. It will likely violate the required address setup time for the VIA (as mentioned above, the TTL CPU will take 21ns to generate an address, leaving only 4ns setup time at 20MHz. That works for fast RAM, but everything else will probably need a wait state). Maybe the solution is to run the VIA with PHI2/2 all the time if wait states are enabled? That way, it won't double up reads and writes when it's chip select is asserted.
Dwight wrote:
Why not just stall the clock for both the processor and the peripheral.
That's what the SBC does now ... and given all the complications above, I wish I could keep it that way!
But the problem with the current wait-state circuit in the SBC is that it takes too long to trigger (too many gates in series) and by then PHI2 has gone high already. It all works perfectly well at 16MHz with the 65C02. (Funny thing, a wait-state circuit that only works at slower clock rates
). At 20MHz with the TTL CPU, we only have 4ns after the address is stable to detect and trigger the wait state before the
rise of PHI2 - a tall order I think. By contrast, the RDY signal must be brought low only before the
fall of PHI2 - plenty of time for that.
Dr Jefyll wrote:
Just stick in an extra half-cycle after OE and WE go false. Of course an entire extra cycle would do the trick, but that's more of a performance hit.
It does seem one potential solution is to go ahead with an RDY wait-state circuit and add a second flip-flop to extend the wait-state to three cycles for the UART, one cycle of address setup and two cycles of pulse width. Or were you suggesting a hybrid approach, using RDY to pause the CPU but the also pausing the clock to stretch the pulse width in the middle of the wait-state?