<?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: System Timer  in Kinetis Design Studio</title>
    <link>https://community.nxp.com/t5/Kinetis-Design-Studio/System-Timer/m-p/444416#M4258</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;OK，&amp;nbsp; it is the same with PTD5, please change to&amp;nbsp; this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void InitLED(void)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; SIM-&amp;gt;SCGC5=SIM_SCGC5_PORTD_MASK;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; PORTD-&amp;gt;PCR[5]=(0|PORT_PCR_MUX(1));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; GPIOD_PDDR |= GPIO_PDDR_PDD(0x20);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; GPIOD_PDOR &amp;amp;= (uint32_t)~(uint32_t)(GPIO_PDOR_PDO(0x20));&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have test on my side , the LED can light !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps&lt;/P&gt;&lt;P&gt;Alice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 01 Jul 2015 07:19:25 GMT</pubDate>
    <dc:creator>Alice_Yang</dc:creator>
    <dc:date>2015-07-01T07:19:25Z</dc:date>
    <item>
      <title>System Timer</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/System-Timer/m-p/444413#M4255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have written the following code to undergo dump debugging.The idea is to store the value of time and the PDOR register value in array.&lt;/P&gt;&lt;P&gt;#include "MKL46Z4.h"&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; // Device header&lt;/P&gt;&lt;P&gt;void InitLED(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; SIM-&amp;gt;SCGC5=SIM_SCGC5_PORTD_MASK;// Enable clock to PORTD&lt;/P&gt;&lt;P&gt;&amp;nbsp; PORTD-&amp;gt;PCR[5]=256;// Set pin 5 of PORTD as GPIO&lt;/P&gt;&lt;P&gt;&amp;nbsp; PTD-&amp;gt;PDDR=(1u&amp;lt;&amp;lt;5);// Set pin 5 of PORTD as OUTPUT&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;void InitSYSTICK(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; SysTick-&amp;gt;CTRL=0;//Disable the systick timer&lt;/P&gt;&lt;P&gt;&amp;nbsp; SysTick-&amp;gt;LOAD=0x00FFFFFF;//Reload it to its full value 24 bits&lt;/P&gt;&lt;P&gt;&amp;nbsp; SysTick-&amp;gt;VAL=0;//Write something in current register to clear it&lt;/P&gt;&lt;P&gt;&amp;nbsp; SysTick-&amp;gt;CTRL=0x00000050;//010&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;int main()&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; unsigned long time[50];&lt;/P&gt;&lt;P&gt;&amp;nbsp; unsigned long data[50];&lt;/P&gt;&lt;P&gt;&amp;nbsp; unsigned long i=0,now=0,last=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp; InitLED();&lt;/P&gt;&lt;P&gt;&amp;nbsp; InitSYSTICK();&lt;/P&gt;&lt;P&gt;&amp;nbsp; last=SysTick-&amp;gt;VAL;&lt;/P&gt;&lt;P&gt;&amp;nbsp; while(1)&lt;/P&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 style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PTD-&amp;gt;PTOR=(1u&amp;lt;&amp;lt;5);//Toggle LED&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(i&amp;lt;50)&lt;/P&gt;&lt;P&gt;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp; now=SysTick-&amp;gt;VAL;&lt;/P&gt;&lt;P&gt;&amp;nbsp; time[i]=(last-now)&amp;amp;0x00FFFFFF;&lt;/P&gt;&lt;P&gt;&amp;nbsp; data[i]=PTD-&amp;gt;PDOR;&lt;/P&gt;&lt;P&gt;&amp;nbsp; last=now;&lt;/P&gt;&lt;P&gt;&amp;nbsp; i++;&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; for(i=0;i&amp;lt;=800000;i++)&lt;/P&gt;&lt;P&gt;&amp;nbsp; {}&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;Led is not blinking.Code is compiling.I dont know if i am write in using the systick timer code syntax and the line data[i]=PTD-&amp;gt;PDOR;&lt;/P&gt;&lt;P&gt;Please help me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jun 2015 16:15:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/System-Timer/m-p/444413#M4255</guid>
      <dc:creator>rohananand</dc:creator>
      <dc:date>2015-06-30T16:15:38Z</dc:date>
    </item>
    <item>
      <title>Re: System Timer</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/System-Timer/m-p/444414#M4256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Rohan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check the pin for LED, are sure is PTD5 ?&lt;/P&gt;&lt;P&gt;I think it isn't . Does you use FRDM-KL46 board, if yes , the pin is PTE29 .( Please pay attention to D5 on SCH is not the port PTD 5 )&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_0.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/61108iB81B71A6ABF0AF02/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_0.png" alt="pastedImage_0.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/61109iB416A5637F38C541/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So you can configuration as this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void InitLED(void)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; SIM-&amp;gt;SCGC5=SIM_SCGC5_PORTE_MASK;// Enable clock to PORTE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; PORTE-&amp;gt;PCR[29]=(0|PORT_PCR_MUX(1));// Set pin 29 of PORTE as GPIO&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; GPIOE_PDDR |= GPIO_PDDR_PDD(0x20000000);// Set pin 29 of PORTE as OUTPUT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; GPIOE_PDOR &amp;amp;= (uint32_t)~(uint32_t)(GPIO_PDOR_PDO(0x20000000));&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have test it on my side about this code , it can light the LED .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps&lt;/P&gt;&lt;P&gt;Alice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2015 05:41:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/System-Timer/m-p/444414#M4256</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2015-07-01T05:41:52Z</dc:date>
    </item>
    <item>
      <title>Re: System Timer</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/System-Timer/m-p/444415#M4257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using the green led i.e on pin PTD5.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2015 06:53:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/System-Timer/m-p/444415#M4257</guid>
      <dc:creator>rohananand</dc:creator>
      <dc:date>2015-07-01T06:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: System Timer</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/System-Timer/m-p/444416#M4258</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;OK，&amp;nbsp; it is the same with PTD5, please change to&amp;nbsp; this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void InitLED(void)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; SIM-&amp;gt;SCGC5=SIM_SCGC5_PORTD_MASK;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; PORTD-&amp;gt;PCR[5]=(0|PORT_PCR_MUX(1));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; GPIOD_PDDR |= GPIO_PDDR_PDD(0x20);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; GPIOD_PDOR &amp;amp;= (uint32_t)~(uint32_t)(GPIO_PDOR_PDO(0x20));&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have test on my side , the LED can light !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps&lt;/P&gt;&lt;P&gt;Alice&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2015 07:19:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/System-Timer/m-p/444416#M4258</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2015-07-01T07:19:25Z</dc:date>
    </item>
    <item>
      <title>Re: System Timer</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/System-Timer/m-p/444417#M4259</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have blinked the led,I wanted to use the system timer to dump values into an array.when i am debugging it is not putting any value in the last and now&amp;nbsp; variable and also it is not stepiing over the line data[i]=PTD-&amp;gt;PDOR. I dont know what is wrong with the code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2015 07:24:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/System-Timer/m-p/444417#M4259</guid>
      <dc:creator>rohananand</dc:creator>
      <dc:date>2015-07-01T07:24:00Z</dc:date>
    </item>
    <item>
      <title>Re: System Timer</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/System-Timer/m-p/444418#M4260</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have coding error in your while loop. You are using the variable i in two places for two different things. One usage is corrupting the other.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first time through your while (1) loop, you are incrementing i to 1, then your for loop is incrementing it to 800001. So i = 800001 the second time through&amp;nbsp; loop and all following times through the while loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Luckily since i is only &amp;lt;50 the first time you go through the loop, You never try to write data to time[800001] and data[800001]. This would cause a hard fault interrupt.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2015 14:43:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/System-Timer/m-p/444418#M4260</guid>
      <dc:creator>ndavies</dc:creator>
      <dc:date>2015-07-01T14:43:29Z</dc:date>
    </item>
    <item>
      <title>Re: System Timer</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/System-Timer/m-p/444419#M4261</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is also going to HardFault_Handler.Please Help.&lt;/P&gt;&lt;P&gt;#include "MKL46Z4.h"&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; // Device header&lt;/P&gt;&lt;P&gt;void InitLED(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; SIM-&amp;gt;SCGC5=SIM_SCGC5_PORTD_MASK;// Enable clock to PORTD&lt;/P&gt;&lt;P&gt;&amp;nbsp; PORTD-&amp;gt;PCR[5]=256;// Set pin 5 of PORTD as GPIO&lt;/P&gt;&lt;P&gt;&amp;nbsp; PTD-&amp;gt;PDDR=(1u&amp;lt;&amp;lt;5);// Set pin 5 of PORTD as OUTPUT&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;void InitSYSTICK(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; SysTick-&amp;gt;CTRL=0;//Disable the systick timer&lt;/P&gt;&lt;P&gt;&amp;nbsp; SysTick-&amp;gt;LOAD=0x00FFFFFF;//Reload it to its full value 24 bits&lt;/P&gt;&lt;P&gt;&amp;nbsp; SysTick-&amp;gt;VAL=0;//Write something in current register to clear it&lt;/P&gt;&lt;P&gt;&amp;nbsp; SysTick-&amp;gt;CTRL=0x00000005;//101&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;int main()&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; unsigned long time[50];&lt;/P&gt;&lt;P&gt;&amp;nbsp; unsigned long data[50];&lt;/P&gt;&lt;P&gt;&amp;nbsp; unsigned long i=0,now=0,last=0,j=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp; InitLED();&lt;/P&gt;&lt;P&gt;&amp;nbsp; InitSYSTICK();&lt;/P&gt;&lt;P&gt;&amp;nbsp; last=SysTick-&amp;gt;VAL;&lt;/P&gt;&lt;P&gt;&amp;nbsp; while(1)&lt;/P&gt;&lt;P&gt;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PTD-&amp;gt;PTOR=(1u&amp;lt;&amp;lt;5);//Toggle LED&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(i&amp;lt;50)&lt;/P&gt;&lt;P&gt;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp; now=SysTick-&amp;gt;VAL;&lt;/P&gt;&lt;P&gt;&amp;nbsp; time[i]=(last-now);&lt;/P&gt;&lt;P&gt;&amp;nbsp; data[i]=PTD-&amp;gt;PDOR;&lt;/P&gt;&lt;P&gt;&amp;nbsp; last=now;&lt;/P&gt;&lt;P&gt;&amp;nbsp; i++;&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; for(j=0;j&amp;lt;=800000;j++)&lt;/P&gt;&lt;P&gt;&amp;nbsp; {}&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2015 15:46:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/System-Timer/m-p/444419#M4261</guid>
      <dc:creator>rohananand</dc:creator>
      <dc:date>2015-07-01T15:46:33Z</dc:date>
    </item>
  </channel>
</rss>

