External crystal for PIC18F13k50

Thread Starter

shteii01

Joined Feb 19, 2010
4,644
I am doing a bit of research.

I am looking at PIC18F13k50. I saw that it can use 48 MHz external oscillator. So I decided to look into it. Looking into datasheet, it got a couple of nice pictures, no numbers, Figure 2-2. Found table in the end of the datasheet, Table 27-1. Table shows that 48 MHz is only doable with external clock module. The highest I am seeing for external crystal is 20 MHz.

Did I get this right? 20 MHz is the fastest crystal I can use?

Also. How do I figure out the capacitors for the crystal? Note 1 after Figure 2-2 lists 4 articles, I looked through first one and I did not see what I needed.

Datasheet: http://ww1.microchip.com/downloads/en/DeviceDoc/41350E.pdf
 

Thread Starter

shteii01

Joined Feb 19, 2010
4,644
it has a 4x PLL you need 12 MHZ crystal
Yes, you are right, but for a different reason. I finally got to the part of datasheet that deals with USB. That part clearly says to get either 6 MHz or 12 MHz crystal, and for setup I am thinking about they say to get 12 MHz. So this part is now crystal clear to me.

Can you advise me on the capacitors for the crystal. I was looking through digi key and they list load capacitor needed for specific crystal they sell. So I guess that is where I learn what capacitors to use, is that right? I don't actually need to figure out the capacitors. I simply choose the crystal to buy and then look at that crystal's datasheet to see what capacitors I need. Right?
 

Thread Starter

shteii01

Joined Feb 19, 2010
4,644
I have never found capacitance value to be super critical.
15-22pF always seem to work.
That's the thing. I have never setup a uC from scratch. The one class I had on uC we used a development board that had the buttons, the lcd and led. All we, the students, had to do is write the program in C and upload it to the chip.
 

THE_RB

Joined Feb 11, 2008
5,438
Buy a bag of 100 ceramic 15pF caps, and that will do you for years. Or 22pF.

Then for every project it's just a xtal of your choosing and two caps.

I keep an eye open for xtals in surplus quantities too, 8MHz 10MHz and 12MHz.

3-pin resonators are great because they do the whole lot in one device, and can be bought cheap. But they are only accurate to about 0.5% freq so are no good for proper timekeeping applications, but are fine for simple timed periods etc.
 

takao21203

Joined Apr 28, 2012
3,702
I tried a 6mhz resonator and it took me hours of time trying until i changed to 12mhz crystal osc and then it suddenly worked.
 
That's the thing. I have never setup a uC from scratch. The one class I had on uC we used a development board that had the buttons, the lcd and led. All we, the students, had to do is write the program in C and upload it to the chip.
That is the case everywhere and with things like Arduino coming up...people dont even have to bother about them any more...even out of class work... regrettable but what can one do about it.
 
I am doing a bit of research.

I am looking at PIC18F13k50. I saw that it can use 48 MHz external oscillator. So I decided to look into it. Looking into datasheet, it got a couple of nice pictures, no numbers, Figure 2-2. Found table in the end of the datasheet, Table 27-1. Table shows that 48 MHz is only doable with external clock module. The highest I am seeing for external crystal is 20 MHz.

Did I get this right? 20 MHz is the fastest crystal I can use?

Also. How do I figure out the capacitors for the crystal? Note 1 after Figure 2-2 lists 4 articles, I looked through first one and I did not see what I needed.

Datasheet: http://ww1.microchip.com/downloads/en/DeviceDoc/41350E.pdf
In my experience with PICs...these days I first look at the errata and then decide I want to use a particular controller... In the past I have had situations where I chose a controller for a specific reason, only to find later that that they forgot to put the feature in...when they manufactured the IC !!!

If you are working with new controllers do check out the errata too.
 

ErnieM

Joined Apr 24, 2011
8,415
I have never personally has issues using a crystal on a PIC. I shoot for 22pF but if I only have something smaller then I go and use that.

I have never personally has issues using a resonator on a PIC. I shoot for one with a 22pF capacitance but if I only have something close then I go and use that.

Resonators are not quite as accurate as crystals, which leaves them out of USB applications, but if I can use one I do use one. Spares the mess of 2 additional caps.

(And just to be a sneaky devil and derail this thread: you can terminate the caps to Vdd or Vss, it just does not matter, so just use the closest one. )
 

THE_RB

Joined Feb 11, 2008
5,438
It's good layout design to surround the xtal with a ground plane and connect the two caps to that. Some of the SMD parts require it and show PCB layout examples in their datasheet.
 
Top