PLL ATXMEGA32A4

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

i need to work with a high frequency, but i dont know how to obtain a frequency greater than 32 MHz.

im using AVR STUDIO 5. can anybody help me whit a PLL routine?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, so many questions left unanswered.

Disclaimer: If you run the chip out of spec it may not work. (Not rocket science, but have to make the disclaimer...)

The Max Clock for the Xmega is 32 MHz.

You can run it higher, out of spec, but adjusting the clock source, (The Xmegas have many source options!), and setting the PLL multiplier to what you want.

This example skips the Initializations and PCB setup and just provides the key routine to overclock the Xmega at 50 MHz, using the internal 2 MHz clock, and a PLL of 25.

JC

Clockopt8:
   '>>>>>> WORKS <<<<<<<
   'Try Overclocking for Logic Analyzer Sampling.
   'Xmega Max Spec is 32 MHz.
   'Incrementally Incr PLL using 2 MHz Int Osc.
   'PLL = x16 = 32 MHz = Baseline, in spec.

   'Set up the Xmega clock.
   'Run on Internal 2 MHz Osc, PLL= x25, Clk = 50 MHz.
   'This MANUALLY turns on the Xmega PLL.
   'Xmega runs at 2MHz on power up.
   Osc_ctrl = 15      'All Osc ON, PLL Off
   Clk_psctrl = 0     'No PreScaler in use
   Osc_xoscctrl = 195 '12-16MHz, 256 Clks
   Osc_pllctrl = 25   'PLL: Int 2 MHz Osc x 25  !!!
   Waitms 2
   Osc_ctrl = 31      'PLL ON, All Osc Sources On
   Waitms 2
   Cpu_ccp = 216      'Config Change Protection
   Clk_ctrl = 4       'Use PLL as Clock Source
   Return

Edited a typo or two, and reformatted the comments.

Last Edited: Fri. Jul 22, 2011 - 02:00 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you need clock faster than 32MHz, then XMega is not the device for your project!

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

DocJC wrote:
Well, so many questions left unanswered.

Disclaimer: If you run the chip out of spec it may not work. (Not rocket science, but have to make the disclaimer...)

The Max Clock for the Xmega is 32 MHz.

You can run it higher, out of spec, but adjusting the clock source, (The Xmegas have many source options!), and setting the PLL multiplier to what you want.

This example skips the Initializations and PCB setup and just provides the key routine to overclock the Xmega at 50 MHz, using the internal 2 MHz clock, and a PLL of 25.

JC

Clockopt8:
   '>>>>>> WORKS <<<<<<<
   'Try Overclocking for Logic Analyzer Sampling.
   'Xmega Max Spec is 32 MHz.
   'Incrementally Incr PLL using 2 MHz Int Osc.
   'PLL = x16 = 32 MHz = Baseline, in spec.

   'Set up the Xmega clock.
   'Run on Internal 2 MHz Osc, PLL= x25, Clk = 50 MHz.
   'This MANUALLY turns on the Xmega PLL.
   'Xmega runs at 2MHz on power up.
   Osc_ctrl = 15      'All Osc ON, PLL Off
   Clk_psctrl = 0     'No PreScaler in use
   Osc_xoscctrl = 195 '12-16MHz, 256 Clks
   Osc_pllctrl = 25   'PLL: Int 2 MHz Osc x 25  !!!
   Waitms 2
   Osc_ctrl = 31      'PLL ON, All Osc Sources On
   Waitms 2
   Cpu_ccp = 216      'Config Change Protection
   Clk_ctrl = 4       'Use PLL as Clock Source
   Return

Edited a typo or two, and reformatted the comments.

thanks for your code.

do you know how i do to set PORTC Bit7 for the Peripheral Clock output.

im using PORTCFG_CLKOUT_PC7_gc;, but i dont know ow tu use it.

thanks.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
do you know how i do to set PORTC Bit7 for the Peripheral Clock output.

im using PORTCFG_CLKOUT_PC7_gc;, but i dont know ow tu use it.

Have a look at the Atmel Xmega A Manual, (assuming you are using an "A" version Xmega).

Sectino 13.15.4 CLKEVOUT-Clock and Event Out Register.

This register routes the system clock to one output pin, or turns off the clock output and the pin reverts to normal digital I/O mode.

You must FIRST configure the specific pin (PortC.7, or PortD.7, or PortE.7) for output mode.

Then set bits 0 and 1 of the CLKEVOUT register to disable the normal digital I/O, and enable the routing of the clock signal to the pin.

The bits are set as shown in Table 13-8:

Table 13-8. Clock output configurations
CLKOUT[1:0] Group Configuration Description
00 OFF Clock out disabled
01 PC7 Clock output on Port C pin 7
10 PD7 Clock output on Port D pin 7
11 PE7 Clock output on Port E pin 7

How you set up the Xmega's pins for output mode, and how you write to the registers will depend upon your language and compiler being used.

JC