Thanks for your help Mark!
Unfortunately it is still not running... I'm not sure what's going on or what I am doing wrong. This is my current startup code... (Coldfire Lite based)
void
mcf52259_init(void)
{
MCF_GPIO_PDDPAR = 0x0F; //enable pst[0..3]
/*
* Set Port UA to initialize URXD0/UTXD0
*/
MCF_GPIO_PUAPAR = 0
| MCF_GPIO_PUAPAR_URXD0_URXD0
| MCF_GPIO_PUAPAR_UTXD0_UTXD0;
MCF_GPIO_PUBPAR = 0
| MCF_GPIO_PUBPAR_URXD1_URXD1
| MCF_GPIO_PUBPAR_UTXD1_UTXD1;
mcf52259_wtm_init();
mcf52259_pll_init();
/* Set real time clock freq */
MCF_CLOCK_RTCCR = 0; // select RTC clock source
MCF_RTC_RTCGOCU = (unsigned short)((48000000 / 6) >> 16);
MCF_RTC_RTCGOCL = (unsigned short)(48000000 / 6);
MCF_RTC_RTCCTL = MCF_RTC_RTCCTL_EN; // enable RTC
mcf52259_scm_init();
mcf52259_ccm_init();
mcf52259_gpio_init();
#ifdef M52259EVB
mcf52259_mb_init();
#endif
uart_init(0);
uart_init(1);
mcf52259_powerup_config();
mcf52259_ePHY_init();
// mcf52259_wtm_config(); //FSL added this function...reference M52233DEMO code
}
I tried changing the order of the instructions but it didn't make any difference.
I can write the time in the RTC and read it back correctly, but it is never updated.
I only read the hours/minutes register of the RTC by the way, and set the seconds register to 0 when the hours/minutes are written into the register.