I have a quartz crystal and I am connecting it to a microcontroller's EXTAL and XTAL pins.
- Can I connect it anyway?
- Do the crystals have polarity?
- In EXTAL and XTAL, which is input and which is output pins?
I have a quartz crystal and I am connecting it to a microcontroller's EXTAL and XTAL pins.
Do the crystals have polarity?
No.
In EXTAL and XTAL, which is input and which is output pins?
This might vary between different MCUs (check the datasheet for yours). The convention I have seen on MCUs is shown in the following diagram (and many others - this diagram was just picked at random):
(Image Source: Freescale Semiconductor Application Note AN2049: Some Characteristics and Design Notes for Crystal Feedback Oscillators, page 2)
As explained in that appnote and shown on the diagram, EXTAL is an input and XTAL is an output.
Update: As kindly commented by TimWescott, the E of the EXTAL pin is likely to be because that's where an External oscillator signal (e.g. from a crystal oscillator output or other driver) would be connected, thereby showing that EXTAL is an input.
While that fits my observations with various MCUs, it's always possible that a manufacturer chose to deviate from the diagram and common labeling above. So if you're unsure, check the relevant MCU datasheet e.g. looking for a diagram similar to the one above.