PDA

View Full Version : How to use internal oscilator of PIC16F628A?



SKOLS1
- 29th May 2011, 12:10
Hi all,
I want to know how to use internal oscilator of PIC16F628A,the 4Mhz crystal oscilator?Which comand should I use to turn on the internal oscilator,I use PBP and MCS 2.60!
Thanks

fratello
- 29th May 2011, 12:39
I used something like this :

@ DEVICE pic16F628A, INTRC_OSC, WDT_OFF, PWRT_OFF, BOD_OFF, MCLR_ON, LVP_OFF

DEFINE OSC 4

mister_e
- 29th May 2011, 18:38
http://www.picbasic.co.uk/forum/showthread.php?t=543

SKOLS1
- 31st May 2011, 11:48
how about the PCON register?Can I write PCON = $xx and to turn on the internal oscilator?

mister_e
- 31st May 2011, 18:39
I don't think so, you want to specify the right one at the beginning. Some 18F allow to switch over the internal to external on the fly (or in case of a external clock fail), but I'm pretty confident you can't do it with grand'pa 16f628.

orjon1
- 31st May 2011, 20:54
I used something like this :

@ DEVICE pic16F628A, INTRC_OSC, WDT_OFF, PWRT_OFF, BOD_OFF, MCLR_ON, LVP_OFF

DEFINE OSC 4

I'm stuck on a very similar (i think!) problem;

Using a PIC16F777 for the first time, which has an internal Osc. I'd like to get it running at 4MHz, but using fratello's DEFINE code modified to:

@ DEVICE pic16F777, INTRC_OSC

DEFINE OSC 4
....as does not work. the 4MHz, seems much more like 4Hz.

Any help?! thanx!

mister_e
- 31st May 2011, 21:28
Open the datasheet under OSCCON register, and see the default setting., from there change it.

orjon1
- 31st May 2011, 21:46
Thank you Steve - got it working... but i do not understand all the bits in that register;

IOFS: INTOSC Frequency Stable bit ?
SCS<1:0>: Oscillator Mode Select bits ?