A0CBM wrote:
I have a VIC 20 that I have put a 65C816 into via the CPU socket. This is a work in progress as I am working on implementing four banks of 64K. I was thinking of running the '816 at 7 Mhz, derived from the 14.31818 mhz clock, but switching to 1 mhz when accessing the IO section of bank zero. Would it work to use a 2 to 1 multiplex bit to downshift to a slower speed when accessing slower areas of memory? Or would it also work to use the RDY signal to slow things down temporarily?
I'd go with Jeff's suggestion that you wait-state the 65C816. It's technically less difficult to accomplish than trying to divide the 14.31818 MHz raw clock down to (approximately) 1 MHz with each I/O or ROM access—without glitching and possibly crashing the '816 in the process.
A couple of "gotchas" come to mind. Firstly, you can't just plug a 65C816 into a 6502 socket and expect it to work—the '816 is not pin-compatible with the 6502. There is discussion on this around here, which you can find via searching. Furthermore, the 65C816 doesn't have the
PHI1O and
PHI2O clock outputs of the 6502. These are used in the VIC-20 for clocking other devices, such as the 6522 VIAs that control much of the I/O. You'd have to synthesize those signals, such as with the below circuit.
Attachment:
File comment: Two-Phase Clock Generator
clock_gen_2phase.GIF [ 16.88 KiB | Viewed 1684 times ]
Secondly, the kernel ("kernal") ROM code tasked with running the serial bus is timing-dependent in some places. Having the MPU running at seven times the expected speed may result in the serial bus not working at all.
Thirdly, the VIC-20's glue logic is 74LS, which in addition to having weak fanout, has limited switching speed. While any one 74LS device could readily keep up with a 65C816 running at 7 MHz, problems may arise with cascaded logic and the total propagation time of any given circuit.
Dr Jefyll wrote:
What's the status of your project at present -- have you got the '816 working at all?
As Jeff hinted with his question, you should begin by establishing that you can get the '816 to work at the standard VIC-20 Ø2 rate, which is approximately 1.02 MHz. As far as I can recall, the VIC-20 kernel does not use any illegal instructions, so that matter shouldn't trip you up.
However, in attaching the '816 to the VIC-20, you will have to pay attention to the clock situation, as well as the different pin-out, plus making sure inputs such as
ABORT and
BE are pulled up to Vcc (3.3K resistors will suffice). In particular, watch out for pin 1 (
VPB), which is an active output on the '816 and must be treated as a "no-connect." That pin is a ground on the 6502.
You likely will have to isolate the 65C816 from the data bus with a bus transceiver (e.g., a 74ACT245), as during Ø2 low, the '816 emits the bank address on the data bus, which the VIC-20's circuitry will not be expecting. For example, if a ROM read is about to occur, the ROM may start emitting data before the rise of Ø2, which is when the '816 will still be driving D0-D7 with the bank bits. Bus contention will occur.
If memory correctly serves me, the revision B version of the VIC-20's mainboard is fitted with slow DRAM. You will probably be wait-stating every read and write operation carried out by the 65C816, as it is not likely RAM can keep up at 7 MHz (we already know ROM and I/O can't). I don't wish to discourage you in any way, but if all RAM, ROM and I/O accesses must occur at approximately 1 MHz, the performance gain of using a 7 MHz 65C816 will probably be quite small. The main benefit you would gain would be access to the advanced 65C816 instructions. However, you won't be able to use the 16 bit registers, because the '816 would have to stay in emulation mode in order to be compatible with the VIC-20 kernel.
You should consider these things as your proceed with this project.