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
ProfJannes
PostPosted: Mar 13, 2012 - 12:04 PM
Newbie


Joined: Feb 15, 2012
Posts: 9


Hi, I am waiting for hardware to arrive, so until then I have to code 'blind'. I am trying to test my RTC code, but the:

Code:

OSC_RC32KRDY flag is never set to one (no stable clock)


I enable the 32.768 kHz internal clock by using the following (I have checked to see if the bit is set high)

Code:

OSC.CTRL   =   OSC_RC32KEN_bm;


Any tips on how to test the RTC with AVR Simulator would be great.

~ Jannes
 
 View user's profile Send private message  
Reply with quote Back to top
GTKNarwhal
PostPosted: Mar 14, 2012 - 01:41 AM
Hangaround


Joined: Apr 29, 2011
Posts: 207
Location: Portland, OR, US

Code:
OSC.CTRL = OSC_RC32KEN_bm;
Ouch! That's going to turn off all other clocks, including the RC2M clock (the default system clock source). This should work better:
Code:
OSC.CTRL |= OSC_RC32KEN_bm;

_________________
Gamu The Killer Narwhal
Portland, OR, US
_________________
Atmel Studio 6.1 on Windows 8
XMEGA-A1/XMEGA-A3BU
AVR Dragon (Ver. 2)
JTAGICE mkII
 
 View user's profile Send private message Send e-mail  
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