Eudimorphodon
Veteran Member
VIA clock in Commodore PET: is it important it run at 1mhz?
VIA clock in Commodore PET: is it important it run at 1mhz?
Resurrecting this thread with another ignorant question about arcane Commodore/6502-family obscurities. This is specifically about how the VIA is used in the PET.
According to the datasheet the VIA relies on tracking the CPU's PHI2 clock for coordinating its bus cycles (IE, the PHI2 clock should be the same as the CPU's) *and* it is also used as the heartbeat frequency for its onboard timers. So: is there anything in the BASIC PET kernel/BASIC OS that's going to be using the timer and care if the CPU runs at something other than 1mhz? My vague understand was that the "timekeeper" in a normal PET is the 60hz interrupt (which I think I can generate easily enough), but I guess I don't actually know if the timers are used for anything by the ROMs?
The timing hardware I'm diddling with in my prototype is set up so based on the position of a "turbo" switch it can generate a CPU clock that's either one-eighth pixel clock (normal) or one-half (turbo). So, either 1mhz or 4mhz in 40 column mode. (This timing seems to check out so far, but it's possible the "fast" speed might go down to 2mhz if chip select generation makes things too tight. So far with just the video parts in place 6mhz seems okay, fingers crossed.) If the only downside of having the VIA track CPU speed is things like VIA-generated sound is going to sound off unless the program is patched for higher speeds I don't think I'm going to worry, but if there's something system-level that's going to break I'm wondering if I need to come up with some kind of method to clock the VIA at a constant rate and auto-throttle the CPU when it hits the I/O chips.
(It goes without saying that I might need to switch the CPU speed down to stock if I want things like cassette and IEEE-488 to work with the unmodified ROM routines, but I also don't consider that a massive problem if the system will work okay otherwise.)
VIA clock in Commodore PET: is it important it run at 1mhz?
Resurrecting this thread with another ignorant question about arcane Commodore/6502-family obscurities. This is specifically about how the VIA is used in the PET.
According to the datasheet the VIA relies on tracking the CPU's PHI2 clock for coordinating its bus cycles (IE, the PHI2 clock should be the same as the CPU's) *and* it is also used as the heartbeat frequency for its onboard timers. So: is there anything in the BASIC PET kernel/BASIC OS that's going to be using the timer and care if the CPU runs at something other than 1mhz? My vague understand was that the "timekeeper" in a normal PET is the 60hz interrupt (which I think I can generate easily enough), but I guess I don't actually know if the timers are used for anything by the ROMs?
The timing hardware I'm diddling with in my prototype is set up so based on the position of a "turbo" switch it can generate a CPU clock that's either one-eighth pixel clock (normal) or one-half (turbo). So, either 1mhz or 4mhz in 40 column mode. (This timing seems to check out so far, but it's possible the "fast" speed might go down to 2mhz if chip select generation makes things too tight. So far with just the video parts in place 6mhz seems okay, fingers crossed.) If the only downside of having the VIA track CPU speed is things like VIA-generated sound is going to sound off unless the program is patched for higher speeds I don't think I'm going to worry, but if there's something system-level that's going to break I'm wondering if I need to come up with some kind of method to clock the VIA at a constant rate and auto-throttle the CPU when it hits the I/O chips.
(It goes without saying that I might need to switch the CPU speed down to stock if I want things like cassette and IEEE-488 to work with the unmodified ROM routines, but I also don't consider that a massive problem if the system will work okay otherwise.)