<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://mars.merhot.dk/w/index.php?action=history&amp;feed=atom&amp;title=STM32F107VC%2FRCC%2FClock_Modes_example</id>
		<title>STM32F107VC/RCC/Clock Modes example - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://mars.merhot.dk/w/index.php?action=history&amp;feed=atom&amp;title=STM32F107VC%2FRCC%2FClock_Modes_example"/>
		<link rel="alternate" type="text/html" href="http://mars.merhot.dk/w/index.php?title=STM32F107VC/RCC/Clock_Modes_example&amp;action=history"/>
		<updated>2026-04-24T00:09:13Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.29.0</generator>

	<entry>
		<id>http://mars.merhot.dk/w/index.php?title=STM32F107VC/RCC/Clock_Modes_example&amp;diff=21325&amp;oldid=prev</id>
		<title>Heth: moved STM32F107VC/RSS/Clock Modes example to STM32F107VC/RCC/Clock Modes example</title>
		<link rel="alternate" type="text/html" href="http://mars.merhot.dk/w/index.php?title=STM32F107VC/RCC/Clock_Modes_example&amp;diff=21325&amp;oldid=prev"/>
				<updated>2012-01-27T13:16:09Z</updated>
		
		<summary type="html">&lt;p&gt;moved &lt;a href=&quot;/w/index.php/STM32F107VC/RSS/Clock_Modes_example&quot; class=&quot;mw-redirect&quot; title=&quot;STM32F107VC/RSS/Clock Modes example&quot;&gt;STM32F107VC/RSS/Clock Modes example&lt;/a&gt; to &lt;a href=&quot;/w/index.php/STM32F107VC/RCC/Clock_Modes_example&quot; title=&quot;STM32F107VC/RCC/Clock Modes example&quot;&gt;STM32F107VC/RCC/Clock Modes example&lt;/a&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='1' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='1' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 13:16, 27 January 2012&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan='2' style='text-align: center;' lang='en'&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Heth</name></author>	</entry>

	<entry>
		<id>http://mars.merhot.dk/w/index.php?title=STM32F107VC/RCC/Clock_Modes_example&amp;diff=19767&amp;oldid=prev</id>
		<title>Heth: /* Configuring Clock mode 5 */</title>
		<link rel="alternate" type="text/html" href="http://mars.merhot.dk/w/index.php?title=STM32F107VC/RCC/Clock_Modes_example&amp;diff=19767&amp;oldid=prev"/>
				<updated>2011-10-04T12:25:43Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Configuring Clock mode 5&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 12:25, 4 October 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l109&quot; &gt;Line 109:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 109:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; 		&amp;#160; &amp;#160; LATECY[2:0] = 001 - One wait state.&amp;#160; (24 MHz &amp;lt; SYSCLK &amp;lt;= 48 Mhz)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; 		&amp;#160; &amp;#160; LATECY[2:0] = 001 - One wait state.&amp;#160; (24 MHz &amp;lt; SYSCLK &amp;lt;= 48 Mhz)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; 		&amp;#160; &amp;#160; LATECY[2:0] = 010 - Two wait state.&amp;#160; (48 MHz &amp;lt; SYSCLK &amp;lt;= 72 Mhz) &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; 		&amp;#160; &amp;#160; LATECY[2:0] = 010 - Two wait state.&amp;#160; (48 MHz &amp;lt; SYSCLK &amp;lt;= 72 Mhz) &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160;  Step 20: Select PLLCLK in SW[1:0] as Clock Source&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160;  Step 20&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;: RCC_CFGR bits PPRE1[2:0] = 100 -APB1 Prescaler divide by 2 = 36 MHz&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160;  Step 21: RCC_CFGR bits ADCPRE[1:0] = 10 ADC-prescaler divide by 6 72 MHz / 6 = 12 MHz&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160;  Step 22&lt;/ins&gt;: Select PLLCLK in SW[1:0] as Clock Source&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; RCC_CR SW[1:0] = 10&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; RCC_CR SW[1:0] = 10&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160;  Step &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;21&lt;/del&gt;: Disabling HSI Clock- RCC_CR bit&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160;  Step &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;23&lt;/ins&gt;: Disabling HSI Clock- RCC_CR bit&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; 		&amp;#160;  HSION = 0 : oscillator off&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; 		&amp;#160;  HSION = 0 : oscillator off&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;  RCC_CFGR bits SW[1:0] = 00 : HSI selected&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;  RCC_CFGR bits SW[1:0] = 00 : HSI selected&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l181&quot; &gt;Line 181:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 183:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	FLASH-&amp;gt;ACR &amp;amp;= 0xfffffffa;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	FLASH-&amp;gt;ACR &amp;amp;= 0xfffffffa;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	for(i=0;i &amp;lt; 100000;i++);&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	//Step 20: RCC_CFGR bits PPRE1[2:0] = 100 -APB1 Prescaler divide by 2 = 36 MHz&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	rcc_cfgr( 0x00000300, 0 ); //Set PPRE1[1:0] = 0&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	rcc_cfgr( 0x00000400, 1 ); //Set PPRE1[2] = 1&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	//Step 21: RCC_CFGR bits PPRE1[2:0] = 100 -APB1 Prescaler divide by 2 = 36 MHz&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	rcc_cfgr( 1 &amp;lt;&amp;lt; 14, 0 ); //Set ADCPRE[0] = 0&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	rcc_cfgr( 1 &amp;lt;&amp;lt; 15, 1 ); //Set ADCPRE[1] = 1&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;	for(i=0;i &amp;lt; 100000;i++);&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	//Step &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;22&lt;/ins&gt;: Select PLLCLK in SW[1:0] as Clock Source&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	//Step &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;20&lt;/del&gt;: Select PLLCLK in SW[1:0] as Clock Source&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	RCC-&amp;gt;CFGR |= RCC_CFGR_PLLON;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	RCC-&amp;gt;CFGR |= RCC_CFGR_PLLON;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160;  //Step &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;21 &lt;/del&gt;- Disable HSI&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160;  //Step &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;23 &lt;/ins&gt;- Disable HSI&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	RCC-&amp;gt;CR &amp;amp;= ~RCC_CR_HSION;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	RCC-&amp;gt;CR &amp;amp;= ~RCC_CR_HSION;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Heth</name></author>	</entry>

	<entry>
		<id>http://mars.merhot.dk/w/index.php?title=STM32F107VC/RCC/Clock_Modes_example&amp;diff=19479&amp;oldid=prev</id>
		<title>Heth: Created page with &quot;=Clock mode 1= '''Clock Mode 1:'''&lt;br/&gt;HSI Oscillator as SYSCLK (Default) ==Configuring clock mode 1== If the controller is using t...&quot;</title>
		<link rel="alternate" type="text/html" href="http://mars.merhot.dk/w/index.php?title=STM32F107VC/RCC/Clock_Modes_example&amp;diff=19479&amp;oldid=prev"/>
				<updated>2011-09-11T12:09:39Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;=Clock mode 1= &lt;a href=&quot;/w/index.php/File:ARM_clock_tree_hsi_default.png&quot; title=&quot;File:ARM clock tree hsi default.png&quot;&gt;600px|&amp;#039;&amp;#039;&amp;#039;Clock Mode 1:&amp;#039;&amp;#039;&amp;#039;&amp;lt;br/&amp;gt;HSI Oscillator as SYSCLK (Default)&lt;/a&gt; ==Configuring clock mode 1== If the controller is using t...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=Clock mode 1=&lt;br /&gt;
