Hello Radek,
i work with Kwangho, Park in same company.
i attach the schematic and the clock settings which is generated by the Processor Expert.
your recommend is to modify the auto generated file by manually.
is it right ?
void _EntryPoint(void)
{
/*** !!! Here you can place your own code using property "User code before PE initialization" on the build options tab of the CPU compoennt. !!! ***/
/* ### MC9S12XEG128_80 "Cpu" init code ... */
/* PE initialization code after reset */
/* MMCCTL1: TGMRAMON=0,??=0,EEEIFRON=0,PGMIFRON=0,RAMHM=0,EROMON=0,ROMHM=0,ROMON=1 */
setReg8(MMCCTL1, 0x01U);
/* DIRECT: DP15=0,DP14=0,DP13=0,DP12=0,DP11=0,DP10=0,DP9=0,DP8=0 */
setReg8(DIRECT, 0x00U);
/* IVBR: IVB_ADDR=0xEF */
setReg8(IVBR, 0xEFU);
/* ECLKCTL: NECLK=0,NCLKX2=1,DIV16=0,EDIV4=0,EDIV3=0,EDIV2=0,EDIV1=0,EDIV0=0 */
setReg8(ECLKCTL, 0x40U);
/* System clock initialization */
/* CLKSEL: PLLSEL=0,PSTP=0,XCLKS=0,??=0,PLLWAI=0,??=0,RTIWAI=0,COPWAI=0 */
setReg8(CLKSEL, 0x00U); /* Select clock source from XTAL and set bits in CLKSEL reg. */
/* PLLCTL: CME=1,PLLON=0,FM1=0,FM0=0,FSTWKP=0,PRE=0,PCE=0,SCME=1 */
setReg8(PLLCTL, 0x81U); /* Disable the PLL */
/* SYNR: VCOFRQ1=0,VCOFRQ0=0,SYNDIV5=0,SYNDIV4=0,SYNDIV3=0,SYNDIV2=0,SYNDIV1=1,SYNDIV0=0 */
setReg8(SYNR, 0x02U); /* Set the multiplier register */
/* REFDV: REFFRQ1=1,REFFRQ0=0,REFDIV5=0,REFDIV4=0,REFDIV3=0,REFDIV2=0,REFDIV1=0,REFDIV0=1 */
setReg8(REFDV, 0x81U); /* Set the divider register */
/* POSTDIV: ??=0,??=0,??=0,POSTDIV4=0,POSTDIV3=0,POSTDIV2=0,POSTDIV1=0,POSTDIV0=0 */
setReg8(POSTDIV, 0x00U); /* Set the post divider register */
/* PLLCTL: CME=1,PLLON=1,FM1=0,FM0=0,FSTWKP=0,PRE=0,PCE=0,SCME=1 */
setReg8(PLLCTL, 0xC1U);
while(CRGFLG_LOCK == 0U) { /* Wait until the PLL is within the desired tolerance of the target frequency */
}
/* CLKSEL: PLLSEL=1 */
setReg8Bits(CLKSEL, 0x80U); /* Select clock source from PLL */
/* VREGHTCL: ??=0,??=0,VSEL=0,VAE=1,HTEN=0,HTDS=0,HTIE=0,HTIF=0 */
setReg8(VREGHTCL, 0x10U);
/*** End of PE initialization code after reset ***/
/*** !!! Here you can place your own code using property "User code after PE initialization" on the build options tab of the CPU component. !!! ***/
/*lint -save -e950 Disable MISRA rule (1.1) checking. */
__asm("jmp _Startup"); /* Jump to C startup code */
/*lint -restore Enable MISRA rule (1.1) checking. */
}
