I am working on a Z80 vintage type project and I want to have multiple clock speeds. An AVR will also be present, but it will be clocked at 14.7456M for clean serial port baud rate reasons. I will use 3 pins to control the clock speed so 8 speeds, but 1 is dedicated for the AVR to manually clock it, so that leaves me 7 more speeds. I wanted to pick speeds that the Z80 commonly ran with, and at the same time allow for maximum speed (20MHz). Speeds that come to mind are 20, 16, 12, 10, 8, 6, 5, 4, 2.5, 2, 1 MHz, but I can't think of an easy way to be able to do them all. The best way I've come up with is using a 74HC151 to select the 1 out of 8 clocks, and then use both sides of a 74hc393 counter to split two oscillators, one 20MHz and one 16MHz. That would give me:
20, 10, 5, 2.5, 1.25
and
16, 8, 4, 2, 1
where I could tap 20, 16, 10, 8, 4, 2, and 1 as my seven speeds.
This would involve 2 oscillators, a 74HC393, and a 74HC151. Is there a better way to do it?