today i bought a 20MHz crystal for my PIC16F877. it has a big body and three terminals. the third terminal is connected to the body of the crystal. ive read somewhere that this helps reduce EMI. should i connect this to the ground or not. i mean is there any need for such measures. i dont think there would be much EMI generated by just flashing a bit of LEDs :lol:
Doesn't sound necessary but shouldn't hurt. I wouldn't bother to connect it to ground if it was going to pose any difficulty to do so.
I've use 16F877s quite a few times, always at 20MHz (using 2 22pf caps) as long as the crystal and caps are close to the PICs pins you should have no trouble.
I thing that your cristall is in fact a complete cristal oscillator. These oscillators have a cristall inside and a IC. One pin is for GND(this is usually connected to case), a second pin is for supply voltage(usually 5V), a third pin is for signal output.