<?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: Problem with code for KL25Z32VFM4 PWM and wake up timer in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problem-with-code-for-KL25Z32VFM4-PWM-and-wake-up-timer/m-p/315595#M13828</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am checking the code of both project and I found some difference that probably are causing what you reporting. Check the image below the code shown in the left side correspond to the 32pin and in the right to the 80pin.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="CPUc difference.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/43857iB5DCFDD4D53A1A9E/image-size/large?v=v2&amp;amp;px=999" role="button" title="CPUc difference.png" alt="CPUc difference.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;In the LLWU Module Enable register (LLWU_ME) the field WUME0:&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LLWU_ME &amp;amp;= ~LLWU_ME_WUME0_MASK this is WUME0 = 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WUME0 = 0 --&amp;gt; Internal module flag not used as wakeup source&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WUME0 = 1 --&amp;gt; Internal module flag used as wakeup source&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;In the Power Mode Protection register (SMC_PMPROT) the field AVLLS&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; by default the value is 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AVLLS = 0 --&amp;gt; Any VLLSx mode is not allowed&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AVLLS = 1 --&amp;gt;Any VLLSx mode is allowed&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The with the values in the 32pin code VLLSx modes are not allowed and another module's flag cannot be the wakeup source. You need to change this register in the component inspector of the CPU: click on the component CPU:MKL25Z32VFM4&amp;gt;click Advanced in the upper right corner&amp;gt; got to the values the image below shows&amp;gt; Enable Very Low Leakage stop mode &amp;gt; enable internal module 0 (LPTMR0) &amp;gt; Create processor expert code &amp;gt; Compile project&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="component inspector enable wakeup.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/44301iB80EA0336DF62E11/image-size/large?v=v2&amp;amp;px=999" role="button" title="component inspector enable wakeup.png" alt="component inspector enable wakeup.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this information can help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;Note: If this post answers your question, please click the Correct Answer button. It would be nice!&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Jun 2014 17:29:07 GMT</pubDate>
    <dc:creator>adriancano</dc:creator>
    <dc:date>2014-06-06T17:29:07Z</dc:date>
    <item>
      <title>Problem with code for KL25Z32VFM4 PWM and wake up timer</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problem-with-code-for-KL25Z32VFM4-PWM-and-wake-up-timer/m-p/315594#M13827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Hello All,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;I am working with code worrier 10.3.&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;I have created code using processor expert.&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;In my code there are 3 configuration settings&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Config 0- PEE mode (External Crystal)&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Config 1 –FEE mode (Internal crystal)&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Config 2 – BLPI mode (Internal crystal)&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;But I have written code for PWM, Wake up timer by myself (from reference of processor expert generated code for PWM and wake up timer)&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;I am using Wake up timer to wake up from LLS mode.&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Also PWM to generate pulses at PTB0 pin&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;All above setting I have done for FRDM KL25Z128VLK4 Controller.&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;And it’s working Fine. I can wake up from LLS mode and Pulses are there at PTB0 pin.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Now I want to use KL25Z32VFM4. I have made all above same setting for this controller.&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;I have checked LED blinking, UART and Timer 2 (Code is same as that of KL25Z128VLK4) with this controller. Its working.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Before building the program need to update” vector.c” as&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;1)Need to add hex file of LPTMR interrupt and need to call TMR_IRQ_handler&amp;nbsp; from Vector table.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;OL style="list-style-type: upper-roman;"&gt;&lt;LI&gt;But Code for PWM at pin PTB0 And wake up timer To wake up from LLS mode is Not working with this KL25Z32VFM4.&lt;/LI&gt;&lt;/OL&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;I have attached both the codes.&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;“Test_Code_KL25Z80pin” – Code for KL25Z128VLK4 –its working.&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;“Test_Code_KL25Z80pin” – Code for KL25Z32VFM4 – its not working.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;OL style="list-style-type: upper-roman;"&gt;&lt;LI&gt;In code for KL25Z32VFM4 before executing main application of mine it is going into hard Fault.&lt;/LI&gt;&lt;/OL&gt;&lt;P style="margin-left: .75in; margin-bottom: .0001pt;"&gt;It is going into hard fault at the definition of PORT D pin&amp;nbsp; PTD 4 which I am using as a LLWU pin to wake up from Low power mode.&lt;/P&gt;&lt;P style="margin-left: .75in; margin-bottom: .0001pt;"&gt;To overcome out off this I added a line in “ CPU.c “ file as &lt;/P&gt;&lt;P style="margin-left: .75in; margin-bottom: .0001pt;"&gt;SIM_SCGC5 |= SIM_SCGC5_PORTD_MASK; before PTD4 mux setting in “ PE_low_level_init” function.&lt;/P&gt;&lt;P style="margin-left: .75in; margin-bottom: .0001pt;"&gt;And it is working I am not getting why there is a problem as Same setting works fine for KL25Z128 controller.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin-left: .75in; margin-bottom: .0001pt;"&gt;Please help me in these 2 questions guide me where I am getting wrong.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px; margin-left: .75in; margin-bottom: .0001pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;regards,&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;Amreen&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-337392"&gt;Test_Code_KL25Z32pin.rar&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-337392"&gt;Test_Code_KL25Z80pin.rar&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jun 2014 14:24:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problem-with-code-for-KL25Z32VFM4-PWM-and-wake-up-timer/m-p/315594#M13827</guid>
      <dc:creator>Embionics</dc:creator>
      <dc:date>2014-06-06T14:24:08Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with code for KL25Z32VFM4 PWM and wake up timer</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problem-with-code-for-KL25Z32VFM4-PWM-and-wake-up-timer/m-p/315595#M13828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am checking the code of both project and I found some difference that probably are causing what you reporting. Check the image below the code shown in the left side correspond to the 32pin and in the right to the 80pin.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="CPUc difference.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/43857iB5DCFDD4D53A1A9E/image-size/large?v=v2&amp;amp;px=999" role="button" title="CPUc difference.png" alt="CPUc difference.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;In the LLWU Module Enable register (LLWU_ME) the field WUME0:&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LLWU_ME &amp;amp;= ~LLWU_ME_WUME0_MASK this is WUME0 = 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WUME0 = 0 --&amp;gt; Internal module flag not used as wakeup source&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WUME0 = 1 --&amp;gt; Internal module flag used as wakeup source&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;In the Power Mode Protection register (SMC_PMPROT) the field AVLLS&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; by default the value is 0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AVLLS = 0 --&amp;gt; Any VLLSx mode is not allowed&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AVLLS = 1 --&amp;gt;Any VLLSx mode is allowed&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The with the values in the 32pin code VLLSx modes are not allowed and another module's flag cannot be the wakeup source. You need to change this register in the component inspector of the CPU: click on the component CPU:MKL25Z32VFM4&amp;gt;click Advanced in the upper right corner&amp;gt; got to the values the image below shows&amp;gt; Enable Very Low Leakage stop mode &amp;gt; enable internal module 0 (LPTMR0) &amp;gt; Create processor expert code &amp;gt; Compile project&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="component inspector enable wakeup.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/44301iB80EA0336DF62E11/image-size/large?v=v2&amp;amp;px=999" role="button" title="component inspector enable wakeup.png" alt="component inspector enable wakeup.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this information can help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;Note: If this post answers your question, please click the Correct Answer button. It would be nice!&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jun 2014 17:29:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problem-with-code-for-KL25Z32VFM4-PWM-and-wake-up-timer/m-p/315595#M13828</guid>
      <dc:creator>adriancano</dc:creator>
      <dc:date>2014-06-06T17:29:07Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with code for KL25Z32VFM4 PWM and wake up timer</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problem-with-code-for-KL25Z32VFM4-PWM-and-wake-up-timer/m-p/315596#M13829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;STRONG class="font-color-meta"&gt; &lt;SPAN class="replyToName"&gt;Adrian Sanchez Cano&lt;/SPAN&gt; ,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG class="font-color-meta"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;STRONG class="font-color-meta"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I haven't enable my LPTMR in CPU setting that is the reason my wake up timer was not working.&lt;/P&gt;&lt;P&gt;I tried wake up timer without going into LLS mode and it is working.&lt;/P&gt;&lt;P&gt;But when i enable timer and call "Cpu_SetOperationMode(DOM_STOP, NULL, NULL);"&amp;nbsp; for entring into LLS mode.&lt;/P&gt;&lt;P&gt;My wake up timer is not working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also i am not getting reason why my PWM is not working it is not related to low power mode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Amreen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 Jun 2014 09:40:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Problem-with-code-for-KL25Z32VFM4-PWM-and-wake-up-timer/m-p/315596#M13829</guid>
      <dc:creator>Embionics</dc:creator>
      <dc:date>2014-06-07T09:40:06Z</dc:date>
    </item>
  </channel>
</rss>

