13

As a learning exercise, I'm writing an emulator for the 6809 CPU. I'd like to simulate the speed of the CPU. I know the Motorola 6809E runs at 0.895 MHz and 1.79 MHz on the Color Computer 3. How do I figure out how many milli/nano seconds a cycle takes, so know how long of a delay I need on my modern machine?

  • Great first question! Usually you would check the specifications, but I'm not sure of the standardisation of the specs at the time most of these chips were released. – wizzwizz4 Jun 20 '16 at 21:24
  • Thanks @wizzwizz4 Although the problem wasn't knowing the specifications (I already knew the speeds of the CPU), it was knowing how tie the speed in MHz to the speed in seconds, which then shows how long to delay between instructions. The answer was perfect in this respect. – patterson7019 Jun 22 '16 at 19:56
  • It was, and I upvoted it! I'm glad you're still active; I thought we might've scared you off by deleting that answer. – wizzwizz4 Jun 23 '16 at 5:55
13

It's one divided by the clock. So for 0.895 MHz divide 1 by 895000 and the answer is 1.117318 micro seconds. for 1.79 Mhz it's 558.6592 nano seconds.

I suspect however that the clock will be some multiple of NTSC timing (or PAL for European computers).

Wikipedia gives NTSC timing as 3.579545Mhz which divided by four gives 0.89488625Mhz (i.e. nearly your 0.895) with a cycle time of 1.11746045 micro seconds.

Note that in practice the timing for all this will not be to anywhere near this sort of accuracy IQD data sheets show that ±10 to ±50ppm is typical.

(edit) According to the wikipedia page the CoCo uses a 14.31818 MHz crystal so divide down by either 8 or 16 before calculating.

  • According to the contemporary service manuals from Tandy, the CoCo 1 and 2 used a 14.31818 MHz crystal for its master clock, while the CoCo 3 used a 28.63636 MHz crystal (for NTSC; PAL CoCo 3s used a 28.4750 MHz crystal resulting in slightly lower clocking of the CPU...and there was apparently a PAL CoCo 2, but I don't have its manual). – Michael Hampton Jun 25 '16 at 4:05
  • The difference between 894.88 and 895 is an error of about one part per ten thousand? Can you tell the difference between a car going at 60mph and 60.008mph? :-) – user6464 Oct 12 '18 at 12:26
  • Given the crystal accuracy I would agree. However I was trying to show where the number comes from. – PeterI Oct 12 '18 at 17:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.