Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PIC16F877A 4MHz Crystal vs 20MHz Crystal

Status
Not open for further replies.

mrgreco

Newbie level 2
Joined
Apr 22, 2009
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,316
20mhz crystal

Hello!

I am using a PIC16F877A, currently with a 4MHz crystal with two 22pF capacitors. My question is, what is the generall difference between using a 4MHz compared to a 20MHz crystal? What are the ups and downs for picking one of them?
 

4mhz crystal

With a 20MHz crystal the processor will run 5 time faster than with a 4MHz one. The up side is your code runs faster, the down side is that it may be harder to control emitted EMI - RF interference generated by you board.
 
20 mhz crystal

Hi,
The only advantage is the faster execution at 50nS / Instruction. But the downside is the increased power consumption due to the increased frequency.Depends on your application really.
 

pic16f877a 20 mhz

Hi mrgreco,

If your circuit requires faster execution speed, use 20MHz crystal instead of 4MHz and your instruction cycle will be 200ns instead of 1us in case of 4MHz crystal. Thanks.
 

advantage of pic16f877a

funnynypd said:
It take a lot of energy running at higher frequency.
The PIC16F877A with a Vcc of 5.0V draws about 1.8mA at 4MHz and 5.5mA at 20MHz. If you are running off of batteries this may be "a lot of energy", but not if you are running off line power. If you're running on batteries I'd look at one of Microchip's NanoWatt devices.
 

why do you use 4mhz crystal instead of 20mhz?

funnynypd said:
That means your battery will running 3x shorter than lower frequency.
Again, I wouldn't recommend a PIC16F877A for battery operation - use a Nanowatt Device!
 

crystal 20mhz

Thank you all for the answers, they have been helpful in our choice of crystal! :)
 

hello all,
Am going to use pic16f877 to detect the PWM signal. Note that am not using the PWM signal that can be generated using pic16f877.

Am using 4Mhz oscillator and how do i decide the value of capacitors to be used with it. Because i have noted 4MHz crystal being used with 33pF, 22pF and 15pF.

does the value of capacitors depend on the pic we are going to connect the oscillator or can we use any cap value there?

Hoping a soon reply.

Thanks.
 

hello all,
Am going to use pic16f877 to detect the PWM signal. Note that am not using the PWM signal that can be generated using pic16f877.

Am using 4Mhz oscillator and how do i decide the value of capacitors to be used with it. Because i have noted 4MHz crystal being used with 33pF, 22pF and 15pF.

does the value of capacitors depend on the pic we are going to connect the oscillator or can we use any cap value there?

Hoping a soon reply.

Thanks.

It's better to use 3 pin resonator 4MHz.See datasheet.

---------- Post added at 15:15 ---------- Previous post was at 15:12 ----------

It is better to use 3 pin resonator 4MHz.See datasheet.
 

That capacitors really doesn't make any sense... The capacitors [15pF, 22pF, 33pF] placed across crystal used for Thermal compensation... Some people may call it as a thermal compensation capacitors... As per rule we should put one resistor parallel to crystal so that it can form pi network [This 'RC' compensation will provide PI network]... PIC16F877 doesn't require this 'RC' compensation circuit [It has inbuilt one]... Without capacitors itself it will work properly...
 

Does every pic16f877a works with 20Mhz crystal or some special version of them ?
 

Every PIC16F877A works with 20MHz crystal. Unless of course, if the chip is damaged, flawed or fake.
 
Last edited:

Will the PIC16F877A works without a crystal oscillator ?

Why do we need capacitors connected with oscillator ?
 
Last edited:

Will the PIC16F877A works without a crystal oscillator ?

Why do we need capacitors connected with oscillator ?


Yes. With an Internal RC oscillator. Most MCUs work with internal RC oscillator but not at 20 MHz.

No, The 877A does not have an internal oscillator.

You must use a Crystal and Caps or some other external device, see the 877A datasheet, Oscillator section for details
 
Operating frequency for PIC16F877A ? (i.e. internal oscillator frequency highest and lowest)
 

Operating frequency for PIC16F877A ? (i.e. internal oscillator frequency highest and lowest)

As wp100 mentioned the PIC16F877A does not offer an internal oscillator, however as the PIC16F877A is now considered a mature legacy component, its recommended replacement is the PIC16F887 which does offer an internal oscillator.

And the PIC16F887 still offers a DC to 20MHz operating frequency range for external crystal or oscillator configurations.

PIC16F887 Internal Oscillator Features:
Precision Internal Oscillator:

Factory calibrated to ±1%
Software selectable frequency range of 8 MHz to 32 kHz
Software tunable
Two-Speed Start-Up mode
Fail-safe clock monitoring for critical applications
Clock mode switching during operation for low-power operation

Side By Side Comparison of PIC16F877A and PIC16F887

PIC16F887 Product Page

Another advantage of the PIC16F887 over the mature legacy PIC16F877A, besides the numerous additional features, is the pricing, less then half that of the PIC16F877A:

Pricing for quantities of 1 to 25:

PIC16F877A-I/P $4.94 USD
PIC16F887 $2.20 USD


I would strongly recommend you consider the PIC16F887 over the PIC16F877A.


BigDog
 
Another advantage of the PIC16F887 over the mature legacy PIC16F877A, besides the numerous additional features, is the pricing, less then half that of the PIC16F877A:

Pricing for quantities of 1 to 25:

PIC16F877A-I/P $4.94 USD
PIC16F887 $2.20 USD


I would strongly recommend you consider the PIC16F887 over the PIC16F877A.

While I too recommend PIC16F887 over the PIC16F877A, I would just like to point out that in some places (eg in places in India, Bangladesh, etc), the PIC16F877A is ridiculously inexpensive whereas the PIC16F887 is unreasonably expensive. The price values you mentioned would surprisingly be interchanged between the 2 parts!
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top