> Now, we seem incapable to maintain the data and time stored after a reset or power down.
Reading the RTC section in the Reference Manual, it states "Ability to wake the processor from low-power modes (wait, doze, and stop) via the RTC interrupts", but says nothing about working with power off. Nothing in the Data Sheet saying it can do that either. So I'd guess it can't.
If you want a "battery backed real time clock" you'll have to add a separate chip and crystal on an SPI bus to do that.
Checking the manuals...
The RTC Hours, Minutes and Seconds are unaffected by Reset, but the RTC_GOCU and RTC_GOCL registers (which control the clock divider) ARE documented to reset to zero on Reset, and that stops the clock dead.
So it looks like the RTC "is enabled at reset", but with a stopped clock. That doesn't look to be particularly useful.
The clock will run as long as you don't assert RESET, which means as long as the CPU isn't powered off. As stated, it works if the CPU is in a Low Power Mode. Only.
Searching this forum for "RTC_SECONDS" shows up a few things (mainly for MCF52xxx) and one has a link to here:
http://www.utasker.com/forum/index.php?topic=35.0
Which states:
On the one hand the RTC (Real Time Clock) in the M5223X is a bit disappointing - normally one thinks of a battery backed up device with 32kHz crystal, time of day, week day, day, month, year and automatic months and leap year adjustments - but on the other hand it could well come in handy in certain applications.
The RTC is clocked by a 1Hz clock which is derived from the local crystal (25MHz typically) and is only operational when the CPU is powered. It is not designed for keeping the time but rather counting elapsed time
The Reference Manual says nothing about the RTC_VDD pin. The Data Sheet states:
To further enhance noise isolation, an external filter is strongly recommended for the analog VDD pins (VDD_A_PLL, VDD_RTC).
So the "RTC_VDD" pin is there so the oscillator can be given a "clean power supply" and not so it can be run from a battery.
There seems to be a lot of contradictions in the RTC chapter in the Reference Manual too.
RTC_HOURSMIN and RTC_SECONDS are listed in Table 28-2 as having a "Reset Value" of "Undefined", but the RTC_DAYS register is listed as being reset to ZERO.
RTC_HOURSMIN and RTC_SECONDS register diagrams are "---" on Reset and RTC_DAYS" is "000..." on Reset, matching Table 28-2.
The descriptions for RTC_HOURSMIN and RTC_SECONDS both state "This register cannot be reset because the real-time clock is always enabled at reset.", but SO DOES the description for RTC_DAYS.
If RTC_DAYS gets reset then it is useless as an RTC, but there are two descriptions stating it gets reset to zero and only one stating it doesn't.
That isn't the only contradiction. The RTC_CR description. It states:
EN: RTC enable. Enables/disables the real-time clock module. SWR has no effect on this bit
SWR: Software reset. Resets the module to its default state. The EN bit is also reset to its default value of one.
The MCF52235 has the same RTC module, and the Reference Manual says of SWR "However, a software reset has no effect on the EN bit." which makes more sense. This chapter doesn't have an equivalent to Table 28-2 or the "cannot be reset" statements there to contradict each other or the diagrams, so it might be better to read the MCF52235 manual to understand the MCF54455's RTC than its own manual.
Tom