0
\$\begingroup\$

If i want use a watch crystal(32KHz) with Low Frequency Crystal Oscillator of ATmega328p,Which pin should i connect the crystal to?

Should i connect the crystal to XTAL1,XTAL2 pins of ATmega328p

or

Should i connect the crystal to TOSC1,TOSC2 pins of ATmega328p

\$\endgroup\$
0
\$\begingroup\$

The XTAL pins are also the TOSC pins, so you really don't have an option to go wrong here.

\$\endgroup\$
  • \$\begingroup\$ Are you saying that XTAL pins and TOSC pins are internally connected and i can connect the crystal to either XTAL pins or TOSC pins to use the LOW Frequency Crystal Oscillator \$\endgroup\$ – Rahul.In Apr 10 at 5:07
  • \$\begingroup\$ Just look at the MCU pins on datasheet. You will find that TOSC pins are same as XTAL pins. \$\endgroup\$ – Justme Apr 10 at 8:16
0
\$\begingroup\$

A 32.768 kHz crystal is a crystal and needs to be connected to the "Low-frequency crystal Oscillator" which is connected to the TOSC1 and TOSC2 pins.

Which are the same pins as the XTAL1 and XTAL2 pins!

Are you confused yet?

The function of these pins is defined by the settings defined by the clock selection fuses. These are discussed in section 6.2 of the datasheet.

So you might have to (re)program the "fuses" to allow the 32 kHz crystal to be used.

Also realize that at a 32 kHz clock the MCU will operate quite slowly.

If you want to make a clock using an MCU, consider a dedicated RTC (Real Time clock) module like the DS1307.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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