<?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: S08MP16 FTM,Stop3 Help</title>
    <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/S08MP16-FTM-Stop3-Help/m-p/355681#M1717</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Carlos,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, it hard use the project of PE to no-PE project,&amp;nbsp; I meaning you can do like this :&lt;/P&gt;&lt;P&gt;According your need create a PE project , it is simple and need little time only configurate the init .&lt;/P&gt;&lt;P&gt;Then refer to the generate code write your own project .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Alice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Dec 2014 10:30:50 GMT</pubDate>
    <dc:creator>Alice_Yang</dc:creator>
    <dc:date>2014-12-17T10:30:50Z</dc:date>
    <item>
      <title>S08MP16 FTM,Stop3 Help</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/S08MP16-FTM-Stop3-Help/m-p/355678#M1714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Dears&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working with S08 microprocesor&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the next code lines, I'm trying to following the RM but its hard for me.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need use stop mode (stop3) and then wake up via reset.&amp;nbsp; I'm not sure if the Internal reference clock is 50Mhz or is 25Mhz&lt;/P&gt;&lt;P&gt;Use a PWM at 60Hz for set a intensity to a led&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="c++" name="code"&gt;#define OVFCOUNT 50 extern unsigned char count = OVFCOUNT; //number of Timer Overflows before increasing the pulse-width&amp;nbsp;&amp;nbsp; extern unsigned char updown = OVFCOUNT;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //0 for up, 1 for down&amp;nbsp;&amp;nbsp; void MCU_Init(void) &amp;nbsp; { &amp;nbsp; //Crucial (Stop mode configuration) &amp;nbsp; SOPT1=0x20; //STOPE=1 to SOPT1 register to enable stop instruction &amp;nbsp; SPMSC1=0x0; //Set to STOP3 without LVD and BDM modes, see table 3.1 on reference manual for more information //SPMSC2=0x1; //Uncomment this line for set to STOP2. &amp;nbsp; // System Clock Init &amp;nbsp; ICSC1=0x44;&amp;nbsp; //Internal reference selected (50Mhz) &amp;nbsp; ICSC2=0xC0;&amp;nbsp; // bus clock&amp;nbsp; to 6.25Mhz (50Mhz/8)&amp;nbsp; &amp;nbsp; } void configureMTIM(void) { &amp;nbsp; //////////////////////////////////////////////////////////////////////////////////// &amp;nbsp; // formula time =((clock divider)*(MTIMMOD register value+1))/BUS clock /// &amp;nbsp; ////////////////////////////////////////////////////////////////////////////////// &amp;nbsp; MTIMCLK = 0x08;&amp;nbsp; //&amp;nbsp; Bus clock (BUSCLK) witch is 6.25Mhz ,&amp;nbsp; Bus clock 256 divider&amp;nbsp; &amp;nbsp; MTIMMOD = 0x30; /* Count to 48 ,+1 */ &amp;nbsp; //time 2.007 ms , ((bus clock divider)*(MTIMMOD+1))/busclock "bus clock =6.250mhz" }&amp;nbsp; void FTM_Init(void) { &amp;nbsp; //16-bit counter&amp;nbsp; max:65536 so i cant get a 60Hz in this way&amp;nbsp; &amp;nbsp; // TPM clock = BUSCLK = 6.25MHz,channel operate in edge-aligned, Overflow Interrupt Enabled &amp;nbsp; FTM1SC = FTM1SC_CLKSA_MASK | FTM1SC_TOIE_MASK;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; //PWM frequency = 60 Hz &amp;nbsp; FTM1MOD = 375000000;&amp;nbsp; // TPMclock/TPMxMOD = 6.25MHz/375000000= 60 Hz&amp;nbsp; &amp;nbsp; // Configure channel 0 to PWM mode (high-true pulses)&amp;nbsp;&amp;nbsp; &amp;nbsp; FTM1C0SC = FTM1C0SC_ELS0B_MASK | FTM1C0SC_MS0B_MASK;&amp;nbsp; &amp;nbsp; // Pulse Width &amp;nbsp; FTM1C0V = 187500000; // PMxMOD/TPMxCnV = 375000000/187500000, channel 0 set to 50% } interrupt VectorNumber_Vftm1ovf void FTM1ovfISR (void) { &amp;nbsp; // The same problem un FTM_Init cause the 16-bit counter &amp;nbsp; //Clear interrupt flag &amp;nbsp; (void)FTM1SC; &amp;nbsp; FTM1SC_TOF = 0; &amp;nbsp;&amp;nbsp; &amp;nbsp; count--; &amp;nbsp; if (!count) &amp;nbsp; {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if (!updown) //up counting &amp;nbsp;&amp;nbsp;&amp;nbsp; { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FTM1C0V += 3750000; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (FTM1C0V == 371250000) updown = 1; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //when reaching 99%, change to down counting &amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; else&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FTM1C0V -= 3750000; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (FTM1C0V == 3750000) updown = 0; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //when reaching 1%, change to up counting &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; count = OVF_COUNTS;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; } }&amp;nbsp;&amp;nbsp; }&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I really appreciate your time, thanks for the help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Dec 2014 19:12:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/S08MP16-FTM-Stop3-Help/m-p/355678#M1714</guid>
      <dc:creator>carlosomarharoc</dc:creator>
      <dc:date>2014-12-16T19:12:00Z</dc:date>
    </item>
    <item>
      <title>Re: S08MP16 FTM,Stop3 Help</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/S08MP16-FTM-Stop3-Help/m-p/355679#M1715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Carlos,&lt;/P&gt;&lt;P&gt;If you not sure how configurate the clock and how to initialize ,you can firstly use the Processor Expert configuration , and there also have "help component "can check the meaning of the related compenet. &lt;/P&gt;&lt;P&gt;&amp;nbsp; it is convenient . It is configurate like this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The CPU clock select :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/48395i180CE418F4951C1D/image-size/large?v=v2&amp;amp;px=999" role="button" title="1.png" alt="1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The FTM clock configuration :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/48396i31C55444BD848452/image-size/large?v=v2&amp;amp;px=999" role="button" title="2.png" alt="2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'inherit','serif'; color: #3d3d3d;"&gt;Best Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'inherit','serif'; color: #3d3d3d;"&gt;Alice&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'inherit','serif'; color: #3d3d3d;"&gt;------------------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'inherit','serif'; color: #3d3d3d;"&gt;If this post answers your question, please click the Correct Answer button. &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Dec 2014 02:51:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/S08MP16-FTM-Stop3-Help/m-p/355679#M1715</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2014-12-17T02:51:36Z</dc:date>
    </item>
    <item>
      <title>Re: S08MP16 FTM,Stop3 Help</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/S08MP16-FTM-Stop3-Help/m-p/355680#M1716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp; dear Alice&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good answer but... I'm need do the code like a library it will be use in another project, the Microprocesor that I use will be come a slave. In master microprocesor aren't in procesor expert.&lt;/P&gt;&lt;P&gt;I dont know if using procesor expert will works in the project without PEx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Dec 2014 03:08:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/S08MP16-FTM-Stop3-Help/m-p/355680#M1716</guid>
      <dc:creator>carlosomarharoc</dc:creator>
      <dc:date>2014-12-17T03:08:19Z</dc:date>
    </item>
    <item>
      <title>Re: S08MP16 FTM,Stop3 Help</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/S08MP16-FTM-Stop3-Help/m-p/355681#M1717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Carlos,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, it hard use the project of PE to no-PE project,&amp;nbsp; I meaning you can do like this :&lt;/P&gt;&lt;P&gt;According your need create a PE project , it is simple and need little time only configurate the init .&lt;/P&gt;&lt;P&gt;Then refer to the generate code write your own project .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Alice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Dec 2014 10:30:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/S08MP16-FTM-Stop3-Help/m-p/355681#M1717</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2014-12-17T10:30:50Z</dc:date>
    </item>
    <item>
      <title>Re: S08MP16 FTM,Stop3 Help</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/S08MP16-FTM-Stop3-Help/m-p/355682#M1718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh&amp;nbsp;&amp;nbsp; I see &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I never thought that way,&amp;nbsp; thanks&amp;nbsp; Alice!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Dec 2014 14:15:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/S08MP16-FTM-Stop3-Help/m-p/355682#M1718</guid>
      <dc:creator>carlosomarharoc</dc:creator>
      <dc:date>2014-12-17T14:15:37Z</dc:date>
    </item>
  </channel>
</rss>

