PDA

View Full Version : overclocking internal oscillator?



emerson
- 15th March 2012, 18:30
I have a 16f688 outputting music using the FREQOUT command. When I define the internal oscillator at 8 MHz the audio is slightly warbled and plays faster than I would like, but when I define the internal oscillator at 10 MHz, which is higher than the chips internal oscillator is rated for, the music plays exactly how I want it to.

My question is will this damage my chip? It seems to work alright and I'd like to keep the music this way. Or should I buy a 10 MHz crystal just to be safe?

Here is the datasheet: http://ww1.microchip.com/downloads/en/devicedoc/41203d.pdf

Thanks guys,
Emerson

Dave
- 15th March 2012, 19:12
If all you are doing is Defining the oscillator frequency with the DEFINE OSC statement then NO, you are not doing any harm to the processor. The DEFINE statement is mearly telling PBP of the intended frequency so statements like PAUSE and the like run in the required amount of time.

Art
- 16th March 2012, 00:19
Interesting.. DEFINEing a higher clock speed for a given actual clock speed that is constant should make everything slower, not faster.

emerson
- 16th March 2012, 04:16
What you said is right. I have the music playing while a title screen loads on my tv, and when I DEFINE the oscillator speed at 10 MHz, the music stops when the screen is finished loading. If I DEFINE the oscillator speed at 8 MHz though, the music finishes about a second faster than the screen loads. I prefer the slower speed, I just don't understand why it happens.

Art
- 16th March 2012, 07:27
Ah, that is the correct way around.
If you define a slower speed, but don't change your actual clock, as stated above,
PBP will make adjustments to timing to compensate for the different clock freq.
So if you DEFINE OSC 8, but run at 4 MHz, a PAUSE 1000 statement should take 0.5 seconds to execute.

Ioannis
- 16th March 2012, 10:35
Art, it will take 2 sec.

PBP thinks it is 8MHz, bit clock is half. So delays are double.

Ioannis

Art
- 16th March 2012, 12:16
Whoops!
....

emerson
- 16th March 2012, 17:55
Well it doesn't seem like it will hurt the chip any. Thanks again for the help guys.

Ioannis
- 16th March 2012, 18:40
Sure not! If you increase the clock frequency, you will reach a point that it will just not work, or at least reliable.

Ioannis

Dave
- 18th March 2012, 01:32
I just love this thread... Nice idea,,, overclock an oscillator you have NO control over other than the divider..... Hat a Hoot....

Art
- 18th March 2012, 05:01
Ya reckon? Raise voltage to the entire chip and it will be overclocked.
Sure will fail to be reliable at some stage though!

Acetronics2
- 18th March 2012, 10:55
I have a 16f688 outputting music using the FREQOUT command. When I define the internal oscillator at 8 MHz the audio is slightly warbled and plays faster than I would like, but when I define the internal oscillator at 10 MHz, which is higher than the chips internal oscillator is rated for, the music plays exactly how I want it to.

Emerson

Written like that, It looks like some kind of mismatch ...

Using " FREQUOUT " when defining the correct osc frequency gives the correct frequency, or close to it ... nothing else !

so, as it seems to be PBP ... may we see your source program and especially the config section ???

Alain

Demon
- 18th March 2012, 15:58
You can overclock, at your own risk. :D

http://www.picbasic.co.uk/forum/showthread.php?t=15993

Robert

ScaleRobotics
- 18th March 2012, 16:30
Yes, but how to Re: overclocking internal oscillator?

Maybe overclocking about 1% with the osctune register? :)