Correct RTCDR value in MCF52235

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Correct RTCDR value in MCF52235

2,489件の閲覧回数
flashtoo
Contributor I

The MCF52235 documentation for the Clock module list the RTCDR value as:

The Real Time Clock Divide Register is a 32 bit read/write register that divides down the oscillator clock
to a 1 Hz clock for the Real Time Clock module. If this register is programmed with zero then the clock to
the Real Time Clock module is disabled, otherwise the oscillator clock is divided by one more than the
value written to the register field (between 2 and 4,294,967,296).

Since 1 is added to the register, it seems that the correct value for a 25Mhz oscilator would be 24999999. Yet, all the examples I have seen use a even number of 25000000.  I know it is only a small error but am I correct?

FlashToo

ラベル(1)
0 件の賞賛
返信
2 返答(返信)

1,211件の閲覧回数
rocco
Senior Contributor II
Hi, FlashToo:

I believe you are correct, but the 25,000,000 value is much more obvious to someone reading the code. And you are also correct in that the difference is very small.

To add a little perspective, a good, temperature-compensated oscillator may give you frequency stability around two-parts per million. The value of 25,000,000 versus 24,999,999 is .04 parts per million, or fifty-times smaller.

So if it was an inadvertent mistake, you can understand why it was never discovered before.
0 件の賞賛
返信

1,211件の閲覧回数
flashtoo
Contributor I
Thanks,
Just want to make sure I understood this... And to add perspective, even if the error in the crystal was 0 the shift in time caused by the RTCDR error would only be about 1.26 seconds per year.
 
FlashToo
0 件の賞賛
返信