<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: SystemClockUpdate() - Function in LPCXpresso IDE</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/SystemClockUpdate-Function/m-p/553354#M12737</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by NXP_Europe on Thu Jul 28 11:03:09 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello sherrysamuel,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;which LPCXpresso board are you using?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 22:09:38 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T22:09:38Z</dc:date>
    <item>
      <title>SystemClockUpdate() - Function</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/SystemClockUpdate-Function/m-p/553353#M12736</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by sherrysamuel on Wed Jul 27 19:03:00 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have one question regarding the "SystemClockUpdate" function in main. This function updates the "SystemFrequency" global variable. But I cannot see use of this variable in the project itself. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you please explain what is the use of this function if "SystemFrequency" variable is not used&amp;nbsp; or it used in some libraries ?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:09:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/SystemClockUpdate-Function/m-p/553353#M12736</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:09:37Z</dc:date>
    </item>
    <item>
      <title>Re: SystemClockUpdate() - Function</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/SystemClockUpdate-Function/m-p/553354#M12737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by NXP_Europe on Thu Jul 28 11:03:09 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello sherrysamuel,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;which LPCXpresso board are you using?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:09:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/SystemClockUpdate-Function/m-p/553354#M12737</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:09:38Z</dc:date>
    </item>
    <item>
      <title>Re: SystemClockUpdate() - Function</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/SystemClockUpdate-Function/m-p/553355#M12738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Rob65 on Fri Jul 29 06:18:03 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;The variable SystemCoreClock gives you the value of the system core clock (CCLK) and it can be used by your routines to calculate system timing.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As an example, look at the UARTinit() function used in a number of the example projects delivered with the LPCXpresso tools.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In there you'll see the following code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_UART1-&amp;gt;LCR = 0x83;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* 8 bits, no Parity, 1 Stop bit */

&amp;nbsp;&amp;nbsp;&amp;nbsp; Fdiv = ((SystemFrequency/4)/16)/baudrate ;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*baud rate */

&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_UART1-&amp;gt;DLM = Fdiv / 256;
&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_UART1-&amp;gt;DLL = Fdiv % 256;
&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_UART1-&amp;gt;LCR = 0x03;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* DLAB = 0 */
&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_UART1-&amp;gt;FCR = 0x07;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Enable and reset TX and RX FIFO. */
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;SPAN&gt;(SystemFrequency is a #define of SystemCoreClock on top of the uart.c file).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This shows how the SystemCoreClock variable is used to calculate the baudrate.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;SystemCoreClock is set during SystemInit() but if you change the clock (e.g. reprogram the PLL or select a different clock source) then calling the SystemCoreClockUpdate() function will calculate the new CCLK frequency.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Use of the SystemCoreClock variable depends on your project and which files you have in the project. The uart example code uses it and also the FreeRTOS project uses this to calculate the correct timing for the system tick. You can also use it in your own code to do stuff like programming timers, PWM, I2C clock frequency calculation etc. independent of the current frequency you are running at.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Whenever you change PLL settings or select a different clock source, you can call SystemCoreClockUpdate() and after that reinitialize modules that need their timing changed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is independent of the LPCXpresso board you are using. It is a system function provided by CMSIS to allow you to update the SystemCoreClock variable when your program changes the core clock frequency.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Rob&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:09:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/SystemClockUpdate-Function/m-p/553355#M12738</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:09:38Z</dc:date>
    </item>
    <item>
      <title>Re: SystemClockUpdate() - Function</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/SystemClockUpdate-Function/m-p/553356#M12739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by sherrysamuel on Sun Jul 31 16:57:25 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks Rob for your detailed answer. I started with an independent project. So I didn't look in other example projects to see how it is used. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanx. Sorry for the trouble.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:09:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/SystemClockUpdate-Function/m-p/553356#M12739</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:09:39Z</dc:date>
    </item>
  </channel>
</rss>

