www.pudn.com > 8051_pppsrc.zip > pll.c, change:2001-02-09,size:1140b
/*///////////////////////////////////////////////////////////////////////////// File Name : Pll.c Author : Rene Trenado Location : Motorola Applications Lab, Baja California Date Created : September 2000 Current Revision : 0.0 Notes : This file contains the code of the InitPll function //////////////////////////////////////////////////////////////////////////////*/ #include "pll.h" /*********************************************************************** Function : InitPll Parameters : None Date : September 2000 Desc : Initializes the PLL to operate at 4.91520 MHz ***********************************************************************/ #asm xdef _InitPLL _InitPLL: BCLR 5,0x36 ;turn off PLL so it can be initialized MOV #0x00,0x38 ;Set multiplier for 4.9152MHz MOV #0x96,0x39 ;see manual for calculations MOV #0x80,0x3A ;Set range select BSET 7,0x37 ;Allow automatic acquisition & tracking BSET 5,0x36 ;turn PLL back on HERE: BRCLR 6,0x37,HERE ;Wait for PLL to lock BSET 4,0x36 ;Select PLL as Source #endasm