<?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: Multiple PWM outputs?</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Multiple-PWM-outputs/m-p/539928#M11967</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by LabRat on Tue Jun 30 14:37:39 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: tjones&lt;/STRONG&gt;&lt;BR /&gt;Will this be possible by, say, setting the period of one counter with a MATCH0 and the pulse with MATCH1-4?&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, that's the usual way to generate different PWM signals...&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 19:43:15 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T19:43:15Z</dc:date>
    <item>
      <title>Multiple PWM outputs?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Multiple-PWM-outputs/m-p/539925#M11964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by avass on Wed Jan 02 23:56:08 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; I would like to output two independent PWMs. For example, MAT0 outputing "0.1V" and MAT1 outputing "2.6V"...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; I've been trying to use timer 0 using the init_timer16PWM / setMatch_timer16PWM functions outputing on 0_8/0_9 (MAT0/MAT1), but it looks like they are somehow interconnected. I am sure I don't know enough, I've been reading the docs, yet here I'm...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; So far my code is :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_TMR16B0-&amp;gt;TCR = 0;//Disable Timer0&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_SYSCON-&amp;gt;SYSAHBCLKCTRL |= (1&amp;lt;&amp;lt;7);// System AHB clock control enable clock to timer 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_TMR16B0-&amp;gt;EMR = (1&amp;lt;&amp;lt;EMC3)|(0&amp;lt;&amp;lt;EMC2)|(1&amp;lt;&amp;lt;EMC1)|(1&amp;lt;&amp;lt;EMC0)|(1&amp;lt;&amp;lt;3)|(MATCH0)|(MATCH1);// Setup the external match register&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_IOCON-&amp;gt;PIO0_8 &amp;amp;= ~0x07;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_IOCON-&amp;gt;PIO0_8 |= 0x02;// Timer0_16 MAT0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_IOCON-&amp;gt;PIO0_9 &amp;amp;= ~0x07;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_IOCON-&amp;gt;PIO0_9 |= 0x02;// Timer0_16 MAT1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_TMR16B0-&amp;gt;MR3 = 1000;// Setup the match registers&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_TMR16B0-&amp;gt;MR0 = 0;// Match Register 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_TMR16B0-&amp;gt;MR1 = 0;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_TMR16B0-&amp;gt;MCR = 1&amp;lt;&amp;lt;10;// Match Control Register : Reset on MR3&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_TMR16B0-&amp;gt;PWMC = (1&amp;lt;&amp;lt;3)|0x02|0x01;// PWM Control Register Enable the selected PWMs and enable Match3&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;NVIC_EnableIRQ(TIMER_16_0_IRQn);// Enable the TIMER1 Interrupt&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_TMR16B0-&amp;gt;MR0 = 50;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_TMR16B0-&amp;gt;MR1 = 500;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_TMR16B0-&amp;gt;TCR = 1;// Enable Timer16&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I thought this would output 50/1000*3.3V on 0_8 and 500/1000*3.3V on 0_9, yet I'm getting 1.5V and 2.90Vs...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can somebody please help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:43:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Multiple-PWM-outputs/m-p/539925#M11964</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:43:13Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple PWM outputs?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Multiple-PWM-outputs/m-p/539926#M11965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by avass on Thu Jan 03 02:19:37 MST 2013&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Sorry, found it... Got confused a bit by the pinouts on the LPCXpresso board... MISO=MAT0 and MOSI=MAT1...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;BTW, this one works well :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_TMR16B0-&amp;gt;TCR = 0;//Disable Timer0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_SYSCON-&amp;gt;SYSAHBCLKCTRL |= (1&amp;lt;&amp;lt;7);// System AHB clock control enable clock to timer 0 : 3.5.14&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_TMR16B0-&amp;gt;EMR = (1&amp;lt;&amp;lt;0)|(1&amp;lt;&amp;lt;1)|(1&amp;lt;&amp;lt;3)|(1&amp;lt;&amp;lt;5)|(1&amp;lt;&amp;lt;7)|(1&amp;lt;&amp;lt;10);// Setup the external match register (1&amp;lt;&amp;lt;0 : EM0 connected to pin) : 18.7.10 External Match Register&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;// 1&amp;lt;&amp;lt;5 : Set the corresponding External Match bit/output to 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;// 1&amp;lt;&amp;lt;10 : Clear the corresponding External Match bit/output to 0 (CT16Bn_MATm pin is LOW if pinned out : (1&amp;lt;&amp;lt;3).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_IOCON-&amp;gt;PIO0_8 &amp;amp;= ~0x07;// Clears the FUNC bits : 8.4.23 IOCON_PIO0_8&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_IOCON-&amp;gt;PIO0_8 |= 0x02;// Selects function CT16B0_MAT0. PIO0_8/MISO0/CT16B0_MAT0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_IOCON-&amp;gt;PIO0_9 &amp;amp;= ~0x07;// Clears the FUNC bits : 8.4.24 IOCON_PIO0_9&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_IOCON-&amp;gt;PIO0_9 |= 0x02;// Selects function CT16B0_MAT1. PIO0_9/MOSI0/CT16B0_MAT1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;// These are compared against the TC ( Timer Counter )&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_TMR16B0-&amp;gt;MR3 = 1000;// Setup the match registers&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_TMR16B0-&amp;gt;MR0 = 1001;// Match Register 0 - stay low&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_TMR16B0-&amp;gt;MR1 = 1001;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_TMR16B0-&amp;gt;MCR = 1&amp;lt;&amp;lt;10;// OK : Match Control Register : 1&amp;lt;&amp;lt;10 = Reset on MR3&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;// If needed : 1&amp;lt;&amp;lt;9 = Interrupt on MR3: an interrupt is generated when MR3 matches the value in the TC.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_TMR16B0-&amp;gt;PWMC = 0x08|0x02|0x01;// OK : PWM Control Register to enable the selected PWMs&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;// 0x01 : PWM mode is enabled for CT16Bn_MAT0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;// 0x02 : PWM mode is enabled for CT16Bn_MAT1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;// 0x08 : PWM mode is enabled for match channel 3&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;NVIC_EnableIRQ(TIMER_16_0_IRQn);// Enable the TIMER1 Interrupt&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_TMR16B0-&amp;gt;TCR = 1;// Enable Timer16&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_TMR16B0-&amp;gt;MR0 = 50;&amp;nbsp; // Test some values...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_TMR16B0-&amp;gt;MR1 = 950;&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:43:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Multiple-PWM-outputs/m-p/539926#M11965</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:43:14Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple PWM outputs?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Multiple-PWM-outputs/m-p/539927#M11966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by tjones on Tue Jun 30 14:30:29 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please forgive the newbie question - we're evaluating the LPC812 platform so I could benefit from the community's experience.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to output 4 PWMs on the LPC812.&amp;nbsp; The period can be the identical on each PWM output but the pulse width must be independently modulated.&amp;nbsp;&amp;nbsp; Will this be possible by, say, setting the period of one counter with a MATCH0 and the pulse with MATCH1-4?&amp;nbsp; Or some such?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Tom&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:43:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Multiple-PWM-outputs/m-p/539927#M11966</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:43:15Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple PWM outputs?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Multiple-PWM-outputs/m-p/539928#M11967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by LabRat on Tue Jun 30 14:37:39 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: tjones&lt;/STRONG&gt;&lt;BR /&gt;Will this be possible by, say, setting the period of one counter with a MATCH0 and the pulse with MATCH1-4?&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, that's the usual way to generate different PWM signals...&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:43:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Multiple-PWM-outputs/m-p/539928#M11967</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:43:15Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple PWM outputs?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Multiple-PWM-outputs/m-p/539929#M11968</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by starblue on Wed Jul 01 00:42:03 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: tjones&lt;/STRONG&gt;&lt;BR /&gt;we're evaluating the LPC812 platform so I could benefit from the community's experience&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please don't hijack old threads, in particular not if they are in the subforum for a different controller.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:43:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Multiple-PWM-outputs/m-p/539929#M11968</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:43:16Z</dc:date>
    </item>
  </channel>
</rss>

