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
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.