Crystal selection advise required please

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Crystal selection advise required please

Post by Steve001 »

Evening ,

looking at my next project which uses a pic16f73 with lcd display and a pwm output to drive a resistor to generate heat for checking thermocouples, with a lm58 temp sensor for feedback.

Not too sure how to select the crystal size looking for some advice as 20 Mhz seems a bit excessive and possibly too fast ?
i don't need mega quick, how will a 3 or a 1 mhz crystal affect the pwm and the lcd display ? Timings
how do i size the capacitors for the crystals ?

a confused steve
Last edited by Steve001 on Thu Aug 11, 2011 7:24 am, edited 1 time in total.
Success always occurs in private and failure in full view.

User avatar
JohnCrow
Valued Contributor
Valued Contributor
Posts: 1367
Joined: Wed Sep 19, 2007 1:21 pm
Location: Lincolnshire
Has thanked: 364 times
Been thanked: 716 times
Contact:

Re: Crystal selection advise required please

Post by JohnCrow »

Hi Steve.

Sounds an interesting project.
What sort of temperatures are you looking to generate?

Not used the LM58, I've done a few programs with the LM35, thats a nice simple device to use).
1 in 10 people understand binary, the other one doesn't !

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Re: Crystal selection advise required please

Post by Steve001 »

Hi John,

Looking for 150 C the LM58, is simlar to the LM35 but higher temp

Steve
Success always occurs in private and failure in full view.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Crystal selection advise required please

Post by Benj »

Hello,

Regarding crystals you must remember that the pic will run at 1/4 of the crystal speed and then things like PWM will run up to 1/4/16 times slower.

If your using Flowcode then the LCD timings will always be correct as long as you enter the correct crystal speed into Flowcode. Otherwise you need to setup loops to delay for the correct period when driving the LCD.

Capacitor values can be seen in the device datasheet under the oscillator section but I normally use 18 or 22pF for most crystals.

Post Reply