Hi Mark,
We discovered a timing issue with when the RTC is initialize during power-up.
But first, I wanted to ask about the two writes to MCF_CLOCK_RTCCR. The reference manual shows an example where the difference between the two writes is that the first one does not include the RTCSEL_OSC bit. I was wondering why your init code has identical values for both writes to MCF_CLOCK_RTCCR. If there is a reason I would also like to know why then the register needs to be written to twice.
Now, on to the timing problem we have. Our board design uses a super-cap as the power source for Vstby. If the super-cap discharges below 1.8 volts, we lose the RTC and battery-backed SRAM as expected. Unfortunately, it take significant time to recharge the super-cap when power is applied to the board (up to 750mSecs). While the voltage is still below the 1.8v threshold, the init code for the RTC does nothing and that, unfortunately, is run well before the RTC is viable. So I figured I would create a task that is delayed a couple seconds after power-up which would just have those few instructions to initialize the RTC. Do you see any problem with that? Do you see a better solution for our situation?
Thanks,
Dave G.