⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 s12_crg.c

📁 source code for a sample alarm control panel system using Freescale MC9S12DP256 . The project was im
💻 C
字号:
//=============================================================================
// File: S12_CRG.C - V1.00
// Rem.: The ACPRD Project Page on the Web -> http://hc12web.de/acprd
//=============================================================================

//-- Includes -----------------------------------------------------------------

#include "hcs12dp256.h"
#include "s12_crg.h"

//-- Code ---------------------------------------------------------------------

void initPLL(void) {

	CLKSEL &= ~BM_PLLSEL;				// make sure PLL is *not* in use
	PLLCTL |= BM_PLLON+BM_AUTO;			// enable PLL module, Auto Mode
	REFDV = S12_REFDV;					// set up Reference Divider
	SYNR = S12_SYNR;					// set up Synthesizer Multiplier
	// the following dummy write has no effect except consuming some cycles,
	// this is a workaround for erratum MUCTS00174 (mask set 0K36N only)
	// CRGFLG = 0;
	while((CRGFLG & BM_LOCK) == 0) ;	// wait until PLL is locked
	CLKSEL |= BM_PLLSEL;				// switch over to PLL clock
	}

//=============================================================================

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -