<?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: Beginner question for timer in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Beginner-question-for-timer/m-p/526049#M8682</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by fjrg76 on Wed Jul 17 11:34:41 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm beginner for LPC,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I using LPCxpresso LPC1200 Rev B&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to do a simple program, enable the 32bit timer counter and output the high low in port&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, I need to know how to set up the CT32B0,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I already enable the counter, but I don;t know the system clock speed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;PLACE THIS INSTRUCTION IN YOUR main() FUNCTION, AND THE SET A BREAKPOINT ON IT AND CHECK THE SystemCoreClock VALUE:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;SysTick_Config(SystemCoreClock / (uint32_t)1000);&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;YOU MIGHT ALSO WANT TO LOOK AT THIS SMALL TUTORIAL&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;A href="http://fjrg76.wordpress.com/2012/11/02/configuring-the-clock-options-for-the-lpc1227/" rel="nofollow noopener noreferrer" target="test_blank"&gt;http://fjrg76.wordpress.com/2012/11/02/configuring-the-clock-options-for-the-lpc1227/&lt;/A&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I not change the CMISS, did the system clock 24MHZ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So the timer counter will update every 1/24MHZ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1) Any sample code for it?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;void timer16_Init(void)
{
/* gpio -&amp;gt; timer pins */
LPC_SYSCON-&amp;gt;SYSAHBCLKCTRL |= BIT(8);

LPC_IOCON-&amp;gt;PIO2_3=(3);

LPC_CT16B1-&amp;gt;TCR&amp;nbsp; = BIT(1);
LPC_CT16B1-&amp;gt;CTCR = 0;
LPC_CT16B1-&amp;gt;PR&amp;nbsp;&amp;nbsp; = 45;
LPC_CT16B1-&amp;gt;MCR |= BIT(10);&amp;nbsp; /* reset on MR3 */
LPC_CT16B1-&amp;gt;MR3&amp;nbsp; = 125; /* frecuency */
LPC_CT16B1-&amp;gt;MR1&amp;nbsp; = 50; /*&amp;nbsp; duty cycle */
LPC_CT16B1-&amp;gt;EMR&amp;nbsp; = (3&amp;lt;&amp;lt;0x06); /* toggle */
LPC_CT16B1-&amp;gt;PWMC = BIT(1);

LPC_CT16B1-&amp;gt;TCR&amp;nbsp; = 1;
LPC_CT16B1-&amp;gt;EMR&amp;nbsp; &amp;amp;=~(3&amp;lt;&amp;lt;0x06);
}
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I use the Blinky sample code as a base.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) did I need to disable all the interrupt?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;NO&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;3) did I need to reset the watch dog?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;No, if you set the disable the watchdog when you create your project in LPCXpresso IDE.&lt;/STRONG&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 17:01:53 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T17:01:53Z</dc:date>
    <item>
      <title>Beginner question for timer</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Beginner-question-for-timer/m-p/526048#M8681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by MCU on Tue Apr 02 02:53:08 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm beginner for LPC,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I using LPCxpresso LPC1200 Rev B&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to do a simple program, enable the 32bit timer counter and output the high low in port&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, I need to know how to set up the CT32B0,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I already enable the counter, but I don;t know the system clock speed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If I not change the CMISS, did the system clock 24MHZ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So the timer counter will update every 1/24MHZ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1) Any sample code for it?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If I use the Blinky sample code as a base.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) did I need to disable all the interrupt?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3) did I need to reset the watch dog?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:01:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Beginner-question-for-timer/m-p/526048#M8681</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:01:52Z</dc:date>
    </item>
    <item>
      <title>Re: Beginner question for timer</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Beginner-question-for-timer/m-p/526049#M8682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by fjrg76 on Wed Jul 17 11:34:41 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm beginner for LPC,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I using LPCxpresso LPC1200 Rev B&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to do a simple program, enable the 32bit timer counter and output the high low in port&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, I need to know how to set up the CT32B0,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I already enable the counter, but I don;t know the system clock speed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;PLACE THIS INSTRUCTION IN YOUR main() FUNCTION, AND THE SET A BREAKPOINT ON IT AND CHECK THE SystemCoreClock VALUE:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;SysTick_Config(SystemCoreClock / (uint32_t)1000);&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;YOU MIGHT ALSO WANT TO LOOK AT THIS SMALL TUTORIAL&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;A href="http://fjrg76.wordpress.com/2012/11/02/configuring-the-clock-options-for-the-lpc1227/" rel="nofollow noopener noreferrer" target="test_blank"&gt;http://fjrg76.wordpress.com/2012/11/02/configuring-the-clock-options-for-the-lpc1227/&lt;/A&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I not change the CMISS, did the system clock 24MHZ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So the timer counter will update every 1/24MHZ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1) Any sample code for it?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;void timer16_Init(void)
{
/* gpio -&amp;gt; timer pins */
LPC_SYSCON-&amp;gt;SYSAHBCLKCTRL |= BIT(8);

LPC_IOCON-&amp;gt;PIO2_3=(3);

LPC_CT16B1-&amp;gt;TCR&amp;nbsp; = BIT(1);
LPC_CT16B1-&amp;gt;CTCR = 0;
LPC_CT16B1-&amp;gt;PR&amp;nbsp;&amp;nbsp; = 45;
LPC_CT16B1-&amp;gt;MCR |= BIT(10);&amp;nbsp; /* reset on MR3 */
LPC_CT16B1-&amp;gt;MR3&amp;nbsp; = 125; /* frecuency */
LPC_CT16B1-&amp;gt;MR1&amp;nbsp; = 50; /*&amp;nbsp; duty cycle */
LPC_CT16B1-&amp;gt;EMR&amp;nbsp; = (3&amp;lt;&amp;lt;0x06); /* toggle */
LPC_CT16B1-&amp;gt;PWMC = BIT(1);

LPC_CT16B1-&amp;gt;TCR&amp;nbsp; = 1;
LPC_CT16B1-&amp;gt;EMR&amp;nbsp; &amp;amp;=~(3&amp;lt;&amp;lt;0x06);
}
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I use the Blinky sample code as a base.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) did I need to disable all the interrupt?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;NO&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;3) did I need to reset the watch dog?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;No, if you set the disable the watchdog when you create your project in LPCXpresso IDE.&lt;/STRONG&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 17:01:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Beginner-question-for-timer/m-p/526049#M8682</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:01:53Z</dc:date>
    </item>
  </channel>
</rss>

