245Views6Replies

Author Options:

how to solve external crystal problem in pic16F and its capacitance Answered

i have made a circuit of radio control switch with PIC16F and diplayed the value on LCD16X2, i am having the problem with its crystal frequency. When i set pic18F with its internal crystal of 4Mhz its working fine,but not with 16F using 4MHz  external crystal and 33pF capacitor so how should i solve the problem of external crystal and its capacitance for pic16F.

Discussions

0
None
Alia Bakhsh

4 years ago

i know that for PIC16F we can use only 3 capacitor values (15,22 and 33)pF as mentioned in datasheet but how may I select the crystal value..

i have tried combination of two 33pF with 20MHz and 4MHz then two 22pF with 20MHz crystal.

but program works for only few seconds.

0
None
Wired_MistAlia Bakhsh

Answer 4 years ago

I'd second the 22pF caps, they have always worked well for me:)

are both caps are tied to ground right? perhaps use a multi-meter to double check?

0
None
steveastroukAlia Bakhsh

Answer 4 years ago

When you program the device, you have to set certain internal fuses to use an external crystal, or it won't run. What have you set ?

0
None
verence

4 years ago

Put the crystal and the Cs as close to the µC as possible. I'm talking millimetres here, not centimetres. Did you check the crystal? Try another one. Try this one in another circuit. Did you set the correct configuration fuses?

0
None
steveastroukverence

Answer 4 years ago

Yeah, all of that too. The fuses are critical.

0
None
steveastrouk

4 years ago

Read Microchips notes

Crystal oscillator basics AN826