I know that the blow red encircled component is the 16MHz Crystal Oscillator (XTAL):

enter image description here

But PB6 and PB7 pins are called XTAL1 and XTAL2 pins which are not accessible by the Arduino board.

Are these pins where the 16MHz crystal oscillator is connected. But if so why are they two of them? I searched net but couldn't find explicit information about these.

How many clocks in total this board have?

3 Answers 3


Yes they connect to the crystal. There's two of them because a crystal has two pins.

  • 2
    But what is the difference between them? One is not ground. So they have difference in implementation or use. Is that something to do with CMOS or TTL interfacing? Im looking for a more detailed answer.
    – floppy380
    Commented Nov 7, 2019 at 15:25
  • Look up some typical crystal oscillator circuits. All but the crystal is inside the chip.
    – Majenko
    Commented Nov 7, 2019 at 15:26
  • Im asking what is the difference between XTAL1 and XTAL2 explicitly not how to connect a crystal osc to them.
    – floppy380
    Commented Nov 7, 2019 at 15:30
  • One is the drive output and the others the sense input. To understand what they do you first have to understand how a crystal oscillator circuit works.
    – Majenko
    Commented Nov 7, 2019 at 15:35
  • electronics-tutorials.ws/oscillator/crystal.html scroll down to the CMOS oscillator. The gates are inside the mcu. Where the crystal fits in that circuit are the xtal1 (gate input) and xtal2 (junction between two gates).
    – Majenko
    Commented Nov 7, 2019 at 15:39

The Crystal in Red is for the Atmega16U2 that manages the USB interface with its high speed connection to the PC (12 MHz for USB2 I think).

The Resonator in Yellow is for the Atmega328P. It is less precise than the crystal oscillator.

PB6 and PB7 are dedicated to the external crystal or resonator by the fuse settings used for Arduino.

You can read more about the XTAL1, XTAL2 pins and the fuses from the device datasheet


You can connect a crystal to the pins, but you will also need 22pF caps to connect from the pins to Gnd. And remove the resonator. Current Uno layout does not really support making those connections.


XTAL1 is the input and XTAL2 is the output of the oscillator. Using 8MHz internal RC oscillator instead of the crystal, you can use PB6 and PB7 as I/O, like other I/Os.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.