PDA

View Full Version : Question about Oscillators



RossW
- 9th August 2004, 20:05
1) pic12F629 has the capacity to be run at 20 Mhz - does that include using the internal oscillator? For example, if I put DEFINE OSC 20 at the top of my code (After @ DEVICE pic12f629, INT_OSC), will it run at 20 Mhz?

2) Can I use one external oscillator for two PICs, or should they each have their own?

Ross

Dwayne
- 9th August 2004, 20:53
Hello Ross,

Ross>>1) pic12F629 has the capacity to be run at 20 Mhz - does that include using the internal oscillator? For example, if I put DEFINE OSC 20 at the top of my code (After @ DEVICE pic12f629, INT_OSC), will it run at 20 Mhz?<<

The chip has the capacity to run at 20 MHZ, but the chip only as a internal OSC of 4 MHZ (The data sheet will give you this info)
this means you must use a external OSC to go faster than 4MHZ, and set your programmer to ext OSC.

Ross>>2) Can I use one external oscillator for two PICs, or should they each have their own?<<

Never tried it... but the main problem you "might" have, is too much load on the OSC...resulting in Meltdown and temporary death to your computer...the only fix to such a death, is either using the internal OSC, or isolating your chip with a buffer from your Ext Osc.

Dwayne

NavMicroSystems
- 9th August 2004, 21:03
See also:

http://www.picbasic.co.uk/forum/showthread.php?s=&threadid=575&highlight=oscillator


B.T.W.
a simple search for "oscillator" would have taken you there.

regards:

RossW
- 9th August 2004, 22:02
I think I can use Method 1 from Melanie's post as there are only 2 pics in this design. Question: do I need any special defines to enable the OSC2 pin? I know I need at least:

DEFINE OSC 20

@ DEVICE 12f629, EXT_OSC


Also, is using the OSC2 pin different than the CLKOUT? The datasheet says that it divides the frequency by 4 in the INTOSC or RC modes.

Melanie
- 10th August 2004, 03:56
As per my original post you need the HS_OSC option because you are using an external xtal (for 20MHz). For the actual define for your PIC, I refer you to the FAQ section. CLKOUT is when you are using the internal 4MHz oscillator and you want the clock brought out from inside the PIC to the outside world.

actionplus
- 11th August 2004, 15:40
How can set it up in the program to use the internal 4MHz of this PIC?

DEFINE OSC INT??

Melanie
- 11th August 2004, 16:17
You need to specify your PIC's oscillator type in the Configuration Fuse definitions for your PIC. See the FAQ about PIC Defines.

You do not need any define OSC statements for PICBasic if you are going to run at 4MHz as this is the assumed default.