PIC internal oscillator running fast

I have several 12f629s from different purchases. I just measured the CLKOUT signal and I'm getting between 1.15 and 1.25 MHz both with a simple freq. counter (DMM) and a decently calibrated scope. Vdd between 3 and 5V doesn't make too much difference in what I'm seeing.

I understand that Microchip INTOSC accuracy specs are optimistic, but up to 25% off is way more than I expected. Other than really lousy manufacturing tolerances, what else might be causing this? Thanks for any ideas or hints.

--
Eric Behr          | NIU Mathematical Sciences      | (815) 753 6727
behr@math.niu.edu  | http://www.math.niu.edu/~behr/ |  fax: 753 1112
Reply to
Eric Behr
Loading thread data ...

Did your programmer preserve OSCCAL? Are you setting it at startup?

call H'3FF' bsf STATUS, RP0 movlw d'174' movwf OSCCAL bcf STATUS, RP0

If your programmer has wiped out OSCCAL at 3ff you are going to have to work out what it should be.

--
Ben Jackson AD7GD

http://www.ben.com/
Reply to
Ben Jackson

I don't believe so; certainly not on all the parts I tried, unless my PicKit 1 messes it up (Microchip claims that their tools always preserve it). Plus I didn't think the OSCCAL value can alter the frequency more than a few %. But I'll play around with it. Thanks.

--
Eric Behr          | NIU Mathematical Sciences      | (815) 753 6727
behr@math.niu.edu  | http://www.math.niu.edu/~behr/ |  fax: 753 1112
Reply to
Eric Behr

I meant I believe the programmer preserves it.

But you were absolutely right. It looks like my PicKit was wiping

0x3ff while programming. I can't even complain, because I'm using Microchip's unsupported Mac OSX software.

I never noticed this because I haven't needed much accuracy in the past. I now calibrated all the chips I have via trial-and-error. Live and learn... Thanks very much for prodding me towards this possibility.

--
Eric Behr          | NIU Mathematical Sciences      | (815) 753 6727
behr@math.niu.edu  | http://www.math.niu.edu/~behr/ |  fax: 753 1112
Reply to
Eric Behr

Doh, on re-reading this I see that movlw in there for some reason. I must have manually calibrated the chip I used for the project I was quoting. So if someone wants to use that snippet, don't keep the movlw!

--
Ben Jackson AD7GD

http://www.ben.com/
Reply to
Ben Jackson

sonow you have them calibrated, what is the variance between them (clock wise)

Reply to
feebo

I had to use 0x17 on one of them, 0x1c on another, and 0x23 on two others. I didn't check the extremes, except I know that they ran at up to 1.25 MHz CLCKOUT with - I assume - OSCCAL being all 1s.

--
Eric Behr          | NIU Mathematical Sciences      | (815) 753 6727
behr@math.niu.edu  | http://www.math.niu.edu/~behr/ |  fax: 753 1112
Reply to
Eric Behr

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.