Hello all:
I'm working with a MCF54455EVB, MQX3.7 and CW 10.1 for MCUs.
Right now we are testing our own board that is mostly equal to the former EVB but has a MCF54452 MCU. We have created a hardware circuit that keeps the voltage to 1.6v in VDD_RTC while the board is off. Now, we seem incapable to maintain the data and time stored after a reset or power down. We don't really know if the MCU is designed to store the time while that specific pin has voltage. Anybody can confirm this?
By the way, we have tested the RTC VDD circuit.
Thanks.
已解决! 转到解答。
> 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
I have found some coments on this forum regarding the Coldfire V2 and V3 versions, but I haven't found any regarding V4.
I don't know if It got fixed, maybe I shoud made a service request.
Thanks.
> 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
Thank you very much TomE, your post was enlightening.
We must assume that is impossible to keep the RTC data in a power down and start searching other solutions. Maybe the SPI one you commented before.
Again, thanks.
Hello again,
I suppose that I can safely remove (physically) the RTC from the board without affecting the MQX functionality or its libraries.
I mean, if I remove the RTC oscillator from my board, stop supplying power to VDD_RTC and define in user_config.h BSPCFG_ENABLE_RTCDEV to 0 . Will MQX and its libraries (RTCS, MFS and Shell) work as usual?
Thanks,
If it's the same as the M52259 (which looks very similar to the MF52235) then you need the external crystal oscillator circuit for the RTC and to have set the registers correctly to run the RTC from the crystal rather than the system clock.
Also be wary of any support code/drivers which may be initialising registers to default values.