CLOCK setup question

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

Can someone tell me how to set peripheral clock to be faster of ATxmega128A1U? I want it to run at 32 MHz, in order to run my ADC 

 

 

 

 

Last Edited: Thu. Jun 15, 2017 - 11:52 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I found this online, and the project is built when this is tried:

 

    OSC.CTRL = OSC_RC32MEN_bm; //enable 32MHz oscillator
    while(!OSC.STATUS & OSC_RC32MRDY_bm);    //wait for stability
    CCP = CCP_IOREG_gc; //secured access
    CLK.CTRL = 0x01; //choose this osc source as clk
        

 

I assume, now I just need to find out if the register changes

Last Edited: Thu. Jun 15, 2017 - 12:21 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Can someone tell me how to set peripheral clock to be faster of ATxmega128A1U?

I'm not sure what you are asking.  Do you want F_PER to be faster than F_CPU?  Or do you want to change the system clock source from the default RC2M source to the RC32M source?

 

Greg Muth

Portland, OR, US

Xplained Boards mostly

Atmel Studio 7.0 on Windows 10