PDA

View Full Version : Prob osc with PIC16f876 20 sp



kris
- 5th March 2006, 22:20
Hello,

I use a pic 16f876 20sp with oscillator 20 mhz and 2 capacitors 33 pf and
my prog is:

Define osc 20

loop: PORTB.0=0
Pause 500
PORTB.0=1
Pause 500
Goto loop
End

Why my prog doesn't work? I don't understand because the same prog with pic 16f876 4sp with oscillator 4 mhz and 2 capacitors 33 pf works ( lineless
Define osc 20)
If you know with probleme please help me!

Thank you Kris

Melanie
- 5th March 2006, 22:36
33pF seems high at 20MHz... remove the Caps and see if it works then.

Bruce
- 6th March 2006, 00:13
Are you setting oscillator selection bits in config word for HS?

A 20MHz crystal requires a higher drive level output on osc2. Make sure you
set config word for HS instead of XT.

kris
- 15th March 2006, 10:08
I changed my caps by 10 pF and my pic work correctly.

I have another question, How you choose yours caps ?
thank you

Melanie
- 15th March 2006, 12:19
If I told you Kris, everybody would start doing it...

Aw, all right, just between you and me - I read the PIC Datasheet!