Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!csd4.milw.wisc.edu!uxc.cso.uiuc.edu!tank!ncar!noao!asuvax!mcdphx!teroach.UUCP!dbk From: dbk@teroach.UUCP (Dave Kinzer) Newsgroups: comp.sys.amiga.tech Subject: CIAB Timer Questions Summary: Where does clock come from? Keywords: CIAB, Timer, Frequency Message-ID: <11118@mcdphx.phx.mcd.mot.com> Date: 20 Jun 89 05:25:36 GMT Sender: listen@mcdphx.phx.mcd.mot.com Reply-To: dbk@teroach.UUCP (Dave Kinzer) Followup-To: comp.sys.amiga.tech Distribution: na Organization: Motorola Microcomputer Division, Tempe, Az. Lines: 42 First let me thank Karl Lehnbauer, Paul Higgenbottom, et.al. for the CIAB timer code. I have substantially modified the code for my own application, but it was a great starting point, saving me days of time. 8^) I am trying to determine the exact timing of the counts but I cannot get what I see in the documentation to agree with what was in the code. Problem: The code given appears to inherit whatever was in the "inmode" bits of control register B (bits 6 and 5). This might not be a good assumption, since a previous task could set these to whatever it wanted while it had the hardware. Assuming (go ahead, correct me 8^) ) that both bits are zero (the only thing sensible to me), we are counting 02 clocks. Of course, the schematic does not have an 02 clock pin on the device, but us old 6800 hackers know that that is the E pin. The E pin is generated by the 68000, and will be 1/8 the clock frequency. Now, the analysis proceeds like this. NTSC system crystal frequency: 28.63636 MHz 7M clock = above/4 (68000 clock): 7.15909 MHz E clock = above/8 (02 pin): 894.88625 KHz Yeilding an E clock period of: 1.11746 uS Unfortunately, all the documentation for the code says the CIAB timer runs at 1.396825 uS/clock. So, HELP!!! Where have I gone wrong? I would also like to make this work correctly for PAL machines, so I would like to know the exact frequency of the PAL machine's clock. | // GOATS - Gladly Offering All Their Support Dave Kinzer (602)897-3085| | // >> In Hell you need 4Mb to Multitask! << uunet!mcdphx!teroach!dbk | | \X/ #define policy_maker(name) (name->salary > 3 * dave.salary) |