<?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 LPC1227- Extern Counter Mode in LPCXpresso IDE</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1227-Extern-Counter-Mode/m-p/549115#M10828</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by saud_c on Fri Jul 25 00:49:31 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hey guys. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to use a extern counter and then toggle a output. The idea behind it is using the lpc1227 in counter mode for a extern PLL. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Since the lpc1227 is way cheaper than the HEF4059 and has a bigger frequency width, I think that this is a great way of solving this problem. The idea is in using the counter with the CAP0 (PIO0_1) to count with the rising_edge to MR3 then toggle MAT0. Does anyone have any ideas?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Unfortunately it does not work. This is my code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-338154"&gt;counter_extern.c.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 22:04:39 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T22:04:39Z</dc:date>
    <item>
      <title>LPC1227- Extern Counter Mode</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1227-Extern-Counter-Mode/m-p/549115#M10828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by saud_c on Fri Jul 25 00:49:31 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hey guys. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to use a extern counter and then toggle a output. The idea behind it is using the lpc1227 in counter mode for a extern PLL. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Since the lpc1227 is way cheaper than the HEF4059 and has a bigger frequency width, I think that this is a great way of solving this problem. The idea is in using the counter with the CAP0 (PIO0_1) to count with the rising_edge to MR3 then toggle MAT0. Does anyone have any ideas?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Unfortunately it does not work. This is my code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-338154"&gt;counter_extern.c.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:04:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1227-Extern-Counter-Mode/m-p/549115#M10828</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:04:39Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1227- Extern Counter Mode</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1227-Extern-Counter-Mode/m-p/549116#M10829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by saud_c on Fri Jul 25 00:52:24 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;[img=1000x10000]C:\Users\Saud\Desktop\counter_extern.PNG[/img]Hey guys. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to use a extern counter and then toggle a output. The idea behind it is using the lpc1227 in counter mode for a extern PLL. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Since the lpc1227 is way cheaper than the HEF4059 and has a bigger frequency width, I think that this is a great way of solving this problem. The idea is in using the counter with the CAP0 (PIO0_1) to count with the rising_edge to MR3 then toggle MAT0. Does anyone have any ideas?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Unfortunately it does not work. This is my code&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:04:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1227-Extern-Counter-Mode/m-p/549116#M10829</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:04:41Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1227- Extern Counter Mode</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1227-Extern-Counter-Mode/m-p/549117#M10830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by saud_c on Fri Jul 25 00:50:10 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: saud_c&lt;/STRONG&gt;&lt;BR /&gt;Hey guys. &lt;BR /&gt;&lt;BR /&gt;I want to use a extern counter and then toggle a output. The idea behind it is using the lpc1227 in counter mode for a extern PLL. &lt;BR /&gt;Since the lpc1227 is way cheaper than the HEF4059 and has a bigger frequency width, I think that this is a great way of solving this problem. The idea is in using the counter with the CAP0 (PIO0_1) to count with the rising_edge to MR3 then toggle MAT0. Does anyone have any ideas?&lt;BR /&gt;Unfortunately it does not work. This is my code&lt;BR /&gt;&lt;BR /&gt;#ifdef __USE_CMSIS&lt;BR /&gt;#include "LPC12xx.h"&lt;BR /&gt;#endif&lt;BR /&gt;&lt;BR /&gt;#include &amp;lt;cr_section_macros.h&amp;gt;&lt;BR /&gt;&lt;BR /&gt;unsigned int i, k;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;void TIMER16_0_IRQHandler(void)&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;LPC_CT16B0-&amp;gt;IR= 1 &amp;lt;&amp;lt;3;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //this is just for security, so that the Interrupt will be enabled&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;void timer16_init(void)&lt;BR /&gt;{&lt;BR /&gt;LPC_SYSCON-&amp;gt;SYSAHBCLKCTRL |= 1&amp;lt;&amp;lt;7;&lt;BR /&gt;&lt;BR /&gt;LPC_IOCON-&amp;gt;PIO0_28 = 0x04;&amp;nbsp;&amp;nbsp;&amp;nbsp; // use PIO0_28 as MAT output&lt;BR /&gt;LPC_IOCON-&amp;gt;PIO0_1 = 0x03;&amp;nbsp;&amp;nbsp;&amp;nbsp; // use PIO0_1 as CAP input&lt;BR /&gt;LPC_CT16B0-&amp;gt;TCR = 1;&amp;nbsp;&amp;nbsp;&amp;nbsp; // activates counter mode&lt;BR /&gt;LPC_CT16B0-&amp;gt;TC = 0;&amp;nbsp;&amp;nbsp;&amp;nbsp; // sets Timer Counter on 0&lt;BR /&gt;LPC_CT16B0-&amp;gt;MCR = 3 &amp;lt;&amp;lt;9;&amp;nbsp;&amp;nbsp;&amp;nbsp; // activates MR3&lt;BR /&gt;LPC_CT16B0-&amp;gt;MR3 = 100;&amp;nbsp;&amp;nbsp;&amp;nbsp; // sets MR3 value on 100, if TC= MR3 &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // then interrupt&lt;BR /&gt;LPC_CT16B0-&amp;gt;EMR = 0x31;&amp;nbsp;&amp;nbsp;&amp;nbsp; // toggle &amp;amp; activate MR0&lt;BR /&gt;LPC_CT16B0-&amp;gt;CTCR = 0x1;&amp;nbsp;&amp;nbsp;&amp;nbsp; // enables Counter Mode, (CAP0 is the default &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // value)&lt;BR /&gt;LPC_CT16B0-&amp;gt;IR = 1 &amp;lt;&amp;lt;3;&amp;nbsp;&amp;nbsp;&amp;nbsp; // enable Interrupt on MR3&lt;BR /&gt;NVIC_EnableIRQ(TIMER_16_0_IRQn);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;int main(void) {&lt;BR /&gt;&lt;BR /&gt;timer16_init();&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while(1) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;}&lt;/SPAN&gt;&lt;HR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 13:56:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/LPC1227-Extern-Counter-Mode/m-p/549117#M10830</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T13:56:17Z</dc:date>
    </item>
  </channel>
</rss>

