mc9s12xeq512 mcu & flash initialiation

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

mc9s12xeq512 mcu & flash initialiation

ソリューションへジャンプ
1,433件の閲覧回数
Eric_t
Contributor III

Hi!

 

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"

//==============================================================================
//PFLASH_Init
//==============================================================================
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

0 件の賞賛
返信
1 解決策
1,253件の閲覧回数
lama
NXP TechSupport
NXP TechSupport

Hi,

yes, the value 0x0F because the flash clock is derived from oscillator clock. The only what is different is PLL setup for BUSCLK.

Ups, I have forgotten. the data sheet also presents:

pastedImage_1.png

Best regards,

Ladislav

元の投稿で解決策を見る

0 件の賞賛
返信
3 返答(返信)
1,254件の閲覧回数
lama
NXP TechSupport
NXP TechSupport

Hi,

yes, the value 0x0F because the flash clock is derived from oscillator clock. The only what is different is PLL setup for BUSCLK.

Ups, I have forgotten. the data sheet also presents:

pastedImage_1.png

Best regards,

Ladislav

0 件の賞賛
返信
1,252件の閲覧回数
lama
NXP TechSupport
NXP TechSupport

Hi,

please go to our pages and you can find there calculator at the page:

S12XE MCUs|16-Bit Microcontroller|NXP 

pastedImage_1.png

Or directly:

https://www.nxp.com/downloads/en/calculators/S12XESW.zip 

The answer is:

pastedImage_3.png pastedImage_4.png pastedImage_5.png

Best regards,

Ladislav

0 件の賞賛
返信
1,253件の閲覧回数
Eric_t
Contributor III

Hi lama,

Thank you for the quick answer.

As far as I understand, the FCLKDIV   of "PFlash_Ini" routine, is the "FDIV" of S12XEiPLL calculator, and in all cases it should be 0x0F.

Is that correct?

Thank you.

0 件の賞賛
返信