Electronic Components Datasheet Search
  English  ▼

X  

AN3995 Datasheet(PDF) 35 Page - STMicroelectronics

Part # AN3995
Description  Getting started tutorial
PDF  49 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  STMICROELECTRONICS [STMicroelectronics]
Direct Link  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

AN3995 Datasheet(HTML) 35 Page - STMicroelectronics

Back Button AN3995 Datasheet HTML 31Page - STMicroelectronics AN3995 Datasheet HTML 32Page - STMicroelectronics AN3995 Datasheet HTML 33Page - STMicroelectronics AN3995 Datasheet HTML 34Page - STMicroelectronics AN3995 Datasheet HTML 35Page - STMicroelectronics AN3995 Datasheet HTML 36Page - STMicroelectronics AN3995 Datasheet HTML 37Page - STMicroelectronics AN3995 Datasheet HTML 38Page - STMicroelectronics AN3995 Datasheet HTML 39Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 35 / 49 page
background image
AN3995
Application code example
Doc ID 022384 Rev 2
35/49
SWT.SR.R = 0xC520; /* Clear Soft lock bit in CR by writing */
SWT.SR.R = 0xD928; /* 0xC520 followed by 0xD928 to WSC field */
SWT.CR.B.WEN = 0x0; /* Clear Watchdog Enable Bit */
}
/******** void MODE_Init(void) *********/
//! This function initialize the modes
/*!
\brief Enable system clock for all peripherals assuming 120MHz system cloc
\return No return value.
\retval void
\note None
*/
void MODE_Init(void)
{
ME.MER.R = 0x000025FF; /* Enable all modes */
ME.RUNPC[0].R = 0x000000FE; /* Enable all peripherals in all modes */
/* Enable system clock for all peripherals assuming 120MHz system clock */
CGM.SC_DC[0].R = 0x83; /* Max 32MHz. Closest is 30MHz, Div+1=3 */
CGM.SC_DC[1].R = 0x81; /* Max 64MHz. Closest is 60MHz, Div+1=2 */
CGM.SC_DC[2].R = 0x81; /* Max 64MHz. Closest is 60MHz, Div+1=2 */
/* Re-enter DRUN mode to update the clock configuration */
ME.MCTL.R = 0x30005AF0; /* DRUN Mode & Key */
ME.MCTL.R = 0x3000A50F; /* DRUN Mode & Key */
while (ME.GS.B.S_MTRANS == 1); /* Wait for mode transition complete */
}
/******** void PLL_Init(void) *********/
//! This function configure the PLL
/*!
\brief This function configure the PLL
\return No return value.
\retval void
\note
Switch on osc, change mode and wait for osc ON
Configure and enable PLL, change mode and wait for PLL to lock
Set clock source as PLL, change mode and check clock is PLL
*/
void PLL_Init(void){
ME.DRUN.B.FXOSC0ON = 1;/* Switch on external oscillator in DRUN mode */
/* Re-Enter DRUN mode (mode=0x3) to activate change */
ME.MCTL.R = 0x30005AF0; /* Mode & Key */
ME.MCTL.R = 0x3000A50F; /* Mode & Key inverted */
while(ME.GS.B.S_MTRANS == 1); /* Wait for mode transition complete */
while(ME.GS.B.S_CURRENTMODE != 3);/* Error trap - if current mode is not DRUN (eg
in safe mode), then loop */
while(ME.GS.B.S_FXOSC != 1);/* Wait for external OSC to stabilize */
/* Select External OSC as the FMPLL Reference Clock Source */
CGM.AC0_SC.B.SELCTL = 0x0;
/* Configure PLL for 120MHz with 40MHz xtal:
PLL frequency = (40 * NDIV) / (IDF *
ODF) */
/* NOTE: VCO (PLL * ODF) must be between 256 and 512MHz */
CGM.FMPLL_CR.B.IDF = 0x4; /* Divide by 5 */
CGM.FMPLL_CR.B.ODF = 0x1; /* Divide by 4 */
CGM.FMPLL_CR.B.NDIV = 60; /* Divide by 60 */
/* Enable PLL in DRUN mode. */



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49


Datasheet Download

Go To PDF Page


Link URL



Does ALLDATASHEET help your business so far?  [ DONATE ] 

About Alldatasheet   |   Advertisement   |   Contact us   |   Privacy Policy   |   Link to Datasheet    |   Link Exchange   |   Manufacturer List
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com