<?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>LPC MicrocontrollersのトピックRe: Problem with SCT for a simple timer</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-with-SCT-for-a-simple-timer/m-p/568429#M17722</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by MarcVonWindscooting on Wed Jan 08 14:46:32 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: salamlora1&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;I’m trying to run a 128 khz period cycle on pin0_7&lt;BR /&gt;&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Much easier done with CLKOUT:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CLKOUT divider set to 94, use switch matrix to put moveable function to PIO0_7 (PINASSIGN8).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 20:08:02 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T20:08:02Z</dc:date>
    <item>
      <title>Problem with SCT for a simple timer</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-with-SCT-for-a-simple-timer/m-p/568424#M17717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by salamlora1 on Wed Jan 08 00:11:28 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Problem with SCT for a simple timer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;back again with another problem :-D &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I’m trying to run a 128 khz period cycle on pin0_7 whit SCT and my processor is LPC812M101JD16 and using the internal crystal &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I’m writhe the program below but it’s not work &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SCT_delay=1000000;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_SYSCON-&amp;gt;SYSAHBCLKCTRL |= (1&amp;lt;&amp;lt;8); //enable the clock for sct 92.1.18 &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_SYSCON-&amp;gt;PRESETCTRL |= ( 1&amp;lt;&amp;lt; 8); // clear the sct resset pins&amp;nbsp; 92.1.18&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_SWM-&amp;gt;PINASSIGN6 |= (111&amp;lt;&amp;lt;24) ; // set the pin0_7 to output&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_SCT-&amp;gt;CONFIG = (LPC_SCT-&amp;gt;CONFIG &amp;amp; ~0x00060001);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_SCT-&amp;gt;REGMODE_L = 0x00000000;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_SCT-&amp;gt;MATCH[0].U = SCT_delay;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_SCT-&amp;gt;MATCHREL[0].U = SCT_delay;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_SCT-&amp;gt;OUT[0].SET = 0x00000001;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_SCT-&amp;gt;OUT[0].CLR = 0x00000002;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Initial state of CTOUT_0 is 0 */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_SCT-&amp;gt;OUTPUT = (LPC_SCT-&amp;gt;OUTPUT &amp;amp; ~0x00000001) | 0x00000000;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_SCT-&amp;gt;EVENT[0].CTRL = 0x0000D000; /* match[0] causes transition to State 1 */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_SCT-&amp;gt;EVENT[0].STATE = 0x00000001; /* Event[0] occurs in State 0 */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_SCT-&amp;gt;EVENT[1].CTRL = 0x00005000; /* Event 0 on Match[0]. Load State 0 */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_SCT-&amp;gt;EVENT[1].STATE = 0x00000002; /* Event[1] occurs in State 1 */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_SCT-&amp;gt;STATE_L = 0; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_SCT-&amp;gt;LIMIT_L = 0x00000003; /* EVENTS 0 and 1 cause a timer limit */&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 20:07:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-with-SCT-for-a-simple-timer/m-p/568424#M17717</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T20:07:59Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with SCT for a simple timer</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-with-SCT-for-a-simple-timer/m-p/568425#M17718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by MarcVonWindscooting on Wed Jan 08 08:28:31 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: salamlora1&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_SWM-&amp;gt;PINASSIGN6 |= (111&amp;lt;&amp;lt;24) ; // set the pin0_7 to output&lt;BR /&gt;&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That seems totally off to me. First the value 111, second the operation |= .&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But also, you don't turn on the AHB clock of SWM befor using that.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And of course, you can implement your 120kHz toggle with one single state, one event, that both sets and clears CTOUT_0 and is resolved as toggle at this conflict.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You should explain a bit more, why you do it in that way.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 20:08:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-with-SCT-for-a-simple-timer/m-p/568425#M17718</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T20:08:00Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with SCT for a simple timer</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-with-SCT-for-a-simple-timer/m-p/568426#M17719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by salamlora1 on Wed Jan 08 11:46:47 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;thx for your answer I’m new in arm m0 and i don’t understand sct very well its a peas of lpcxpresso samples i hope its work but its seams not :D &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;can you explain me how to create a timer whith 128khz&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 20:08:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-with-SCT-for-a-simple-timer/m-p/568426#M17719</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T20:08:01Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with SCT for a simple timer</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-with-SCT-for-a-simple-timer/m-p/568427#M17720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by salamlora1 on Wed Jan 08 11:46:48 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;thx for your answer I’m new in arm m0 and i don’t understand sct very well its a peas of lpcxpresso samples i hope its work but its seams not :D &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;can you explain me how to create a timer whith 128khz&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 20:08:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-with-SCT-for-a-simple-timer/m-p/568427#M17720</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T20:08:01Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with SCT for a simple timer</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-with-SCT-for-a-simple-timer/m-p/568428#M17721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by MarcVonWindscooting on Wed Jan 08 12:58:52 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;How can you verify the output? Oscilloscope??&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Just as a coarse roadmap:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You cannot divide 12MHz by an integral divider to get 128kHz, so let's assume 127.66 kHz is fine (divide by 94). We can generate the&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;wanted frequency by toggling with double frequency, divider=47&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So set up a match at value 47-1 (match0) disable reload.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Configure AUTOLIMIT (CONFIG).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Configure event0 as match 0, no state condition. Use state 0 only.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Configure event0 to set CTOUT_0 (OUT0SET) and event0 to clear CTOUT_0 (OUT0CLR) and resolve&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;by setting RES to 'toggle' in case of conflict.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Configure switch matrix. Distinguish binary numbers/decimal numbers/hexadecimal numbers properly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you don't understand SCT, then re-read until you do. SCT is scaring at first, after some time it turns out to be cool and easy to&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;understand. You cannot learn by copy-and-paste-and-askTheForum-and-paste-again. Print the SCT chapter on paper. Read.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Read again. Understand what events, states, matches, captures, outputs, intputs can be used for. Don't start programming before&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;you understand that.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If you prefer hope to knowledge they you had better prefer preaching to programming&amp;nbsp; ;-)&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 20:08:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-with-SCT-for-a-simple-timer/m-p/568428#M17721</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T20:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with SCT for a simple timer</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-with-SCT-for-a-simple-timer/m-p/568429#M17722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by MarcVonWindscooting on Wed Jan 08 14:46:32 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: salamlora1&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;I’m trying to run a 128 khz period cycle on pin0_7&lt;BR /&gt;&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Much easier done with CLKOUT:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CLKOUT divider set to 94, use switch matrix to put moveable function to PIO0_7 (PINASSIGN8).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 20:08:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-with-SCT-for-a-simple-timer/m-p/568429#M17722</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T20:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with SCT for a simple timer</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-with-SCT-for-a-simple-timer/m-p/568430#M17723</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by salamlora1 on Sun Jan 12 06:31:35 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Thx for your answers I’m trying the clkout and also study more for understanding of SCT&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;lpcware are the coolest forum i ever sine for ARMs controllers &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thx guys&amp;nbsp; :D&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 20:08:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Problem-with-SCT-for-a-simple-timer/m-p/568430#M17723</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T20:08:03Z</dc:date>
    </item>
  </channel>
</rss>

