AnsweredAssumed Answered

mc9s12xeq512 mcu & flash initialiation

Question asked by Eric_t d on Sep 20, 2017
Latest reply on Sep 20, 2017 by lama



I have download from NXP demo example project for programming the internal flash memory of XEP controllers.

The project that I download is "XEP100-FLASH-PFLASH-CW51"

The project works just fine, but the problem that I am facing, is that it is not clear what is the correct frequency that I should enter in PFLASH_Init routine.


"PFLASH_Init routine"

void PFLASH_Init(unsigned char fdiv)
while(FSTAT_CCIF == 0); //wait if command in progress
FCLKDIV = fdiv; //osc = 16MHz

the main calls it as follow


  PFLASH_Init(0x0F);//oscillator 16MHz



So, it gives 0x15 for 16MHz oscillation. 

I will use the PLL with High speed (internal bus clock 50MHz), Low speed (internal bus clock 14.75MHz), Slow speed (internal bus clock 4MHz).

The problem is that PFLASH_Init has no comments about the formula of oscillation and the operant of "PFLASH_Init routine"


Could someone from NXP tell me how can I calculate the operant of "PFLASH_Init routine" when the internal bus clockis 50, 14.75 and 4MHz?


Thank you

Original Attachment has been moved to: XEP100-FLASH-PFLASH-CW51.ZIP