<?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: PWM question for HCS08 series in 8-bit Microcontrollers</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/PWM-question-for-HCS08-series/m-p/207168#M17545</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;JD,&lt;/P&gt;&lt;P&gt;That was it .... thank you very much for the point in the right direction.&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Ben&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 21 Jun 2010 23:22:00 GMT</pubDate>
    <dc:creator>BogieBen</dc:creator>
    <dc:date>2010-06-21T23:22:00Z</dc:date>
    <item>
      <title>PWM question for HCS08 series</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/PWM-question-for-HCS08-series/m-p/207166#M17543</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We are using the HCS08 series 8 bit micro's in our two different project.&lt;BR /&gt;&lt;BR /&gt;Our first project used the MC9S08GQ8.&lt;BR /&gt;We created an output clock toggling on PB5 and it worked fine.&lt;BR /&gt;Below is the C section for this.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;PTBD_PTBD1 =1; &amp;nbsp; &amp;nbsp;// Port B/1 is POWER LED &amp;nbsp;0 = on&lt;BR /&gt;&amp;nbsp;PTBDD_PTBDD1 = 1; // Set PTB1 as an output&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;PTBD_PTBD2 =0; &amp;nbsp; &amp;nbsp;// Port B/2 is -RESETDSP &amp;nbsp; 0 = -DSP IN RESET&lt;BR /&gt;&amp;nbsp;PTBDD_PTBDD2 = 1; // Set PTB2 as an output &amp;nbsp;put dsp into reset&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;PTBD_PTBD3 =1; &amp;nbsp; &amp;nbsp;// Port B/3 is -DSPPDN &amp;nbsp; &amp;nbsp;1 = POWER ON&lt;BR /&gt;&amp;nbsp;PTBDD_PTBDD3 = 1; // Set PTB3 as an output&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;PTBD_PTBD4 =1; &amp;nbsp; &amp;nbsp;// Port B/4 is -ENCLASSD SET OFF 0= AMP ON&lt;BR /&gt;&amp;nbsp;PTBDD_PTBDD4 = 1; // Set PTB6 as an output&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;// MAX count = (PWM count * 2) - 1 for 50% duty&lt;BR /&gt;&amp;nbsp;TPMMODH = 0; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Channel 1 Max count &amp;nbsp;(HIGH)&lt;BR /&gt;&amp;nbsp;TPMMODL = 67 ; &amp;nbsp; &amp;nbsp;// ""(TPMC1VL *2)-1=50% (LOW)&lt;BR /&gt;&amp;nbsp;TPMC1VH = 0; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Channel 1 PWM count &amp;nbsp;(HIGH)&lt;BR /&gt;&amp;nbsp;TPMC1VL = 34; &amp;nbsp; &amp;nbsp; // "" &amp;nbsp; 26 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(LOW)&lt;BR /&gt;&amp;nbsp;TPMC1SC = 0x28; &amp;nbsp; // Channel 1 Edge-aligned, High-true&lt;BR /&gt;&amp;nbsp;TPMSC = 0x08; &amp;nbsp; &amp;nbsp; // !Center-aligned, use BUS-clock, divide by 1&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Now for our new project we are using the MC9S08SL8.&lt;BR /&gt;We try and toggle the same PB5 bit and you can see the pin initialize&lt;BR /&gt;however we cannot get an output clock to form.&lt;BR /&gt;Below is the C code used.&lt;BR /&gt;Is there a power down register that we have to enable or a turn clock&lt;BR /&gt;signal on that we cannot find in the datasheet here.&lt;BR /&gt;Any input would be greatly appreciated.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;PTCD_PTCD3 =1; &amp;nbsp; &amp;nbsp;// Port B/1 is POWER LED &amp;nbsp;0 = on&lt;BR /&gt;&amp;nbsp;PTCDD_PTCDD3 = 1; // Set PTB1 as an output&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;PTBD_PTBD2 =0; &amp;nbsp; &amp;nbsp;// Port B/2 is -RESETDSP &amp;nbsp; 0 = -DSP IN RESET&lt;BR /&gt;&amp;nbsp;PTBDD_PTBDD2 = 1; // Set PTB2 as an output &amp;nbsp;put dsp into reset&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;PTBD_PTBD3 =1; &amp;nbsp; &amp;nbsp;// Port B/3 is -DSPPDN &amp;nbsp; &amp;nbsp;1 = POWER ON&lt;BR /&gt;&amp;nbsp;PTBDD_PTBDD3 = 1; // Set PTB3 as an output&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;PTBD_PTBD4 =1; &amp;nbsp; &amp;nbsp;// Port B/4 is -ENCLASSD SET OFF 0= AMP ON&lt;BR /&gt;&amp;nbsp;PTBDD_PTBDD4 = 1; // Set PTB6 as an output&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;//PTBD_PTBD5 =1; &amp;nbsp; &amp;nbsp;// Port B/5&lt;BR /&gt;&amp;nbsp;//PTBDD_PTBDD5 = 1; // Set PTB5 OUTPUT&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;// MAX count = (PWM count * 2) - 1 for 50% duty&lt;BR /&gt;&amp;nbsp;TPM1MODH = 0; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Channel 1 Max count &amp;nbsp;(HIGH)&lt;BR /&gt;&amp;nbsp;TPM1MODL = 135 ; &amp;nbsp; &amp;nbsp;// ""(TPMC1VL *2)-1=50% (LOW)&lt;BR /&gt;&amp;nbsp;TPM1C1VH = 0; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Channel 1 PWM count &amp;nbsp;(HIGH)&lt;BR /&gt;&amp;nbsp;TPM1C1VL = 68; &amp;nbsp; &amp;nbsp; // "" &amp;nbsp; 26 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(LOW)&lt;BR /&gt;&amp;nbsp;TPM1C1SC = 0x28; &amp;nbsp; // Channel 1 Edge-aligned, High-true OK&lt;BR /&gt;&amp;nbsp;TPM1SC = 0x08; &amp;nbsp; &amp;nbsp; // BUS-clock ,divide by 1&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jun 2010 23:26:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/PWM-question-for-HCS08-series/m-p/207166#M17543</guid>
      <dc:creator>BogieBen</dc:creator>
      <dc:date>2010-06-16T23:26:40Z</dc:date>
    </item>
    <item>
      <title>Re: PWM question for HCS08 series</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/PWM-question-for-HCS08-series/m-p/207167#M17544</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'll assume you&amp;nbsp;mean the one that works is an S08QG8.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wonder if this is a difference between TPM v2 and TPM v3.&lt;/P&gt;&lt;P&gt;QG8 is a V2 TPM&lt;/P&gt;&lt;P&gt;The SL8 reference manual TPM chapter heading says the timer is V2 but then talks about the differences between V2 and V3 at the end of the chapter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;V3 has a difference in the latching mechanisms for the joined bytes&amp;nbsp;of channel and modulo registers. I wonder if it has anything to do with this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;In your SL8 code, I&amp;nbsp;wonder if the "coherency" mechanism is being reset by writing the status and control register right after writing the channel&amp;nbsp;registers.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the notes for the V3 TPM, they suggest that maybe you should write the channel registers and then read them in a while loop comparing them to the expected values until the&amp;nbsp;compare read&amp;nbsp;proves they've been updated. Then you could write your Status and Control registers.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;JD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jun 2010 15:56:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/PWM-question-for-HCS08-series/m-p/207167#M17544</guid>
      <dc:creator>ThaManJD</dc:creator>
      <dc:date>2010-06-21T15:56:31Z</dc:date>
    </item>
    <item>
      <title>Re: PWM question for HCS08 series</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/PWM-question-for-HCS08-series/m-p/207168#M17545</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;JD,&lt;/P&gt;&lt;P&gt;That was it .... thank you very much for the point in the right direction.&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Ben&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jun 2010 23:22:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/PWM-question-for-HCS08-series/m-p/207168#M17545</guid>
      <dc:creator>BogieBen</dc:creator>
      <dc:date>2010-06-21T23:22:00Z</dc:date>
    </item>
  </channel>
</rss>

