[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-chat] [SOLVED] Enabling external oscillator on XMEGA?
From: |
Rick Mann |
Subject: |
Re: [avr-chat] [SOLVED] Enabling external oscillator on XMEGA? |
Date: |
Sat, 25 May 2013 15:20:19 -0700 |
Ah! I needed to call:
CLKSYS_XOSC_Config(OSC_FRQRANGE_12TO16_gc, false,
OSC_XOSCSEL_XTAL_256CLK_gc);
before enabling the oscillator. The XPLAINED notes didn't indicate this.
On May 25, 2013, at 15:01 , Rick Mann <address@hidden> wrote:
> I'm trying to enable a 16 MHz crystal I have connected on an ATxmega256A3U. I
> can get it to run okay using the internal 2 MHz, 32 MHz, and 2 MHz * 15 PLL
> clocks.
>
> But it doesn't work with the external oscillator using the following:
>
> CLKSYS_Enable(OSC_XOSCEN_bm);
> do {} while (CLKSYS_IsReady(OSC_XOSCRDY_bm) == 0);
> CLKSYS_Main_ClockSource_Select(CLK_SCLKSEL_XOSC_gc);
> CLKSYS_Disable(OSC_RC2MEN_bm | OSC_RC32MEN_bm | OSC_RC32KEN_bm);
>
> The crystal isn't driven, and the loop to check to see if the oscillator is
> ready never exits.
>
> It's possible I damaged the xtal during reflow (the oven ran 20°C hotter than
> it should). But I'm not sure I'm not missing some crucial step in software
> first.
>
> Any suggestions? Thanks!
>
> --
> Rick
>
>
>
>
> _______________________________________________
> AVR-chat mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/avr-chat
--
Rick