• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » ARM® Processors » Sitara™ ARM® » AM3x Sitara ARM Processors Forum » Questions about OSC1, RTC and clocks (CLK_32K_RTC, CLK_32KHZ, CLK_RC32K)
Share
Sitara™ ARM®
  • Forum
  • Announcements
Options
  • Subscribe via RSS

Forums

Questions about OSC1, RTC and clocks (CLK_32K_RTC, CLK_32KHZ, CLK_RC32K)

This question is not answered
Qmax
Posted by Qmax
on Mar 22 2012 07:26 AM
Expert2260 points

Hi,

Accordingly to AM335x Datasheet, section 4.2.1, "OSC1 is disabled by default after power is applied. This clock input [(CLK_32K_RTC)] is optional and may not be required if the RTC is configured to receive a clock from the internal 32k RC oscillator (CLK_RC32K) or peripheral PLL (CLK_32KHZ) which receives a reference clock from the OSC0 input."

First question is: how to enable OSC1?

Second: looking at TRM, section 8.1.1.6.12 figure 8.17, it seems that RTC clock source can be CLK_32K_RTC or CLK_32KHZ, depending on RTC.OSC_REG.32KCLK_SEL register bit setting (default at reset is 0, i.e. use CLK_32KHZ). Therefore it seems not possible to use the CLK_32K: is it correct my understanding?

This seems evident also reading TRM section 20.3 about RTC_SS. But subsection 20.3.3.2, Clock Source, makes me further doubts:

"The clock reference for the RTC is an internal 32.768-kHz crystal or an external clock source of the same frequency. The source for the RTC reference clock may be provided by a crystal or by an external clock source. The RTC has an internal oscillator buffer to support direct operation with a crystal. The crystal is connected between pins RTC_XTALIN and RTC_XTALOUT. RTC_XTALIN is the input to the on-chip oscillator and RTC_XTALOUT is the output from the oscillator back to the crystal. The oscillator can be enabled or disabled by using the control module register rcosc_ctrl."

Which oscillator will be enaled/disabled using the rcosc_ctrl register (default at reset 0, i.e. osc active)? Is it the OSC1 or the on-chip 32K RC OSC used to generate the CLK_32K?

Looking at Linux Kernel source code, am335x_rtc_init function calls writel(0x48, base + 0x54), that is turn on bit 3 (32KCLK_SEL) and bit 7 (reserved) on RTC OSC_REG register. In this way RTC is configured to use the CLK_32K_RTC source, but what is bit 7 used for? There is no description on TRM...

Thanks for any clarification.

Regards,

Max



AM335x clock RTC
Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • JJD
    Posted by JJD
    on Mar 23 2012 16:45 PM
    Genius9280 points

    Max, thanks for the details in your post.  It looks like there are some errors in both the DM and TRM, so let me clarify some things:

    The RTC can only receive a clock from the 32KHz oscillator (CLK_32K_RTC), or the Peripheral PLL (CLK_32KHz).  This is selected using RTC.OSC_REG.32KCLK_SEL register.    Note this register refers to an internal clock source aux_clk, which in this case is the one coming from the Peripheral PLL (CLK_32KHz).  The external clock source in this register refers to the one from the 32K oscillator (CLK_32K_RTC), which is connected to an external 32KHz crystal.

    The 32KHz Oscillator (which generates CLK_32K_RTC) is the same thing as OSC1.  So the enable bit in OSC_REG enables/disables this oscillator.  The linux function you reference writes a 0x48 to the OSC_REG, which sets bit6 and clears bit5 (basically enabling the clock to the RTC) and sets bit3 (selects external clock source, from the 32KHz crystal)

    The TRM excerpt that you mention confuses the terms 'internal' and 'external' and also references rcosc_ctrl incorrectly.  Basically it is calling the CLK_32K_RTC as an internal source (since the oscillator connected to the crystal is actually in the RTC module), and the external source is the one coming from the Peripheral PLL (since that PLL is external to the RTC module).  This is enabled using OSC_REG, not rcosc_ctrl.

    The rcosc_ctrl register controls the 32KHz RC oscillator.  This is the oscillator which derives 32KHz from the master oscillator using an RC network, and produces CLK_RC32K which can be used by for timers or GPIO debouncing.  As mentioned before, this cannot be used for the RTC.

    We will get the information fixed in the DM and TRM in future releases.

    Regards,

    James

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Qmax
    Posted by Qmax
    on Mar 26 2012 03:03 AM
    Expert2260 points

    James, thanks so much for your really helpful clarifications. Just two minor questions about.

    In our custom board we have a 32 KHz crystal: if I set the OSC_REG to use the CLK_32KHz (from PLL), the crystal circuit will be started to oscillate in any case? This source is used also for purposes other than RTC (such as DTIMER1_1ms and CLKOUT2 signal), so I wonder if it will run in any case even when RTC is not using it as source.

    In TRM Section 8.1.1.6.12: "DMTIMER1 is implemented using the DMTimer_1ms module which is capable of generating an accurate 1ms tick using a 32.768 KHz clock. During low power modes, the Master Oscillator is disabled. CLK_32KHZ also would not be available in this scenario since it is sourced from the Master Osc based PER PLL. Hence, in low power modes DMTIMER1 in the WKUP domain can use the 32K RC oscillator for generating the OS (operating system) 1ms tick generation and timer based wakeup."

    Is it an error of the TRM, or is the 32K RC Oscillator really not available when the Master Oscillator is disabled (as derived from it)? Or am I missing something?

    Thanks one again. Best regards,

    Max

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use