[[Image:ARM clock tree hsi default.png|600px|'''Clock Mode 1:'''&amp;lt;br/&amp;gt;HSI Oscillator as SYSCLK (Default)]]&lt;br /&gt;
==Configuring clock mode 1==&lt;br /&gt;
If the controller is using the HSE clock, and you want to shift to HSI direct clocking.&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
/* sub rcc_clockmode1()&lt;br /&gt;
   abstract: Select default as System Clock (HSI 8 Mhz)&lt;br /&gt;
&lt;br /&gt;
   input...:  -&lt;br /&gt;
&lt;br /&gt;
   output..: -&lt;br /&gt;
   limits..: No errorcheck performed&lt;br /&gt;
   *********************************************&lt;br /&gt;
   See: http://mars.tekkom.dk/mediawiki/index.php/STM32F107VC/RSS/Clock_Paths&lt;br /&gt;
        http://mars.tekkom.dk/mediawiki/index.php/STM32F107VC/RSS&lt;br /&gt;
   *********************************************&lt;br /&gt;
   Step 1: Enabling the HSI clock - RCC_CR bit (If not enabled)&lt;br /&gt;
  		   HSION = 1 HSI : oscillator on&lt;br /&gt;
   Step 2: Waiting until HSI clock is ready an can be used as Clock Source &lt;br /&gt;
           RCC_CR bit HSIRDY = 0 : Oscillator Not Ready&lt;br /&gt;
		   RCC_CR bit HSIRDY = 1 : Oscillator Ready&lt;br /&gt;
   Step 3: Select HSI in SW[1:0] as Clock Source&lt;br /&gt;
           RCC_CFGR bits SW[1:0] = 00 : HSI selected&lt;br /&gt;
   Step 4: Select AHB prescaler=1 &lt;br /&gt;
           RCC_CFGR bits HPRE[3:0] = 0000 &lt;br /&gt;
   Step 5: Setting FLASH wait states FLASH_ACR bits LATENCY[2:0] to 0 Wáit States(section 3.3) &lt;br /&gt;
  		   LATECY[2:0] = 000 - Zero wait state. ( 0 Hz  &amp;lt; SYSCLK &amp;lt;= 24 Mhz)&lt;br /&gt;
  		   LATECY[2:0] = 001 - One wait state.  (24 MHz &amp;lt; SYSCLK &amp;lt;= 48 Mhz)&lt;br /&gt;
  		   LATECY[2:0] = 010 - Two wait state.  (48 MHz &amp;lt; SYSCLK &amp;lt;= 72 Mhz)&lt;br /&gt;
   Step 6: Disabling HSE Clock- RCC_CR bit&lt;br /&gt;
  		   HSEON = 0 : oscillator off&lt;br /&gt;
*/&lt;br /&gt;
void rcc_clockmode1( void ) {&lt;br /&gt;
  	// Step 1 - Enabling the HSI clock - If not enabled and ready&lt;br /&gt;
	if ( (RCC-&amp;gt;CR &amp;amp; RCC_CR_HSIRDY) == 0) {&lt;br /&gt;
 	  RCC-&amp;gt;CR |= RCC_CR_HSION;  // HSION=1&lt;br /&gt;
	&lt;br /&gt;
	  //Step 2 - Waiting until HSI clock is ready&lt;br /&gt;
	  while ((RCC-&amp;gt;CR &amp;amp; RCC_CR_HSIRDY) == 0) {}; // Wait HSIRDY = 1&lt;br /&gt;
	}&lt;br /&gt;
	//Step 3: Select HSI in SW[1:0] as Clock Source&lt;br /&gt;
	//         Take care. SW[1:0] Select the clock source&lt;br /&gt;
	RCC-&amp;gt;CFGR &amp;amp;= 0xfffffffc;&lt;br /&gt;
&lt;br /&gt;
	//Step 4: Select AHB prescaler=1 &lt;br /&gt;
	RCC-&amp;gt;CFGR &amp;amp;= 0xffffff0f; // HPRE[3:0] = 0000&lt;br /&gt;
&lt;br /&gt;
    //Step 5: Setting FLASH wait states FLASH_ACR bits LATENCY[2:0] to 0 Wáit&lt;br /&gt;
	FLASH-&amp;gt;ACR &amp;amp;= 0xfffffff8; //LATENCY[2:0] = 000&lt;br /&gt;
	&lt;br /&gt;
	//Step 6: Disabling HSE Clock- RCC_CR bit&lt;br /&gt;
	RCC-&amp;gt;CR &amp;amp;= ~RCC_CR_HSEON;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
=Clock mode 5=&lt;br /&gt;
[[Image:ARM clock tree HSE prescaler2.png|600px|'''Clock Mode 5:'''&amp;lt;br/&amp;gt;HSE through all Prescalers and Multipliers. ]]&lt;br /&gt;
==Configuring Clock mode 5==&lt;br /&gt;
&amp;lt;source lang=c&amp;gt;&lt;br /&gt;
/* sub rcc_clockmode5()&lt;br /&gt;
   abstract: Select HSE as System Clock with,&lt;br /&gt;
     Crystal = 25 MHz&lt;br /&gt;
	 SYSCLK  = 72 MHz&lt;br /&gt;
	 FCLK    = 72 MHz&lt;br /&gt;
	 OTGFSCLK= 48 MHz (USB)&lt;br /&gt;
&lt;br /&gt;
   input...:  -&lt;br /&gt;
&lt;br /&gt;
   output..: -&lt;br /&gt;
   limits..: No errorcheck performed&lt;br /&gt;
   *********************************************&lt;br /&gt;
   See: http://mars.tekkom.dk/mediawiki/index.php/STM32F107VC/RSS/Clock_Paths&lt;br /&gt;
        http://mars.tekkom.dk/mediawiki/index.php/STM32F107VC/RSS&lt;br /&gt;
   *********************************************&lt;br /&gt;
   &lt;br /&gt;
   To select the frequencies 72 MHz as SYSCLK from 25 MHz Crystal the&lt;br /&gt;
   following calculation is necesary 25 MHz / 5 * 16 / 10 * 9 = 72 MHz&lt;br /&gt;
   &lt;br /&gt;
   PREDIV2 - Divide by 5&lt;br /&gt;
   PLL2MUL - Multiply by 16&lt;br /&gt;
   PREDIV1 - Divide by 10&lt;br /&gt;
   PLLMUL  - Multiply by 9  &lt;br /&gt;
   &lt;br /&gt;
   Step  0: HSEBYP default = 0 (Using Crystral = default)&lt;br /&gt;
   Step  1: Shift to Clockmode=1 (Freeing the Clock Path for programming)&lt;br /&gt;
   Step  2: Enabling the HSE clock - RCC_CR bit&lt;br /&gt;
  		   HSION = 1 HSE : oscillator on&lt;br /&gt;
   Step  3: Waiting until HSE clock is ready an can be used as Clock Source &lt;br /&gt;
           RCC_CR bit HSERDY = 0 : Oscillator Not Ready&lt;br /&gt;
		   RCC_CR bit HSERDY = 1 : Oscillator Ready&lt;br /&gt;
   Step  4: Select RCC_CFGR2 PREDIV2[3:0] divide by 5 =  0100&lt;br /&gt;
   Step  5: Disable RCC_CR PLL2ON = Disable (Shut down PLL2MUL)&lt;br /&gt;
   Step  6: Select RCC_CFGR2 PLL2MUL[3:0] multiply by 16 = 1110&lt;br /&gt;
   Step  7: Enable RCC_CR PLL2ON = Enable (Start pll2MUL after programmed)&lt;br /&gt;
   Step  8: Wait for PLL2MUL to lock RCC_CR bit PLL2RDY = 1&lt;br /&gt;
   Step  9: Select PLL2MUL as PREDIV1SRC - RCC_CFGR2 bit PREDIV1SRC = 1&lt;br /&gt;
   Step 10: Select RCC_CFGR2 PREDIV1[3:0] divide by 10 = 1001&lt;br /&gt;
   Step 11: Select PREDIV1 as PLLSRC - RCC_CFGR bit PLLSRC = 1&lt;br /&gt;
   Step 12: Disable RCC_CR bit PLLON = 0&lt;br /&gt;
   Step 13: Select RCC_CFGR PLLMUL[3:0] multiply by 9 = 0111&lt;br /&gt;
   Step 14: Enable RCC_CR bit PLLON = 1&lt;br /&gt;
   Step 15: Wait for PLLMUL to lock RCC_CR bit PLLRDY = 1&lt;br /&gt;
   Step 16: USB Prescaler divide by 3 ( 72 Mhz * 2 / 3 )  = 48 MHz&lt;br /&gt;
            RCC_CFGR bit OTGFSPRE = 0&lt;br /&gt;
   Step 17: Select AHB prescaler=1 - RCC_CFGR bits HPRE[3:0] = 0000&lt;br /&gt;
   Step 18: Enable prefetch FLASH_ACR bit PRFTBE = 1&lt;br /&gt;
   Step 19: Setting FLASH wait states FLASH_ACR bits LATENCY[2:0] to 2 Wáit States(section 3.3) &lt;br /&gt;
  		    LATECY[2:0] = 000 - Zero wait state. ( 0 Hz  &amp;lt; SYSCLK &amp;lt;= 24 Mhz)&lt;br /&gt;
  		    LATECY[2:0] = 001 - One wait state.  (24 MHz &amp;lt; SYSCLK &amp;lt;= 48 Mhz)&lt;br /&gt;
  		    LATECY[2:0] = 010 - Two wait state.  (48 MHz &amp;lt; SYSCLK &amp;lt;= 72 Mhz) &lt;br /&gt;
   Step 20: Select PLLCLK in SW[1:0] as Clock Source&lt;br /&gt;
            RCC_CR SW[1:0] = 10&lt;br /&gt;
   Step 21: Disabling HSI Clock- RCC_CR bit&lt;br /&gt;
  		   HSION = 0 : oscillator off&lt;br /&gt;
           RCC_CFGR bits SW[1:0] = 00 : HSI selected&lt;br /&gt;
*/&lt;br /&gt;
void rcc_clockmode5( void ) {&lt;br /&gt;
int i;&lt;br /&gt;
	//Step  1: Shift to Clockmode=1&lt;br /&gt;
	rcc_clockmode1();&lt;br /&gt;
&lt;br /&gt;
	// Step 2 - Enabling the HSE clock&lt;br /&gt;
 	RCC-&amp;gt;CR |= RCC_CR_HSEON;  // HSEON=1&lt;br /&gt;
	&lt;br /&gt;
	//Step 3 - Waiting until HSE clock is ready&lt;br /&gt;
	while ((RCC-&amp;gt;CR &amp;amp; RCC_CR_HSERDY) == 0) {}; // Wait HSERDY = 1&lt;br /&gt;
&lt;br /&gt;
	//Step  4: Select RCC_CFGR2 PREDIV2[3:0] divide by 5 =  0100 (bits[7:4])&lt;br /&gt;
	RCC-&amp;gt;CFGR2 |= 0x00000040; // Setting bit x1xx&lt;br /&gt;
	RCC-&amp;gt;CFGR2 &amp;amp;= 0xffffff4f; // Resetting bit 0x00&lt;br /&gt;
&lt;br /&gt;
    //Step  5: Disable RCC_CR PLL2ON = Disable (Shut down PLL2MUL)&lt;br /&gt;
	RCC-&amp;gt;CR &amp;amp;= ~( 1 &amp;lt;&amp;lt; 26 ); // Resetting bit 26 disabling PPL2MUL&lt;br /&gt;
&lt;br /&gt;
	//Step  6: Select RCC_CFGR2 PLL2MUL[3:0] multiply by 16 = 1110 (bits[11:8])&lt;br /&gt;
	RCC-&amp;gt;CFGR2 |= 0x00000e00; // Setting bits 111x&lt;br /&gt;
	RCC-&amp;gt;CFGR2 &amp;amp;= 0xfffffeff; // Resetting bit xxx0&lt;br /&gt;
&lt;br /&gt;
	//Step  7: Enable RCC_CR PLL2ON = Enable (Start pll2MUL after programmed)&lt;br /&gt;
	RCC-&amp;gt;CR |=  1 &amp;lt;&amp;lt; 26 ; // Setting bit 26 enabling PPL2MUL&lt;br /&gt;
&lt;br /&gt;
	//Step  8: Wait for PLL2MUL to lock RCC_CR bit PLL2RDY = 1&lt;br /&gt;
	while ((RCC-&amp;gt;CR &amp;amp; RCC_CR_PLL2RDY) == 0) {}; // Wait PLL2RDY = 1&lt;br /&gt;
&lt;br /&gt;
	//Step  9: Select PLL2MUL as PREDIV1SRC - RCC_CFGR2 bit PREDIV1SRC = 1&lt;br /&gt;
	RCC-&amp;gt;CFGR2 |= 1 &amp;lt;&amp;lt; 16; // Setting bit 16 selecting PLL2MUL&lt;br /&gt;
&lt;br /&gt;
	//Step 10: Select RCC_CFGR2 PREDIV1[3:0] divide by 10 = 1001 (bits[3:0])&lt;br /&gt;
	RCC-&amp;gt;CFGR2 |= 0x00000009; // Setting bits 1xx1&lt;br /&gt;
	RCC-&amp;gt;CFGR2 &amp;amp;= 0xfffffff9; // Resetting bit x00x&lt;br /&gt;
&lt;br /&gt;
	//Step 11: Select PREDIV1 as PLLSRC - RCC_CFGR bit PLLSRC = 1&lt;br /&gt;
	RCC-&amp;gt;CFGR |= RCC_CFGR_PLLSRC;&lt;br /&gt;
&lt;br /&gt;
	//Step 12: Disable RCC_CR bit PLLON = 0&lt;br /&gt;
	RCC-&amp;gt;CR &amp;amp;= ~( 1 &amp;lt;&amp;lt; 24 ); // Resetting bit 24 disabling PPLMUL&lt;br /&gt;
&lt;br /&gt;
	//Step 13: Select RCC_CFGR PLLMUL[3:0] multiply by 9 = 0111	(bits[21:18])&lt;br /&gt;
	RCC-&amp;gt;CFGR &amp;amp;= ~( 1 &amp;lt;&amp;lt; 21 ); // Bit 21 = 0&lt;br /&gt;
	RCC-&amp;gt;CFGR |= 1 &amp;lt;&amp;lt; 20; 		// bit 20 = 1&lt;br /&gt;
	RCC-&amp;gt;CFGR |= 1 &amp;lt;&amp;lt; 19; 		// bit 19 = 1&lt;br /&gt;
	RCC-&amp;gt;CFGR |= 1 &amp;lt;&amp;lt; 18; 		// bit 18 = 1&lt;br /&gt;
&lt;br /&gt;
	//Step 14: Enable RCC_CR bit PLLON = 1&lt;br /&gt;
	RCC-&amp;gt;CR |=  1 &amp;lt;&amp;lt; 24 ; // Setting bit 24 enabling PPLMUL&lt;br /&gt;
&lt;br /&gt;
	//Step 15: Wait for PLLMUL to lock RCC_CR bit PLLRDY = 1&lt;br /&gt;
	while ((RCC-&amp;gt;CR &amp;amp; RCC_CR_PLL1RDY) == 0) {}; // Wait PLL1RDY = 1&lt;br /&gt;
&lt;br /&gt;
	//Step 16: USB Prescaler divide by 3 ( 72 Mhz * 2 / 3 )  = 48 MHz&lt;br /&gt;
	RCC-&amp;gt;CFGR &amp;amp;= ~(1 &amp;lt;&amp;lt; 22); //Resetting OTGFSPRE selects divide by 3&lt;br /&gt;
&lt;br /&gt;
	//Step 17: Select AHB prescaler=1 - RCC_CFGR bits HPRE[3:0] = 0000 (bits[7:4])&lt;br /&gt;
	RCC-&amp;gt;CFGR2 &amp;amp;= 0xffffff0f; // Resetting bit 0000&lt;br /&gt;
&lt;br /&gt;
	//Step 18: Enable prefetch FLASH_ACR bit PRFTBE = 1&lt;br /&gt;
	FLASH-&amp;gt;ACR |= 1 &amp;lt;&amp;lt; 4;&lt;br /&gt;
&lt;br /&gt;
	//Step 19: Setting FLASH wait states FLASH_ACR bits LATENCY[2:0] to 2 Wáit States(section 3.3)&lt;br /&gt;
	FLASH-&amp;gt;ACR |= 0x00000002;&lt;br /&gt;
	FLASH-&amp;gt;ACR &amp;amp;= 0xfffffffa;&lt;br /&gt;
	&lt;br /&gt;
	&lt;br /&gt;
	for(i=0;i &amp;lt; 100000;i++);&lt;br /&gt;
	//Step 20: Select PLLCLK in SW[1:0] as Clock Source&lt;br /&gt;
	RCC-&amp;gt;CFGR |= RCC_CFGR_PLLON;&lt;br /&gt;
&lt;br /&gt;
   //Step 21 - Disable HSI&lt;br /&gt;
	RCC-&amp;gt;CR &amp;amp;= ~RCC_CR_HSION;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:STM32F107VC]][[Category:ARM]]&lt;/div&gt;</summary>
		<author><name>Heth</name></author>	</entry>

	</feed>