- UID
- 813321
- 性别
- 男
|
MC9S12FX512MLM 1M64J的芯片,晶振由一个4M和一个40M的构成
想延时10微秒,延时程序中的time10us该怎么计算?
void Delay(uint32 D)
{
uint32 i;
for(;D>0;D--)
for(i=time10us;i>0;i--);
}
锁相环配置如下:
PLLCTL_PLLON = 0; /* Disable the PLL */
SYNR_SYNDIV = 0x04; /* Set PLL synthesizer register to 4 */
REFDV_REFDIV = 0x00; /* Set PLL divider register to 0 */
/* Fvco = 2*OSCCLK*(SYNR+1)/(REFDV+1) = 8MHz* 5/1 = 40MHz */
/* -> VCOFRQ = 00b */
SYNR_VCOFRQ1 = 0;
SYNR_VCOFRQ0 = 0;
/* Fref = OSCCLK/(REFDV+1) = 4MHz/1 = 4MHz -> REFRQ= 01b */
REFDV_REFFRQ1 = 0;
REFDV_REFFRQ0 = 1;
PLLCTL_PLLON = 1; /* PLL enabled */ |
|