> Your advice?
Use an external RTC. I2C or SPI. Something like a Maxim DS1308 or any of the other 82 available parts from them.
That was my advice to this user, which you may have already read:
Re: MCF52259 RTC problems
> The tower connects Vstby to Vdd
It is always risky to use a chip in a different way to the Development Board. See if you can find any Development Boards for this chip series that do have a battery on RTC.
Otherwise, lets check the Manuals before I make a guess as to what your problem might be. I've never used these chips so all my advice is from the manuals. Anyone else who does use these chips is always welcome to contribute...
MCF52259 Data Sheet Rev 3:
"RTC module with 32 kHz crystal".
"Vstby keeps the RTC running..."
"RAM standby supply current"
"SRAM ... with standby power supply support for the first 16 Kbytes"
No mention of the RTC standby current. You'd think that would be really important. The RTC crystal oscillator has to have a power consumption if it is enabled, but that's not listed either. It looks like VSTBY is only meant (or tested and documented) to keep 16k or RAM alive.
The documented SRAM consumption is 20uA. The RTC and XTAL current are undocumented, but may double that or more. If we assume 50uA then that would flatten a 90mAH CR2016 in 75 DAYS and a 250mAH CR2032 in 29 WEEKS. At 20uA it is only 74 weeks for a CR2032.
MCF52259DE Errata: Nothing interesting.
MCF52259RM Reference Manual 4 and Addendum:
7.3 Modes of Operation
7.3.2 RTC Mode
A dedicated RTC oscillator can be selected to run the RTC circuitry.
In normal operation, this oscillator is powered by the VDDPLL and VSSPLL
pins. When the part is shut down, this oscillator is powered by the
VSTBY pin.
> Our test board is using the 8Meg internal oscillator.
> We are using the 8meg system clock to clock the RTC clock
"There's your Problem".
The internal oscillator won't be powered by VSTBY. So the RTC is running "unclocked" with the power off, so it is impossible for it to keep time. If you just want to store the time when the power went off, then just save that to SRAM.
That may explain why it won't come out of reset either. It is possible that the RTC registers can't even be written if it isn't clocked, and once you shut its clock off (by powering it off) there may be no way back. You may not even be able to write the bit in RTTCR to switch it to a working clock.
You probably need an external crystal on the RTC_EXTAL pins. If you can't afford that (and don't seem to need the accuracy) you might be able to use a resonator or an R/C oscillator.
Why are you using the internal oscillator to run the RTC? That can't keep "real time". It has to be trimmed against an external reference to get it close to 8MHz, and will probably then drift with temperature and voltage. The Data Sheet gives the frequency as being between 7.84 and 8.16 MHz, or 2%. That's 28 minutes PER DAY. It doesn't give any details about how to trim this clock apart from "7.7.1.3 Relaxation Oscillator Control Register (ROCR)". It has 10 bits trimming the frequency between 0.8% and 40%, but I can't see how 0.8% is 1/1024 of 40%. If the best you can trim it is 0.8%, then that's still 12 MINUTES per day!
Good luck finding what "flash information row (bits [9:0])" are as well (where the trim is stored). There have been a few forum posts on this subject - search for "ROCR".
There are no details on temperature or voltage sensitivity of the oscillator. There don't seem to be any App Notes on using the internal oscillator either.
Tom