<?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>CodeWarrior Development Tools中的主题 Re: HCS08 PWM  DUTY PROBLEM</title>
    <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/HCS08-PWM-DUTY-PROBLEM/m-p/877403#M7470</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Thanks a lot ,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;SPAN style="color: #51626f;"&gt;&amp;nbsp;Am using the&amp;nbsp; software code warrior V6.3 ,&lt;/SPAN&gt; &lt;SPAN style="color: #51626f;"&gt;MC9S08SG8 8 pin package&amp;nbsp; type and here am attach my sample code ,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;&amp;nbsp;this code i have a same problem above mention , 7th pin of controller is pwm am using internal clk.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;and this is my code .&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/* Including needed modules to compile this module/procedure */&lt;BR /&gt;#include "Cpu.h"&lt;BR /&gt;#include "Events.h"&lt;BR /&gt;#include "PWM1.h"&lt;BR /&gt;/* Include shared modules, which are used for whole project */&lt;BR /&gt;#include "PE_Types.h"&lt;BR /&gt;#include "PE_Error.h"&lt;BR /&gt;#include "PE_Const.h"&lt;BR /&gt;#include "IO_Map.h"&lt;/P&gt;&lt;P&gt;unsigned int ADC_RESULT_TOTAL,ADC_RESULT[10],adc_value;&lt;BR /&gt;char a,b;&lt;BR /&gt;unsigned int ADC();&lt;BR /&gt;/* User includes (#include below this line is not maintained by Processor Expert) */&lt;/P&gt;&lt;P&gt;void main(void)&lt;BR /&gt;{&lt;BR /&gt; /* Write your local variable definition here */&lt;/P&gt;&lt;P&gt;/*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/&lt;BR /&gt; PE_low_level_init();&lt;BR /&gt; /*** End of Processor Expert internal initialization. ***/&lt;/P&gt;&lt;P&gt;/* Write your code here */&lt;BR /&gt; /* For example: for(;;) { } */&lt;BR /&gt; PWM1_Disable(); &lt;BR /&gt; PWM1_ClrValue();&lt;BR /&gt; Cpu_Delay100US(1000);&lt;BR /&gt; for(;;) &lt;BR /&gt; {&lt;BR /&gt; &lt;BR /&gt; setReg16(TPM2MOD, 4076);// period for 407Hz&lt;BR /&gt; TPM2C0V =3057; // 75% duty cycle&lt;BR /&gt; PWM1_Enable(); // enable the pwm&lt;BR /&gt; Cpu_Delay100US(5000); // delay for 50msec &lt;BR /&gt; PWM1_Disable(); // disable the pwm &lt;BR /&gt; Cpu_Delay100US(5000);&lt;BR /&gt; &lt;BR /&gt; } &lt;/P&gt;&lt;P&gt;&lt;BR /&gt; /*** Don't write any code pass this line, or it will be deleted during code generation. ***/&lt;BR /&gt; /*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/&lt;BR /&gt; for(;;){}&lt;BR /&gt; /*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/&lt;BR /&gt;}&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Mar 2019 06:29:51 GMT</pubDate>
    <dc:creator>venkateshgv</dc:creator>
    <dc:date>2019-03-14T06:29:51Z</dc:date>
    <item>
      <title>HCS08 PWM  DUTY PROBLEM</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/HCS08-PWM-DUTY-PROBLEM/m-p/877399#M7466</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hai,&lt;/P&gt;&lt;P&gt;&amp;nbsp;Am using&amp;nbsp; MC9S08SG8 micro controller ,and am using code warrior V6.3&amp;nbsp; software ,here am using PWM in 7th pin ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;my problem is in&amp;nbsp; output duty cycle&amp;nbsp; first pulse is grater then the other pulse ,like this. plz any one can help me.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Capture.PNG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/67327i6A00B9DBDB120F6A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;Thanks&amp;nbsp; in advance ,&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;karthik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Mar 2019 05:21:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/HCS08-PWM-DUTY-PROBLEM/m-p/877399#M7466</guid>
      <dc:creator>venkateshgv</dc:creator>
      <dc:date>2019-03-08T05:21:07Z</dc:date>
    </item>
    <item>
      <title>Re: HCS08 PWM  DUTY PROBLEM</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/HCS08-PWM-DUTY-PROBLEM/m-p/877400#M7467</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi karthik,&lt;/P&gt;&lt;P&gt;I am not familiar with S08 product.&lt;/P&gt;&lt;P&gt;Have you try to select the counter clock source after written duty cycle?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Robin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Mar 2019 08:08:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/HCS08-PWM-DUTY-PROBLEM/m-p/877400#M7467</guid>
      <dc:creator>Robin_Shen</dc:creator>
      <dc:date>2019-03-11T08:08:21Z</dc:date>
    </item>
    <item>
      <title>Re: HCS08 PWM  DUTY PROBLEM</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/HCS08-PWM-DUTY-PROBLEM/m-p/877401#M7468</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks a lot ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;can u share a PWM example code, in coed warrior ,any micro controller&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Mar 2019 10:30:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/HCS08-PWM-DUTY-PROBLEM/m-p/877401#M7468</guid>
      <dc:creator>venkateshgv</dc:creator>
      <dc:date>2019-03-11T10:30:27Z</dc:date>
    </item>
    <item>
      <title>Re: HCS08 PWM  DUTY PROBLEM</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/HCS08-PWM-DUTY-PROBLEM/m-p/877402#M7469</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please check the following code&lt;/P&gt;&lt;P&gt;void main(void) &lt;BR /&gt;{&lt;BR /&gt;SOPT2 = SOPT2_T1CH1PS_MASK | SOPT2_T1CH0PS_MASK;&lt;BR /&gt;PTBDD_PTBDD6 = 1; //Pin as output&lt;BR /&gt;PTBD_PTBD6 = 0; // PTC1 in Low&lt;BR /&gt; &lt;BR /&gt;PTCDD_PTCDD1 = 1; //Pin as output&lt;BR /&gt;PTCD_PTCD1 = 1; // PTC1 in High&lt;BR /&gt;// TPM clock = BUSCLK = 8MHz,channel operate in edge-aligned, Overflow Interrupt Enabled&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;TPM1SC = 0; &lt;BR /&gt; &lt;BR /&gt;// Configure channel 1 High true pulses Edge aligned &lt;BR /&gt;TPM1C1SC = TPM1C1SC_ELS1B_MASK | TPM1C1SC_MS1B_MASK;&lt;BR /&gt;TPM1C1V = 4000; // channel 1 set to 50%&lt;BR /&gt; &lt;BR /&gt;TPM1SC = TPM1SC_CLKSA_MASK | TPM1SC_TOIE_MASK; &lt;BR /&gt;TPM1MOD = 8000; // PWM frequency is about 1 KH&lt;/P&gt;&lt;P&gt;EnableInterrupts;&lt;BR /&gt; &lt;BR /&gt;for(;;) &lt;BR /&gt;{ &lt;BR /&gt;__RESET_WATCHDOG(); /* feeds the dog */&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;} /* loop forever */&lt;BR /&gt;/* please make sure that you never leave main */&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/**************************************************************************************************/&lt;/P&gt;&lt;P&gt;void interrupt VectorNumber_Vtpm1ovf TPM1ovfISR (void)&lt;BR /&gt;{&lt;BR /&gt;//Clear interrupt flag&lt;BR /&gt;(void)TPM1SC;&lt;BR /&gt;TPM1SC_TOF = 0;&lt;BR /&gt;PTBD_PTBD6 ^= 1;&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/**************************************************************************************************/&lt;/P&gt;&lt;P&gt;This is for the S08SH family&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are using the external clock, maybe you are getting&amp;nbsp;a different time on the first cycle due the clock set up.&lt;/P&gt;&lt;P&gt;I recommend you check the following document&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://www.nxp.com/docs/en/user-guide/HCS08QRUG.pdf" title="https://www.nxp.com/docs/en/user-guide/HCS08QRUG.pdf"&gt;https://www.nxp.com/docs/en/user-guide/HCS08QRUG.pdf&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this will help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Mar 2019 20:37:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/HCS08-PWM-DUTY-PROBLEM/m-p/877402#M7469</guid>
      <dc:creator>vicentegomez</dc:creator>
      <dc:date>2019-03-12T20:37:44Z</dc:date>
    </item>
    <item>
      <title>Re: HCS08 PWM  DUTY PROBLEM</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/HCS08-PWM-DUTY-PROBLEM/m-p/877403#M7470</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Thanks a lot ,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;SPAN style="color: #51626f;"&gt;&amp;nbsp;Am using the&amp;nbsp; software code warrior V6.3 ,&lt;/SPAN&gt; &lt;SPAN style="color: #51626f;"&gt;MC9S08SG8 8 pin package&amp;nbsp; type and here am attach my sample code ,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;&amp;nbsp;this code i have a same problem above mention , 7th pin of controller is pwm am using internal clk.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #51626f; "&gt;and this is my code .&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/* Including needed modules to compile this module/procedure */&lt;BR /&gt;#include "Cpu.h"&lt;BR /&gt;#include "Events.h"&lt;BR /&gt;#include "PWM1.h"&lt;BR /&gt;/* Include shared modules, which are used for whole project */&lt;BR /&gt;#include "PE_Types.h"&lt;BR /&gt;#include "PE_Error.h"&lt;BR /&gt;#include "PE_Const.h"&lt;BR /&gt;#include "IO_Map.h"&lt;/P&gt;&lt;P&gt;unsigned int ADC_RESULT_TOTAL,ADC_RESULT[10],adc_value;&lt;BR /&gt;char a,b;&lt;BR /&gt;unsigned int ADC();&lt;BR /&gt;/* User includes (#include below this line is not maintained by Processor Expert) */&lt;/P&gt;&lt;P&gt;void main(void)&lt;BR /&gt;{&lt;BR /&gt; /* Write your local variable definition here */&lt;/P&gt;&lt;P&gt;/*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/&lt;BR /&gt; PE_low_level_init();&lt;BR /&gt; /*** End of Processor Expert internal initialization. ***/&lt;/P&gt;&lt;P&gt;/* Write your code here */&lt;BR /&gt; /* For example: for(;;) { } */&lt;BR /&gt; PWM1_Disable(); &lt;BR /&gt; PWM1_ClrValue();&lt;BR /&gt; Cpu_Delay100US(1000);&lt;BR /&gt; for(;;) &lt;BR /&gt; {&lt;BR /&gt; &lt;BR /&gt; setReg16(TPM2MOD, 4076);// period for 407Hz&lt;BR /&gt; TPM2C0V =3057; // 75% duty cycle&lt;BR /&gt; PWM1_Enable(); // enable the pwm&lt;BR /&gt; Cpu_Delay100US(5000); // delay for 50msec &lt;BR /&gt; PWM1_Disable(); // disable the pwm &lt;BR /&gt; Cpu_Delay100US(5000);&lt;BR /&gt; &lt;BR /&gt; } &lt;/P&gt;&lt;P&gt;&lt;BR /&gt; /*** Don't write any code pass this line, or it will be deleted during code generation. ***/&lt;BR /&gt; /*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/&lt;BR /&gt; for(;;){}&lt;BR /&gt; /*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/&lt;BR /&gt;}&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Mar 2019 06:29:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/HCS08-PWM-DUTY-PROBLEM/m-p/877403#M7470</guid>
      <dc:creator>venkateshgv</dc:creator>
      <dc:date>2019-03-14T06:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: HCS08 PWM  DUTY PROBLEM</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/HCS08-PWM-DUTY-PROBLEM/m-p/877404#M7471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;please test the code that I send you and tell me if you have the same problem with this code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Mar 2019 20:53:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/HCS08-PWM-DUTY-PROBLEM/m-p/877404#M7471</guid>
      <dc:creator>vicentegomez</dc:creator>
      <dc:date>2019-03-14T20:53:51Z</dc:date>
    </item>
    <item>
      <title>Re: HCS08 PWM  DUTY PROBLEM</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/HCS08-PWM-DUTY-PROBLEM/m-p/877405#M7472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks for u r reply ,i try this code same problem has&amp;nbsp;occuring.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Mar 2019 11:10:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/HCS08-PWM-DUTY-PROBLEM/m-p/877405#M7472</guid>
      <dc:creator>venkateshgv</dc:creator>
      <dc:date>2019-03-26T11:10:30Z</dc:date>
    </item>
    <item>
      <title>Re: HCS08 PWM  DUTY PROBLEM</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/HCS08-PWM-DUTY-PROBLEM/m-p/877406#M7473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In my code, it starts in low, it takes a little&amp;nbsp;bit more, due to the power on set up, but after that, all the pulse are the same&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/72979iBD0D02273AE28232/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Mar 2019 22:05:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/HCS08-PWM-DUTY-PROBLEM/m-p/877406#M7473</guid>
      <dc:creator>vicentegomez</dc:creator>
      <dc:date>2019-03-26T22:05:12Z</dc:date>
    </item>
  </channel>
</rss>

