George Anderson

MCF5208 - Can't Change PLL frequency in Codewarrior debugger config file

Discussion created by George Anderson on May 15, 2006
Latest reply on May 18, 2006 by George Anderson
I would like to change the PLL frequency in the debug config file but I get an error when it runs the config file. The error is "writemem error: writemem.b 0xfc090006 0x77 failed."
 
It looks like you cannot enter LIMP mode, which is needed according to the mcf5208 manual before changing the PLL divider.
 
I am able to do this in my ROM code, but need a way to do it in my RAM download code.
 
Any help appreciated.
 
- George
 
Part of my config file script:
;   /* The MFD bits may only be written when the device is in limp mode MISCCR[LIMP] = 1 */
;   mcf5208_ptr->RCP.MISCCR = MCF5208_CLOCK_MISCCR_LIMP | MCF5208_CLOCK_MISCCR_LIMPDIV(2);
writemem.w 0xFC0A0010 0x1002
delay 10
;   /* CPUDIV = 3, BUSDIV = 6 */
;   mcf5208_ptr->CLK.PODR = 0x36;
;writemem.b 0xFC090000 0x36
;   /* Multiply 16Mhz reference crystal by 125 to acheive system clock of 166.67Mhz */
;   mcf5208_ptr->CLK.PFDR = 0x77;        // 158.67MHz - to sync backplane comms. at higher rate.
writemem.b 0xFC090006 0x77
     
;   /* Exit limp mode */
;   // Per errata, after exiting LIMP mode, 0x40000000 must be written to addr. 0xFC0A8080.
;   // This must be done prior to initiallizing SDRAM. (Otherwise it wont work.)
;   mcf5208_ptr->RCP.MISCCR &= ~MCF5208_CLOCK_MISCCR_LIMP;
writemem.w 0xFC0A0010 0x0002
delay 10
writemem.l 0xFC0A8080 0x40000000;
 

Outcomes