Continue to Site

# crystal capacitors, digital inputs

Status
Not open for further replies.

#### mynameisdan

##### New Member
I'm getting into electronics after a few years away (and I was only really a novice then), and I thought that a simple circuit involving a PIC would be a good place to start.

So first off, I'm using a 40Mhz crystal for a PIC18F4550 and I'm wondering what value capacitors to use. I've searched and found nothing on determining the actual value of these, just that they exist.

The digital inputs are theoretically ∞ impedance, so would it matter if the voltage applied to it was slightly above the rated logic voltage and just with a current limiting resistor (12v)?

I'm getting into electronics after a few years away (and I was only really a novice then), and I thought that a simple circuit involving a PIC would be a good place to start.

So first off, I'm using a 40Mhz crystal for a PIC18F4550 and I'm wondering what value capacitors to use. I've searched and found nothing on determining the actual value of these, just that they exist.

The digital inputs are theoretically ∞ impedance, so would it matter if the voltage applied to it was slightly above the rated logic voltage and just with a current limiting resistor (12v)?

hi,
I would use 12pF caps on a 40MHz crystal.
The digital inputs have internal clamp diodes to 0V and +Vs , rated at < 20mA, so I would use a series resistor as a limiter or resistor potential divider.

EDIT:
Note the 18F4550 has an internal PLL, so you can use a lower frequency crystal if required.

Last edited:
hi,
I would use 12pF caps on a 40MHz crystal.
The digital inputs have internal clamp diodes to 0V and +Vs , rated at < 20mA, so I would use a series resistor as a limiter or resistor potential divider.

EDIT:
Note the 18F4550 has an internal PLL, so you can use a lower frequency crystal if required.

Thanks very much, is there anywhere I can find this information? For example a lookup up reference or a general formula? Or is it based on experience?

Also thanks for the info on the clamping diodes, should be easy to work out the correct current limiting resistors.

Thanks very much, is there anywhere I can find this information? For example a lookup up reference or a general formula? Or is it based on experience?
I think you'll find that most crystal datasheets have the rated load capacitance listed. You can buy crystals made for different capacitance values.

If you're working with a random crystal (out of your junkbox or whatever) then just start out with the recommended value from the PIC datasheet. It'll most likely be fine. The value doesn't usually have to be precisely correct - just somewhere reasonably close.

Last edited:
I wouldn't recommend a 40 MHz crystal. It is likely to be a 3rd overtone crystal, which will oscillate more easily at its fundamental frequency (about 16.666 MHz) than it will at 40 MHz. You have to add components to reduce the gain at 16.666 MHz so that it can only oscillate at 40 MHz.

10 or 20 MHz and enabling the PLL is a lot easier.

It is also obvious that the OP hasn't read the excellent MicroChip Data Sheet for the processor the OP is using. All of the questions the OP asked are answered there.

The USB won't work with a 40MHz crystal. There is a table of common crystal values in the datasheet.

Status
Not open for further replies.

Replies
0
Views
2K
Replies
5
Views
2K
Replies
5
Views
2K
Replies
19
Views
4K
Replies
8
Views
1K