This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM335x RTC clock initialization

Other Parts Discussed in Thread: AM3352

Hello,

we use RTC peripheral of the AM3352 processor.

/* Performing the clock configuration for RTC. */
moduleClkConfig();
 
/* Disabling write protection for RTC registers */
HWREG(SOC_RTC_0_REGS + RTC_KICK0) = RTC_KICK0R_KEY;
HWREG(SOC_RTC_0_REGS + RTC_KICK1) = RTC_KICK1R_KEY;
 
/* Selecting Internal Clock source for RTC by */
/* clearing the 32KCLK_SEL bit in Oscillator register. */
HWREG(SOC_RTC_0_REGS + RTC_OSC) &= ~(RTC_OSC_32KCLK_SEL);
 
/* Enabling RTC to receive the Clock inputs. */
HWREG(SOC_RTC_0_REGS + RTC_OSC) &= ~(RTC_OSC_32KCLK_EN);
HWREG(SOC_RTC_0_REGS + RTC_OSC) |= (RTC_32KCLK_ENABLE & RTC_OSC_32KCLK_EN);
 
/* Perform dummy reads until clock is available */
for(i=0; i<1000; i++)
{
   status = HWREG(SOC_RTC_0_REGS + RTC_STATUS);
}
 
/* Enable the RTC module. */
HWREG(SOC_RTC_0_REGS + RTC_CTRL) &= ~(RTC_CTRL_RTCDISABLE);

We would like to user the internal clock source derived from PLL. In the initialization sequence we inserted some dummy reads. If we not insert this, the first set of the time and date information is not excepted well.So is there any timing requirements of clock before the RTC module can be enabled?

In the Sitara Processors Forum I received the answer that the correct steps are given in section 20.3.4 of the AM335X TRM Rev. K. But if I used the described sequence, the RTC does not running. I also do not understand the described sequence in chapter 20.3.4, because it is different compared with the Starterware example code.