Hi
I'm looking for internal clock configuration @8MHz
Thanks
Hi
I'm looking for internal clock configuration @8MHz
Thanks
There are many options here… so here‘s just one of them…
1. Ensure that your Device Oscillator Configuration Bits are set to INTRC_OSC_NOCLKOUT (if you don’t know how to do this, see the new FAQ section). This option also means that the two OSC pins are made available for I/O. If you need the Oscillator to output on OSC2, then select the appropriate option (again see FAQ section).
2. Somewhere at the start of your program (where you normally initialise your processors registers) add the line…
OSCCON=%01111000
I refer you to the Datasheet section 4, especially Register 4.2 OSCCON to discover what I have done.
3. If stabilising your clock to other events is important to you, then you may need to add this piece of code after the above OSCCON setting (otherwise it is not necessary)…
While OSCCON.2=0:Wend
This will ensure the PIC does not continue processing until the new Oscillator Frequency is stable by introducing a 4mS delay (see datasheet 4.6.5 item 4).
As with ALL the queries regarding the set-up of PICs – Read the Datasheet! – it’s all there waiting for you to discover.
As I am new to this, reading the data sheets sometimes pose more questions than they answer. Such is with trying to figure out how to use the Internal Osc on the 16F88.
I am moving from a 16876A where I used and external Osc - and have a program running fine there. Now, I want to move this program to the 16F88, and rather than use external Osc, use an internal. I have recompiled, tweaked the PORT.X settings, and am ready to go, BUT.
I see the F88 is an 8 mhz OSC, when I was using 4... Sure, I'd like to go faster, but just sticking to the same as the first pic is fine.
I have seen mention of setting the config bits to INTRC_OSC_NOCLKOUT in the include file.
As well I have seen advise to use OSCCON=%01111000 at the start - which mapping back to the data sheet looks like it is selecting a speed, but I can't find a table that maps to this..
I have also seen several references to OSC as RA6, etc... I just simply need to know what to read to find out how to use the internal oscillator and set it appropriately.. anyone have a few mintues to help out with a reply..
Not quite sure as i didn't see any parts of your code but, if your 8MHZ setting is ok, you also must add DEFINE OSC 8 at the top.. did you?
for the internal setting, see datasheet in the OSCCON. all the setting are there.
in your case for 8MHZ
OSCCON=%01111000
for 4MHZ
OSCCON=%01101000
and so on for the other type of setting
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Much closer.. THANKS!
I now see data on the LCD and on the 4800b Hyperterm screen, but the numbers are incorrect.. and the routines run differently..
Where data was reporting '1009', the text tag is fine, but the actual data is different..... like '3345', etc.
It looks like a timing problem some way?
Would the config bits effect this?
TG
As we don't have any more info on your current project, it's still hard too see what's wrong with.. BUT at least, since your LCD and your serial communication are working without any kind of garbage display, it's a good sign that your PIC and code are running at the good speed.
If you did some assembler delay or something using TIMERs you must set your prescallers, rates, and delay with the new crystal speed
Did you try with the internal 4MHZ setting???
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Hi everybody, I have just started to learn about pic programming. My searches through Google end up in this forum most of the time.
Could you please guide me to this FAQ section mentioned? I tried every FAQ link on the pages but I am unable to find the correct one which will take me to the place where this INTRC_OSC_NOCLKOUT and other options are explained.
Thanks.
I think this is what you are looking for
http://www.picbasic.co.uk/forum/showthread.php?t=543
Dave
Always wear safety glasses while programming.
Bookmarks