Hot answers tagged

24

The first CGA PCs used a single clock from which they derived all their timings. To allow for NTSC output, the main clock had to run at a multiple of the colour subcarrier frequency; the main clock ended up running at 14.31818 MHz, i.e. four times the NTSC colour subcarrier frequency. This clock feeds the 8254, whose channel 0 ticks at 1.193 MHz (one ...


8

I's be rather surprised if anyone ever did. F/C is a static input, not meant to be switched at runtime. There are not only no examples for switching, but it's as well clearly stated on page 3-392 of the manual: And Strapping is datasheet lingo for fixed setting Looking at the (pseudo) schematics reveals that it's not meant as an active switcher as there is ...


6

Way 2.1 to pin a non-masked interrupt, attach a crystal with a frequency of 10KHz (not sure about this value, but with another value idea is same), and in the non-masked interrupt handler, increase the value of the variable globalMicroseconds. That is, each crystal tick - means that one microsecond has passed. Way 2.2 use a programable timer chip, as is done ...


5

You have correctly surmised the two approaches to measuring time, not just on the Z80 but in computers in general. With a processor like the Z80 where every instruction takes a known number of cycles, you can simply count cycles to keep track of time. All branches, subroutines and loops in your code must be accounted for in the cycle count. It's ...


4

Now I'm stuck - I need to be able to count milliseconds and microseconds in the code. Forget about microseconds. Single instructions on a Z80 are already in the range of 1 µs or even longer, depending on the clock speed used. For fast CPUs it's fine to use some 'standard' value; for classic CPUs it's more appropriate to use a unit that fits your game design....


2

your best bet would be to hook up binary counter directly to your CPU clock and use it as divider that creates interrupt ... For example if you got 4.0MHz and want ~1ms resolution then divide the clock by 2^12 so use 11th bit of counter (counting from zero) ... that will divide the clock by 4096 resulting in roughly 1ms interrupt ... Then just write ISR ...


1

My Turbo XT, which has a clone of the DTK PIM TB10 mainboard, picture of the original (10MB!) at http://www.minuszerodegrees.net/xt_clone_bios/DTK%20PIM-TB10-Z%20of%20revision%209.jpg seems to do exactly what you suggest. It has a 30MHz crystal oscillator and a 14.318 Crystal driven by the 8284. I did not look into the way they use to overcome the problem of ...


Only top voted, non community-wiki answers of a minimum length are eligible