Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
robcikss
PostPosted: Feb 15, 2012 - 12:44 PM
Newbie


Joined: Jan 11, 2012
Posts: 7


Hi,

I managed to connect XMEGA-A1 Xplained and ENC28J60-H boards, but I encountered a problem when I tried to set XMega frequency to 32 MHz (internal RC)- ENC28J60-H board stopped working, well at least responding.

With internal RC at 2MHz everything works fine; ENC28J60-H SPI can work up to 20 MHz (according to Datasheet). Even when I prescaled SPI down to 1MHz (with 32MHz clock) ENC28J60-H board doesn't respond.

I used this code to enable 32MHz:

Code:
OSC.CTRL = OSC_RC32MEN_bm;
//Wait for internal oscillator to stabilize
while ( !(OSC.STATUS & OSC_RC32MRDY_bm) );

//Disable change protection for clock
CCP = CCP_IOREG_gc;
//Change clock control register
CLK.PSCTRL = 0x01;
      
CCP = CCP_IOREG_gc;
//Change clock control register
CLK.CTRL = CLK_SCLKSEL_RC32M_gc;

//Choose clock source   
OSC.PLLCTRL=0x00;
OSC.PLLCTRL|=0x80


Any ideas?

Thank you in advance!!
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits