<?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: Problem setting CCLKDIV register in LPC1778 in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-setting-CCLKDIV-register-in-LPC1778/m-p/632021#M24890</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Ping,&lt;/P&gt;&lt;P&gt;I will see if I can cook something together that will show the same behavior. In the meantime, is there any reason you can think of why there is a problem the way I do it, ie is there any logical reason that this should be a problem ?&lt;/P&gt;&lt;P&gt;I also tried running the CPU at 96 MHz, and the result was the same, a CCLKDIV of 2 crashes the system, and 1 or 4 does not.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 07 Nov 2016 05:35:29 GMT</pubDate>
    <dc:creator>carstengroen</dc:creator>
    <dc:date>2016-11-07T05:35:29Z</dc:date>
    <item>
      <title>Problem setting CCLKDIV register in LPC1778</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-setting-CCLKDIV-register-in-LPC1778/m-p/632017#M24886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a system running on a LPC1778 (using SDRAM, USB etc etc). All is working fine so far, stable etc.&lt;/P&gt;&lt;P&gt;However, I'm trying to do "clock throttling" of the CPU and thats where things go downhill :smileywink:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The system starts up running 120 MHz (EMCCLK for the SDRAM runs at 1/2 speed so 60 MHz, PBOOST set to 0x03). I then have a function where I can set the CCLKDIV register to divide the CPU clock with either 1, 2 or 4 (giving me 120, 60 or 30 MHz).&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is needed to avoid one of the errata where IAP will fail on 5% of devices if running at 120 MHz and to conserve power at certain times. PCLKDIV is always set to divide by 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When changing the divider, I get very often, around 50% of the time, a hard fault. It does not depend on what divider I select, if I go to divide by 2 and then back to 1 or to 4, it can hardfault, there is no consistency in this (and sometimes I can change divider 1 or 2 times successfully and at the 3rd time it faults).&lt;/P&gt;&lt;P&gt;The cause and information of the hardfault differs between different runs, so not very consistent. If I select the same divider as currently selected (basically just rewriting the CCLKDIV register with the same value, no faults are triggered). The PC points to a SVC handler (the change is done via a call thru SVC). None of the other information makes much sense to me..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Is there any thing I must consider when writing the CCLKDIV register ? &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One example of hardfault:&lt;/P&gt;&lt;P&gt;161104 09:01:17.627::E:[diagnose.c:224] R0=0xA01C8470/-1608743824&lt;BR /&gt;161104 09:01:17.709::E:[diagnose.c:225] R1=0x01000000/16777216&lt;BR /&gt;161104 09:01:18.197::E:[diagnose.c:226] R2=0xFFFFFFE0/-32&lt;BR /&gt;161104 09:01:18.278::E:[diagnose.c:227] R3=0xA01C8528/-1608743640&lt;BR /&gt;161104 09:01:18.400::E:[diagnose.c:229] R12=0x0004DBAD&lt;BR /&gt;161104 09:01:18.891::E:[diagnose.c:230] LR [R14]=0xFFFFFFFD&lt;BR /&gt;161104 09:01:18.972::E:[diagnose.c:231] PC [R15]=0x0002031A&lt;BR /&gt;161104 09:01:19.075::E:[diagnose.c:233] PSR=0x0100000B&lt;BR /&gt;161104 09:01:19.135::E:[diagnose.c:236] CFSR (Config. Fault SR)=0x00008200&lt;BR /&gt;161104 09:01:19.645::E:[diagnose.c:245] :BusFault-&amp;gt;Bus Fault Address Register (BFAR) holds a valid address=0x00FFFFFE&lt;BR /&gt;161104 09:01:19.726::E:[diagnose.c:254] HFSR (Hard Fault SR)=0x40000000&lt;BR /&gt;161104 09:01:19.809::E:[diagnose.c:258] :FORCED, Bus fault/Memory management fault/usage fault&lt;BR /&gt;161104 09:01:19.891::E:[diagnose.c:263] DFSR (Debug Fault SR)=0x00000008&lt;BR /&gt;161104 09:01:20.382::E:[diagnose.c:265] AFSR (Auxiliary Fault SR)=0x00000000&lt;BR /&gt;161104 09:01:20.484::E:[diagnose.c:266] SCB-&amp;gt;SHCSR (System Handler Control and State R (exception))=0x00000080&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and another:&lt;/P&gt;&lt;P&gt;161104 09:11:46.120::E:[diagnose.c:224] R0=0x00000001/1&lt;BR /&gt;161104 09:11:46.181::E:[diagnose.c:225] R1=0x00000000/0&lt;BR /&gt;161104 09:11:46.711::E:[diagnose.c:226] R2=0x00000000/0&lt;BR /&gt;161104 09:11:46.773::E:[diagnose.c:227] R3=0x0004D74D/317261&lt;BR /&gt;161104 09:11:46.874::E:[diagnose.c:229] R12=0x00024E01&lt;BR /&gt;161104 09:11:46.936::E:[diagnose.c:230] LR [R14]=0x00000000&lt;BR /&gt;161104 09:11:47.424::E:[diagnose.c:231] PC [R15]=0x40000000&lt;BR /&gt;161104 09:11:47.525::E:[diagnose.c:233] PSR=0x4000C000&lt;BR /&gt;161104 09:11:47.606::E:[diagnose.c:236] CFSR (Config. Fault SR)=0x00020000&lt;BR /&gt;161104 09:11:47.790::E:[diagnose.c:254] HFSR (Hard Fault SR)=0x40000000&lt;BR /&gt;161104 09:11:48.320::E:[diagnose.c:258] :FORCED, Bus fault/Memory management fault/usage fault&lt;BR /&gt;161104 09:11:48.381::E:[diagnose.c:263] DFSR (Debug Fault SR)=0x00000008&lt;BR /&gt;161104 09:11:48.461::E:[diagnose.c:265] AFSR (Auxiliary Fault SR)=0x00000000&lt;BR /&gt;161104 09:11:48.563::E:[diagnose.c:266] SCB-&amp;gt;SHCSR (System Handler Control and State R (exception))=0x00000000&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Nov 2016 08:24:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-setting-CCLKDIV-register-in-LPC1778/m-p/632017#M24886</guid>
      <dc:creator>carstengroen</dc:creator>
      <dc:date>2016-11-04T08:24:26Z</dc:date>
    </item>
    <item>
      <title>Re: Problem setting CCLKDIV register in LPC1778</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-setting-CCLKDIV-register-in-LPC1778/m-p/632018#M24887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Some more testing has been done, it seems that changing from CCLKDIV 1 to 4 and back works every time! It is only going to CCLKDIV 2 that there is a problem (around 50% of the time). If this is any help or not I don't know.....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Nov 2016 11:10:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-setting-CCLKDIV-register-in-LPC1778/m-p/632018#M24887</guid>
      <dc:creator>carstengroen</dc:creator>
      <dc:date>2016-11-04T11:10:47Z</dc:date>
    </item>
    <item>
      <title>Re: Problem setting CCLKDIV register in LPC1778</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-setting-CCLKDIV-register-in-LPC1778/m-p/632019#M24888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Bump....&lt;/P&gt;&lt;P&gt;Anyone know why a CCLKDIV value of 2 crashes the system and a CCLKDIV of 4 (and 1) does not ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 05 Nov 2016 12:24:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-setting-CCLKDIV-register-in-LPC1778/m-p/632019#M24888</guid>
      <dc:creator>carstengroen</dc:creator>
      <dc:date>2016-11-05T12:24:15Z</dc:date>
    </item>
    <item>
      <title>Re: Problem setting CCLKDIV register in LPC1778</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-setting-CCLKDIV-register-in-LPC1778/m-p/632020#M24889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;SPAN class=""&gt;&lt;A _jive_internal="true" data-userid="283367" data-username="carstengroen" href="https://community.nxp.com/people/carstengroen"&gt;Carsten Groen&lt;/A&gt;&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;After had a brief look through the issue description, I was wondering if you can share a simple demo that I can replicate the issue on my site.&lt;/P&gt;&lt;P&gt;I'm looking forward to your reply.&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;Ping&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Nov 2016 02:47:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-setting-CCLKDIV-register-in-LPC1778/m-p/632020#M24889</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2016-11-07T02:47:43Z</dc:date>
    </item>
    <item>
      <title>Re: Problem setting CCLKDIV register in LPC1778</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-setting-CCLKDIV-register-in-LPC1778/m-p/632021#M24890</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Ping,&lt;/P&gt;&lt;P&gt;I will see if I can cook something together that will show the same behavior. In the meantime, is there any reason you can think of why there is a problem the way I do it, ie is there any logical reason that this should be a problem ?&lt;/P&gt;&lt;P&gt;I also tried running the CPU at 96 MHz, and the result was the same, a CCLKDIV of 2 crashes the system, and 1 or 4 does not.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Nov 2016 05:35:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-setting-CCLKDIV-register-in-LPC1778/m-p/632021#M24890</guid>
      <dc:creator>carstengroen</dc:creator>
      <dc:date>2016-11-07T05:35:29Z</dc:date>
    </item>
  </channel>
</rss>

