Re: MPC555 RTC Question
"trailrunner23" <[email protected]>
| Newsgroups | gmane.comp.hardware.motorola.microcontrollers |
|---|---|
| Message-ID | <[email protected]> |
Hi David, My RTC init routine: - unlocks RTCSC - sets RTCSC=0 - sets 4M=1, SIE=1, RTF=1, RTE=1 - sets the RTCIRQ I do not enable alarm interrupts by setting the ALE flag, so I don't think the value of RTCAL should have any bearing. I've tried clearing any "pending" interrupt by writing SEC=1 before enabling SIE=1, but the results were the same. --- In [email protected], David Wybo <realtimeconsultants@c...> wrote: > > The USIU manual states: > > The RTCAL is a 32-bit read/write register. When the value of the RTC is > equal to the > value programmed in the alarm register, a maskable interrupt is generated. > > What do you initialize it to? Also, do you clear SEC before enabling the > RTC? > > trailrunner23 wrote: > > >Wondering if anyone can explain something a little odd about the RTC. > >I've got the RTC and PIT initialized to generate interrupts once per > >second, and the DEC to generate interrupts once per millisecond. The > >first RTC interrupt occurs as soon as I enable interrupts, but the > >first PIT interrupt occurs very close to one second later. It doesn't > >help if I explicitly acknowledge a (possibly pending) RTC interrupt > >before enabling the interrupt. Anybody understand this? I want to > >think of the RTC as the number of seconds that have elapsed since > >boot, but it's always ahead by one second. > > > >Thanks, > > > >Joe > > > > > > > > > > > > > >----------------------------------------------------------- > >To learn more about Freescale Microcontrollers, please visit > >http://www.freescale.com/mcu > > > > > > > >Yahoo! Groups Links > > > > > > > > > > > > > > > > > > > > > > -- > David Wybo mailto:david.wybo@r... > RealTime Consultants, Inc. Phone: 248.345.6160 > www.realtimeconsultantsinc.com > ------------------------ Yahoo! Groups Sponsor --------------------~--> Fair play? Video games influencing politics. Click and talk back! http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/dN_tlB/TM --------------------------------------------------------------------~-> ----------------------------------------------------------- To learn more about Freescale Microcontrollers, please visit http://www.freescale.com/mcu Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/MPC500/ <*> To unsubscribe from this group, send an email to: [email protected] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/