Selecting external crystal for PIC

Status
Not open for further replies.

simonwai999

Advanced Member level 4
Joined
Jun 30, 2008
Messages
114
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
2,175
hi folks
i am new to pics
and i am confused with the external crystal thing
ok
let's take 16f877a for example
the max speed is 20Mhertz
if i use a 4Mhertz to connect to it
does it mean the pic takes 1/4 of the crystal for an instruction ?
then if i use 20M ( the max speed) to connect to it
does it mean the pic take 5M hertz per an instruction?
The external crystal controls the speed of the pic instruction
am I right?
I am thinking about using 16f877a to connect to drive a 16x2 LCD module
just to try to send text to it
so 4M hertz crystal is enough right??

please help and correct me if i am incorrect
thanks a lot
 

Re: choose a crystal

Yes, if you use a 4MHz crystal for the oscillator, the PIC instruction cycle will be 4/4MHz = 1 us (or in other words, instructions are executed at 1mips - not true if the instruction has a jump). The same applies to 20MHz crystal (5 mips).

A 4MHz clock (1 mips) is enough to run a 16x2 LCD.

Note that 4MHz needs the XT mode in the config fuse word. 20MHz crystal needs the HS mode in the config word.
 

Re: choose a crystal

hi
wow
very clear and nice answer to my question
thanks a lot pal
simon
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…