4 Test Firmware

Test firmware for outputting the clock signal to an I/O port that may be loaded with a standard 10X probe is included in the .zip file distributed with this application note. Do not measure the crystal electrodes directly if you do not have very high impedance probes intended for such measurements.

Compile the source code and program the .hex file into the device.

Apply VCC within the operating range listed in the data sheet, connect the crystal between XTAL1/TOSC1 and XTAL2/TOSC2, and measure the clock signal on the output pin.

The output pin differs on the different devices. The correct pins are listed below.

  • ATmega128: The clock signal is output to PB4, and its frequency is divided by 2. The expected output frequency is 16.384 kHz.
  • ATmega328P: The clock signal is output to PD6, and its frequency is divided by 2. The expected output frequency is 16.384 kHz.
  • ATtiny817: The clock signal is output to PB5, and its frequency is not divided. The expected output frequency is 32.768 kHz.
  • ATtiny85: The clock signal is output to PB1, and its frequency is divided by 2. The expected output frequency is 16.384 kHz.
  • ATxmega128A1: The clock signal is output to PC7, and its frequency is not divided. The expected output frequency is 32.768 kHz.
  • ATxmega256A3B: The clock signal is output to PC7, and its frequency is not divided. The expected output frequency is 32.768 kHz.
  • PIC18F25Q10: The clock signal is output to RA6, and its frequency is divided by 4. The expected output frequency is 8.192 kHz.
    Important: The PIC18F25Q10 was used as a representative of an AVR Dx series device when testing crystals. It uses the OSC_LP_v10 oscillator module, which is the same as used by the AVR Dx series.