Hi,
I am trying to run an MPC5644A @ 120MHz from a 8MHz xtal (the one on the demoboard.
I am using this code:
void ClockSetSysClk_120MHz(void)
{
ECSM.MUDCR.R = 0x40000000; // 1 SRAM waitstate for fsys above 98MHz
FMPLL.ESYNCR2.R = 0x00000001; // Clock / 4
FMPLL.ESYNCR1.R = 0xF000003C; // Pll X 60
while (FMPLL.SYNSR.B.LOCK != 1) {}; // Wait for FMPLL to LOCK
}
This is working great running from RAM but not from FLASH. The system goes in exception (I think I lose the FLASH controller somehow...) Someone can please help me to understand what I miss?
Thank you
Pay attention to following example code, function FMPLL_init:
https://community.nxp.com/docs/DOC-101455
Code selects used board at the beginning of main function by following macros:
#define XPC564AKIT176S 0
#define XPC564AKIT208S 1
#define XPC564AKIT324S 2
/* Choose one of 3 options above according to your configuration */
#define USED_BOARD XPC564AKIT324S
Possible issues are:
- XPC564AKIT176S and XPC564AKIT208S use 8MHz crystal
- XPC564AKIT324S uses 40MHz crystal
- 1 SRAM waitstate for fsys above 98MHz
- CLKOUT frequency must be 66MHz at most