<?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>S12 / MagniV MicrocontrollersのトピックRe: PWM module and Timer module</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PWM-module-and-Timer-module/m-p/159544#M4939</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Much better now, please mention bit names next time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Timer compare is always available, you just can't output both signals to the same pin. With MODRR bit set you can see on PTT PWM output, but not the timer compare output.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;If I understood you intentions, you are trying to generate timer interrupt every 16 bus clock cycles. Interrupt entry and exit with RTI takes longer than that! That means that you are always late writing new compare value to timer register and interrupt happens not every timer tick, but roughly every 2^16 timer ticks, which is about 0.04s. Are you really observing 0.04ms period and not 0.04s?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;TFLG1 |= 0x04;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Clear Timer2 flag (interrupt flag)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;^^ comment is wrong. You are clearing all timer TFLG1 flags, not just 2nd channel flag. To clear just 2nd flag use one of these:&lt;/P&gt;&lt;P&gt;TFLG1 = 0x04;&lt;/P&gt;&lt;P&gt;TFLG1 &amp;amp;= 0x04;&amp;nbsp; // please don't mix with bit clear code like TFLG1 &amp;amp;= &lt;FONT color="#ff0000"&gt;&lt;STRONG&gt;~&lt;/STRONG&gt;&lt;/FONT&gt;0x04;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Aug 2011 02:16:50 GMT</pubDate>
    <dc:creator>kef</dc:creator>
    <dc:date>2011-08-17T02:16:50Z</dc:date>
    <item>
      <title>PWM module and Timer module</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PWM-module-and-Timer-module/m-p/159541#M4936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I am using a MC9S1264MFA microcontroler. I was trying use PWM2 channel and the timer 2 interrupt, can I use two function at same time?&lt;BR /&gt;&lt;BR /&gt;I do this question because, PWM channel 2 working normally but timer 2 don´t work like I configured .&lt;BR /&gt;&lt;BR /&gt;PWM channel 2 configuration:&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MODRR = 0x14;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PWME = 0;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PWMPOL = 0x14;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PWMCLK = 0x14;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PWMPRCLK = 0x00;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PWMSCLA = 0x0C;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PWMSCLB = 0x0C;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PWMCAE = 0x00;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PWMPER and PWMDTY was dynamically configured.&lt;BR /&gt;&lt;BR /&gt;Timer 2 configuration:&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TSCR2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x84;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TSCR1&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x80;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TIOS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |=&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x04;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TIE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |=&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x04;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TC2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x01;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TCTL2&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;=&amp;nbsp;&amp;nbsp;&amp;nbsp; 0xCF;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TCTL4&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;=&amp;nbsp;&amp;nbsp;&amp;nbsp; 0xCF;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TFLG1&amp;nbsp;&amp;nbsp;&amp;nbsp; |=&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x04;&lt;BR /&gt;&lt;BR /&gt;I´m trying configure to 0,666us, but the interrupt occur every 0,042ms.&lt;BR /&gt;what I´m doing wrong?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Aug 2011 04:03:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PWM-module-and-Timer-module/m-p/159541#M4936</guid>
      <dc:creator>francisco_grame</dc:creator>
      <dc:date>2011-08-16T04:03:34Z</dc:date>
    </item>
    <item>
      <title>Re: PWM module and Timer module</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PWM-module-and-Timer-module/m-p/159542#M4937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you please decifier all those numbers? It is not clear without datasheet what bits&amp;nbsp;are you setting and what bits are you clearing.&lt;/P&gt;&lt;P&gt;Regarding timing, you didn't say what is crystal clock and if you are using PLL or not.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Aug 2011 14:05:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PWM-module-and-Timer-module/m-p/159542#M4937</guid>
      <dc:creator>kef</dc:creator>
      <dc:date>2011-08-16T14:05:22Z</dc:date>
    </item>
    <item>
      <title>Re: PWM module and Timer module</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PWM-module-and-Timer-module/m-p/159543#M4938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Cristal: 8Mhz&lt;/P&gt;&lt;P&gt;PLL: 48Mhz&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PWM channel 2 configuration:&lt;/P&gt;&lt;P&gt;MODRR = 0x14;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //port pin 2 and 4 was connected to pwm 2 and 4 output&lt;/P&gt;&lt;P&gt;PWME = 0;&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; //PWM enable - disable initially&lt;/P&gt;&lt;P&gt;PWMPOL = 0x14;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // pwm polarity&lt;/P&gt;&lt;P&gt;PWMCLK = 0x14;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //clock select SA and SB selected&lt;/P&gt;&lt;P&gt;PWMPRCLK = 0x00;&amp;nbsp;&amp;nbsp;&amp;nbsp; //bus prescaler select, using none&lt;/P&gt;&lt;P&gt;PWMSCLA = 0x0C;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // pwm clock = SA clock/(2*PWMSCLA﻿) = 24MHz/24 = 1 us clk﻿&lt;/P&gt;&lt;P&gt;PWMSCLB = 0x0C;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // pwm clock = SA clock/(2*PWMSCLA﻿) = 24MHz/24 = 1 us clk﻿﻿&lt;/P&gt;&lt;P&gt;PWMCAE = 0x00;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //pwm left aligned&lt;/P&gt;&lt;P&gt;PWMPER and PWMDTY was dynamically configured.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Timer 2 configuration:&lt;/P&gt;&lt;P&gt;TSCR2 = 0x84;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //TIMER overflow interrupt enable and timer prescaler = 16, (time clock = (48MHz /2) / 16 = 0,666us)&amp;nbsp;&lt;/P&gt;&lt;P&gt;TSCR1 = 0x80;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Timer enable&lt;/P&gt;&lt;P&gt;TIOS |= 0x04;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; //timer 2 channel is output compare&amp;nbsp;&lt;/P&gt;&lt;P&gt;TIE |= 0x04;&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; // timer 2 interrupt enable&lt;/P&gt;&lt;P&gt;TC2 = 0x01;&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; // timer 2 output compare resgister, match every 1 count of timer (TCNT), TC2 was updated on code.&lt;/P&gt;&lt;P&gt;TCTL2 &amp;amp;= 0xCF;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // timer control register, disconect timer 2 from output pin logic&lt;/P&gt;&lt;P&gt;TCTL4 &amp;amp;= 0xCF;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Capture disabled&lt;/P&gt;&lt;P&gt;TFLG1 |= 0x04;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Clear Timer2 flag (interrupt flag)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;﻿ I´m trying configure to 0,666us, but the interrupt occur every 0,042ms. what I´m doing wrong?﻿&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Aug 2011 18:54:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PWM-module-and-Timer-module/m-p/159543#M4938</guid>
      <dc:creator>francisco_grame</dc:creator>
      <dc:date>2011-08-16T18:54:23Z</dc:date>
    </item>
    <item>
      <title>Re: PWM module and Timer module</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PWM-module-and-Timer-module/m-p/159544#M4939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Much better now, please mention bit names next time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Timer compare is always available, you just can't output both signals to the same pin. With MODRR bit set you can see on PTT PWM output, but not the timer compare output.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;If I understood you intentions, you are trying to generate timer interrupt every 16 bus clock cycles. Interrupt entry and exit with RTI takes longer than that! That means that you are always late writing new compare value to timer register and interrupt happens not every timer tick, but roughly every 2^16 timer ticks, which is about 0.04s. Are you really observing 0.04ms period and not 0.04s?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;TFLG1 |= 0x04;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Clear Timer2 flag (interrupt flag)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;^^ comment is wrong. You are clearing all timer TFLG1 flags, not just 2nd channel flag. To clear just 2nd flag use one of these:&lt;/P&gt;&lt;P&gt;TFLG1 = 0x04;&lt;/P&gt;&lt;P&gt;TFLG1 &amp;amp;= 0x04;&amp;nbsp; // please don't mix with bit clear code like TFLG1 &amp;amp;= &lt;FONT color="#ff0000"&gt;&lt;STRONG&gt;~&lt;/STRONG&gt;&lt;/FONT&gt;0x04;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2011 02:16:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PWM-module-and-Timer-module/m-p/159544#M4939</guid>
      <dc:creator>kef</dc:creator>
      <dc:date>2011-08-17T02:16:50Z</dc:date>
    </item>
    <item>
      <title>Re: PWM module and Timer module</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PWM-module-and-Timer-module/m-p/159545#M4940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry for my incomplete post.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Well, you really is correct, the period is 0.045s. If I understand, when I use RTI I can´t obtain periods less than 0,045ms.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It´s so bad, I was trying this for three days.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ok, Can you tell me if I have other option to make frequency with 200khz or period with 4us.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have only timer 2 and 4. I think not.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2011 03:40:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PWM-module-and-Timer-module/m-p/159545#M4940</guid>
      <dc:creator>francisco_grame</dc:creator>
      <dc:date>2011-08-17T03:40:28Z</dc:date>
    </item>
    <item>
      <title>Re: PWM module and Timer module</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PWM-module-and-Timer-module/m-p/159546#M4941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ops, I said 0.045ms instead 0.045s.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I actually wanted a pwm period at least 200 Hz with resolution at least 255.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Underlining that I haven´t hardware pwm channel available﻿.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2011 19:01:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PWM-module-and-Timer-module/m-p/159546#M4941</guid>
      <dc:creator>francisco_grame</dc:creator>
      <dc:date>2011-08-17T19:01:01Z</dc:date>
    </item>
    <item>
      <title>Re: PWM module and Timer module</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PWM-module-and-Timer-module/m-p/159547#M4942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Least RTI divider is 2^10=1024. RTI source clock is your crystal clock, so 1(8MHz/1024)=128us. You probably assumed that RTI is clocked from bus clock, 128/(24/8)=42.6us, right?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;200kHz is 120 bus cycles @ 24MHz bus clock. 120 is not a lot, but that's enough to service interrupt, of course you should keep you ISR code short in terms of execution time.&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;You can generate 200kHz using just hardware, without any CPU load. PWM is well suited for this. You need to program PWM period register for 120 bus cycles and set up duty cycle register for&amp;nbsp;less than 120 bus cycles.&lt;BR /&gt;You can generate 200kHz also using timer.&amp;nbsp;For no CPU load&amp;nbsp;you can make timer counter reset on TC7 compare (see TCRE bit).&amp;nbsp;You program TC7 period for 120 bus cycles and use OC7M and OC7D registers to clear(set) pin, while&amp;nbsp;other than TC7 channel is set up to set(clear) pin on compare match. TC7 does one edge, another TCx does another edge. But using timer this way may be a pain to use other channels for other purposes, since timer counter never will go past&amp;nbsp;120.&lt;/P&gt;&lt;P&gt;But you don't load CPU, no single interrupt is required.&lt;/P&gt;&lt;P&gt;Less restricting but more CPU execution time hungry is&amp;nbsp;generating interrupt for each edge of the waveform. Each time you enter interrupt you set up next timer:&amp;nbsp;change TCTLx configuration and calculate next TCx value TCx = TCx + n;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;DIV class="lia-message-body-content"&gt;&lt;P&gt;Ops, I said 0.045ms instead 0.045s&lt;/P&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;really? Certainly you can have RTI interrupts more often than each 0.045s.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, you can do PWM using timer. It would be best to use TCRE=1 approach for this, because using interrupts you are limited on time between two adjacent edges. It can't be too short, because CPU needs time to enter and exit ISR. So duty cycle can't be too close to 0% and too close to 100%.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2011 21:14:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PWM-module-and-Timer-module/m-p/159547#M4942</guid>
      <dc:creator>kef</dc:creator>
      <dc:date>2011-08-17T21:14:43Z</dc:date>
    </item>
    <item>
      <title>Re: PWM module and Timer module</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PWM-module-and-Timer-module/m-p/159548#M4943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;These information helped me alot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Aug 2011 08:09:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PWM-module-and-Timer-module/m-p/159548#M4943</guid>
      <dc:creator>francisco_grame</dc:creator>
      <dc:date>2011-08-19T08:09:26Z</dc:date>
    </item>
  </channel>
</rss>

