And one more note... Usually in the Freescale header files, they give you macros to *encode* the register values (which you used correctly), like:
/* Bit definitions and macros for MCF_RTC_ALRM_HM */
#define MCF_RTC_ALRM_HM_MINUTES(x) (((x)&0x3F)<<0)
#define MCF_RTC_ALRM_HM_HOURS(x) (((x)&0x1F)<<0x8)
However, they often do not give you the converse macros to *decode* the register values (which you want in this instance), so you have to write them by hand or code them explicitly.
In general, the "encode" and "decode" macros will swap the order of the mask and shift, and will change the direction of the shift, like:
#define DECODE_MCF_RTC_ALRM_HM_MINUTES(x) (((x)>>0)&0x3F)
#define DECODE_MCF_RTC_ALRM_HM_HOURS(x) (((x)>>8)&0x1F)
Message Edited by Rich T on
2008-07-16 12:16 PM