you have to use one of the timers to do the division by 193, and not the isr. an isr is much too slow to handle all these interrupts, coming every 5us with this design. so your pulse is now about (time, required by the isr) / 5us = pulselength [s] good luck! tino Pic Dude Gesendet von: pic microcontroller discussion list 17.05.02 08:26 Bitte antworten an pic microcontroller discussion list An: PICLIST@MITVMA.MIT.EDU Kopie: Thema: [PIC]: External clock... Somehow my clock ckt seems to be running a lot slower than it should, but I'm stumped. Here are some details... Swapped 32.768 khz crystal/caps for a 1.544 MHz external oscillator, into an 16F872 circuit. This is an ECS-200 series oscillator in a 14-pin metal pkg, but only has 4 pins, and only 3 of those are active -- +ve, gnd, and out (which I connected to OSC1/CLKIN). OSC2/CLKOUT is now open. Pre-scaler is now 1:8 and ISR routine divides a few times: first by 193, then by 25, then by 10, to give me 1-sec pulses. (There's a reason for those divisors in case you're wondering -- I can get 0.1 sec pulses I need for something else). However, it's running MUCH slower than that -- taking a few minutes to generate a 1-sec pulse! Am I missing something here? I've left the osc config bits to LP, and verified the ext osc freq with an oscilloscope. Also, there's a setting in OPTION_REG for selecting the source clock for TMR0 to internal or T0CKI, but I don't think this setting has anything to do with this prob. Any ideas why I may be seeing these results? Cheers, -Neil. -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads