18F452 RC oscillator mode

Apr 01, 2008 7 Replies

I read in ( 18Fxx2 DataSheet )


>>
formatting link

that I can use a Resistor and a Capacitor to clock the 18f452 PIC


Page 18 says (including a diagram) :


Recommended values:3 k=A6=B8 =A1=DC REXT =A1=DC 100, CEXT > 20pF


But there is not place I can find the achieved clocking related to those values.


Any clue ? Sebastian.

Well the text says that there are many factors that affect the frequency so you won't get a tight tolerance for a start.

This is a simple RC charge and discharge circuit, the switching levels will be in the data sheet for logic highs and lows so you should be able to calculate under nominal conditions the charge and discharge times. Add these two together and there's your period of oscillation. That's where I'd start followed quickly with a practical test to see how many 10's of % i'm away from what I calculated!

I'm sure there's a Microchip App Note for this, they're usually pretty good on these sort of things.

What frequency and what tolerance do you need?

Dave.

Dave : you say

??? Add these two together and there's your period of oscillation ???

How can you add Ohms to Farads ? What units is the result ?

I need a "normal" frequency, lets say 1 or 5 or 10 MHz ...

Thanks. Seb.

No Seb, please re-read what I wrote and also quote what you are referring to so that the discussion is easier to follow as I am doing here.

I wrote:

...so you should be able to calculate under nominal conditions the charge and discharge times. Add these two together and there's your period of oscillation.

So I am saying add together the charge and discharge times to get the period, units are seconds.

There's no such thing as a normal frequency, you choose the value required by your application. If your frequencies are in the MHz then using the RC is probably not the way to go. Use a crystal.

You still haven't said what tolerance you need.

I think the point is that your frequency will not be "normal" it will vary, from part to part, by temperature, and by variations of Vdd. Anyway, if you look at Figure 23-12 on page 294 of the documentation, there is a graph that shows frequency VS Vdd and 'R' value.

Jim

Thanks, Dave, for your patience. My application is quite simple : I want to measure a solar cell voltage let's say 1 time every second. I want my PIC to run "easy", and dont like the frequency to change with temperature and power supply, so I guess I shall use a crystal.

JIM : do you think it is normal a) to have the "RC oscilator" on page 18, and b) have the drawing on page 294

??????????

Without any "pointer", no text, no formula ??? ok.

Anyway, thanks a lot for the pointer to the page. if C = 20 pF and R = 3K3 then f = 3,5 MHz.

Shall try it next weekend.

Cheers ! Seb.

Well, it is for Microchip. :) The table of contents lists "23.0 DC and AC Characteristics Graphs and Tables". Seemed like a logical place to look, but some type of reference on the appropriate page(s) would be nice.

Yep, see above.

Yeah, maybe, sort of, on most/some parts. I think a cheap ceramic resonator would be cheap insurance.

Jim

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required