<?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 timing_pal not working as expected in S32 SDK</title>
    <link>https://community.nxp.com/t5/S32-SDK/timing-pal-not-working-as-expected/m-p/1302930#M2215</link>
    <description>&lt;P&gt;Originally posted in MPC5xxx &lt;LI-MESSAGE title="timing_pal not working as expected" uid="1302492" url="https://community.nxp.com/t5/MPC5xxx/timing-pal-not-working-as-expected/m-p/1302492#U1302492" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt; but maybe fits better in this forum.&lt;/P&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;Working with the DEVKIT-MPC5748G, I am trying to use the timing_pal module to set a call to a function every fixed time interval. However, the timer doesn't seem to be starting.&lt;/P&gt;&lt;P&gt;timing_pal configuration are pretty much all default except for my callback function (which is of course not called). The module is configured to use the PIT clock.&lt;/P&gt;&lt;P&gt;As troubleshooting, I copy-pasted in the example script that comes with the SDK user manual. Timer init function returns OK status. After starting the timer (cyclic), elapsed time always comes back 0.&lt;/P&gt;&lt;P&gt;main.c is:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;/* Write your code here */&lt;BR /&gt;CLOCK_DRV_Init(&amp;amp;clockMan1_InitConfig0);&lt;/P&gt;&lt;P&gt;uint64_t resolution;&lt;BR /&gt;uint32_t elapsedTime;&lt;BR /&gt;/* Initialize TIMING */&lt;BR /&gt;TIMING_Init(&amp;amp;timing_pal1_instance, &amp;amp;timing_pal1_InitConfig);&lt;BR /&gt;/* Get tick resolution in nanosecond */&lt;BR /&gt;TIMING_GetResolution(&amp;amp;timing_pal1_instance, TIMER_RESOLUTION_TYPE_NANOSECOND, &amp;amp;resolution);&lt;BR /&gt;/* Start channel counting with period is 1 second */&lt;BR /&gt;TIMING_StartChannel(&amp;amp;timing_pal1_instance, TIMER_CHANNEL, (TIMER_PERIOD_NANO / resolution));&lt;/P&gt;&lt;P&gt;/* Get elapsed time in ticks */&lt;BR /&gt;elapsedTime = TIMING_GetElapsed(&amp;amp;timing_pal1_instance, TIMER_CHANNEL);&lt;BR /&gt;/* Get elapsed time in nanosecond */&lt;BR /&gt;elapsedTime = elapsedTime * resolution;&lt;/P&gt;&lt;P&gt;printf("ElapsedTime: %d\n", elapsedTime);&lt;/P&gt;&lt;P&gt;/* De-initialize TIMING */&lt;BR /&gt;TIMING_Deinit(&amp;amp;timing_pal1_instance);&lt;/P&gt;&lt;P&gt;Tried different period settings, from a few dozen ticks to the 1-sec equivalent from the sample code. Am I missing something? Am I doing something wrong?&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Chen&lt;/P&gt;</description>
    <pubDate>Tue, 06 Jul 2021 07:23:45 GMT</pubDate>
    <dc:creator>chenk</dc:creator>
    <dc:date>2021-07-06T07:23:45Z</dc:date>
    <item>
      <title>timing_pal not working as expected</title>
      <link>https://community.nxp.com/t5/S32-SDK/timing-pal-not-working-as-expected/m-p/1302930#M2215</link>
      <description>&lt;P&gt;Originally posted in MPC5xxx &lt;LI-MESSAGE title="timing_pal not working as expected" uid="1302492" url="https://community.nxp.com/t5/MPC5xxx/timing-pal-not-working-as-expected/m-p/1302492#U1302492" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt; but maybe fits better in this forum.&lt;/P&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;Working with the DEVKIT-MPC5748G, I am trying to use the timing_pal module to set a call to a function every fixed time interval. However, the timer doesn't seem to be starting.&lt;/P&gt;&lt;P&gt;timing_pal configuration are pretty much all default except for my callback function (which is of course not called). The module is configured to use the PIT clock.&lt;/P&gt;&lt;P&gt;As troubleshooting, I copy-pasted in the example script that comes with the SDK user manual. Timer init function returns OK status. After starting the timer (cyclic), elapsed time always comes back 0.&lt;/P&gt;&lt;P&gt;main.c is:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;/* Write your code here */&lt;BR /&gt;CLOCK_DRV_Init(&amp;amp;clockMan1_InitConfig0);&lt;/P&gt;&lt;P&gt;uint64_t resolution;&lt;BR /&gt;uint32_t elapsedTime;&lt;BR /&gt;/* Initialize TIMING */&lt;BR /&gt;TIMING_Init(&amp;amp;timing_pal1_instance, &amp;amp;timing_pal1_InitConfig);&lt;BR /&gt;/* Get tick resolution in nanosecond */&lt;BR /&gt;TIMING_GetResolution(&amp;amp;timing_pal1_instance, TIMER_RESOLUTION_TYPE_NANOSECOND, &amp;amp;resolution);&lt;BR /&gt;/* Start channel counting with period is 1 second */&lt;BR /&gt;TIMING_StartChannel(&amp;amp;timing_pal1_instance, TIMER_CHANNEL, (TIMER_PERIOD_NANO / resolution));&lt;/P&gt;&lt;P&gt;/* Get elapsed time in ticks */&lt;BR /&gt;elapsedTime = TIMING_GetElapsed(&amp;amp;timing_pal1_instance, TIMER_CHANNEL);&lt;BR /&gt;/* Get elapsed time in nanosecond */&lt;BR /&gt;elapsedTime = elapsedTime * resolution;&lt;/P&gt;&lt;P&gt;printf("ElapsedTime: %d\n", elapsedTime);&lt;/P&gt;&lt;P&gt;/* De-initialize TIMING */&lt;BR /&gt;TIMING_Deinit(&amp;amp;timing_pal1_instance);&lt;/P&gt;&lt;P&gt;Tried different period settings, from a few dozen ticks to the 1-sec equivalent from the sample code. Am I missing something? Am I doing something wrong?&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Chen&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jul 2021 07:23:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-SDK/timing-pal-not-working-as-expected/m-p/1302930#M2215</guid>
      <dc:creator>chenk</dc:creator>
      <dc:date>2021-07-06T07:23:45Z</dc:date>
    </item>
    <item>
      <title>Re: timing_pal not working as expected</title>
      <link>https://community.nxp.com/t5/S32-SDK/timing-pal-not-working-as-expected/m-p/1306137#M2221</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;see my reply in your original post.&lt;/P&gt;
&lt;P&gt;BR, Petr&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jul 2021 12:02:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-SDK/timing-pal-not-working-as-expected/m-p/1306137#M2221</guid>
      <dc:creator>PetrS</dc:creator>
      <dc:date>2021-07-12T12:02:58Z</dc:date>
    </item>
  </channel>
</rss>

