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

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1104
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 453 times
Been thanked: 505 times
Contact:

Crystal selection advise required please

Postby Steve001 » Wed Aug 10, 2011 8:35 pm

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: 381 times
Been thanked: 716 times
Contact:

Re: Crystal selection advise required please

Postby JohnCrow » Wed Aug 10, 2011 10:00 pm

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: 1104
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 453 times
Been thanked: 505 times
Contact:

Re: Crystal selection advise required please

Postby Steve001 » Thu Aug 11, 2011 7:23 am

Hi John,

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

Steve
These users thanked the author Steve001 for the post:
JohnCrow (Thu Aug 11, 2011 7:49 am)
Rating: 5.26%
 
Success always occurs in private and failure in full view.

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

Re: Crystal selection advise required please

Postby Benj » Thu Aug 11, 2011 10:04 am

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.
These users thanked the author Benj for the post:
Steve001 (Thu Aug 11, 2011 4:05 pm)
Rating: 5.26%