Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

12f683 internal oscillator

Status
Not open for further replies.

kayjayuk

New Member
I've just started working with the 12f683 for the first time and I've not come across the internal osc's before.

Can someone explain the purpose of this section of the PIC, is it to replace the external crystal? If so can I just turn on the internal osc with the default 4mhz and run from there, remove the external hardware and have GP4 and GP5 free? What other settings are required to make this work?

Of course I may be totally wrong in my assumptions but I'm sure there is someone out there that can put me in the picture.

Thanks guys

Keith
 
Yes. All pics have several oscillator options. I mostly use the internal osc, except when I need an accurate clock. Set it and GP4 and 5 are yours to do with what you wish.
 
As already mentioned, you are correct in your assumption.

To use the internal oscillator you have to select it in your config line,
Code:
	__config _CP_OFF & _CPD_OFF & _BOD_OFF & _MCLRE_ON & _WDT_OFF & _PWRTE_ON & [COLOR="red"]_INTOSCIO [/COLOR]& _FCMEN_ON & _IESO_OFF
This will give the default 4MHz clock. To switch to 8MHz write 0x70 to OSCCON.

Edit, BTW, you can find the labels for the config line at the bottom of file C:\Program Files\Microchip\MPASM Suite\P12F683.INC

Mike.
 
Last edited:
Yes. All pics have several oscillator options. I mostly use the internal osc, except when I need an accurate clock. Set it and GP4 and 5 are yours to do with what you wish.

Hi, thanks for your answer, I wouldn't go as far as to say that all PICs have the internal oscillator option, I've been using PIC's for many years now but this is the first time I've used a 12F683 and also the first time I've seen the internal osc, all the types I've used in the past, 16C61 and 64, 16C84, 16F84, 16F877, require an external crystal or resonator to drive them.

Having said that you have answered my question, which is the main point of my post. I was confused as to whether I could discard the external crystal and use an internal osc to drive the 12F683 thereby regaining the two port pins that are taken up by the external crystal and you answered that for me. Apart from freeing up the two pins it also custs the cost of the circuit and as I'm going to be marketing this particualr device and saving on costs is to be jumped on !

Thanks again for your reponse, it's very much appreciated. :)

Keith <kayjayuk>
 
Thanks for your reponse Mike and for the config line too, nice one !!

I suppose I could be accused of not reading the manual, I have but not as fully as I should have done on this topic, though it can be difficult to find references to items, you can sometimes find little snippets tucked away in spots you'd never expect to find them and of course they turn out to of the greatest importance when you do find them. I remember years ago, it was the first time I'd ever used interrupts and could I get them to work, I was trying everything, I was totally convinced I had all the right options set and in the end it turned out that I hadn't set the peie flag in the intcon reg, doing that fixed things, one I've always remembered since.

Thanks again
Keith <kayjayuk>
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top