Padu wrote: > I'm designing a circuit using a PIC18F452 that is going to communicate > through USART at 115200bps. From the pic datasheet, I calculated that > the ideal crystal for my app is 14.7456MHz (or 7.3728MHz, but I'll > stick with the faster because I need the extra speed). You probably don't need a crystal that allows hitting the baud rate exactly. If you need the cycles, just use a 10MHz crystal with the 4x PLL. You'll be able to hit 115.2Kbaud close enough. I've done this many times. Also note that you'd be better off with the 7.3728MHz crystal and 4x PLL than the 14.7456MHz crystal if cycles are important. > I selected the Abracon ABLS at exactly that speed (how convenient 8^D), > and on its datasheet it specifies "Load Capacitance" at 18pF and Shunt > capacitance at 7pF. My questions: There's a lot of misinformation and waving of dead fishes surrounding crystal load caps. The load capacitance spec means that this crystal is rated for operation in parallel resonant circuits like a PIC crystal oscillator. 18pF is the load the crystal needs to see accross its leads so that it produces the required phase shift for a parallel resonant circuit at the rated frequency. The tricky part is "accross its leads", since that's not where you put the load capacitor in a PIC oscillator circuit. Another way to think of this is that if the crystal were driven with a 0 impedence sine wave at the rated frequency on one pin, the load capacitance would need to be from the other pin to ground to get the right phase shift. In this case the sine wave voltage source and the load cap are in series from the crystal's point of view, so their impedence's add. Since the voltage source has 0 impedence by definition, the effective impedence accross the crystal pins is just the load capacitor. This is closer to but not the same as a PIC crystal oscillator, mostly since the PIC crystal driver output does not have 0 impedence, and it doesn't produce a pure sine either. We usually put a capacitor directly on the PIC crystal driver output (OSCO pin). This serves both to reduce its effective impedence and to attenuate harmonics (make the signal more a pure sine). It makes it closer to the ideal voltage source of above, but of course it doesn't get there. Then we put a "load capacitor" on the crystal output (OSCI pin) to hopefully adjust the overall impedence the crystal sees accross its pins to the load capacticance it is rated for. However, calculating the true load capacitance the crystal sees is not so easy. On the input there is the PIC driver impedence in parallel with OSCO capacitor. This is in series with the capacitor on the OSCI pin. Then there is the OSCI pin input capacitance to consider, plus various stray capacitances all around which are significant since we're counting only a few pF. In the end it becomes impossible to calculate the best OSCI capacitance to add because too many variables are unknown. So I usually stick to the short answer and put 22pF on both OSCO and OSCI and be done with it. I'm sure your crystal rated for 18pF load will work fine with 22pF to ground on each side. Those two capacitors alone account for 11 of the 18 required pF. It seems about right that the non-zero impedence of the OSCO driver and the various pin and stray capacitances can make up the other 7pF. Unfortunately "seems about right" is as close as you're going to get. Fortunately, the system is fairly forgiving of errors on this value. > 2-What's the recommended type of capacitor in this case (ceramic, > tantalun, electrolytic, etc). At 22pF you're not going to find tantalum or electrolytic. Ceramic has better characteristics anyway. > Is SMD fine? It's actually better since it has less stray inductance, assuming the circuit is laid out well. ****************************************************************** Embed Inc, Littleton Massachusetts, (978) 742-9014. #1 PIC consultant in 2004 program year. http://www.embedinc.com/products -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist