<?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: PIT TIMER IS NOT WORKING with ADC and RTC ||  MPC5748G || S32DS in MPC5xxx</title>
    <link>https://community.nxp.com/t5/MPC5xxx/PIT-TIMER-IS-NOT-WORKING-with-ADC-and-RTC-MPC5748G-S32DS/m-p/1270812#M18148</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;I am trying to configure PIT timer to take ADC and RTC reading in every 5 second. But it is never coming to PIT handler to turn on flag as one, so that it will enter into loop and takes the reading. I can't understand where it is going wrong.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Could you please specify what you want to achieve closer?&lt;/P&gt;
&lt;P&gt;Do you want to trigger PIT interrupt handler? Which will then serve ADC or RTC?&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Peter&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 30 Apr 2021 10:58:13 GMT</pubDate>
    <dc:creator>petervlna</dc:creator>
    <dc:date>2021-04-30T10:58:13Z</dc:date>
    <item>
      <title>PIT TIMER IS NOT WORKING with ADC and RTC ||  MPC5748G || S32DS</title>
      <link>https://community.nxp.com/t5/MPC5xxx/PIT-TIMER-IS-NOT-WORKING-with-ADC-and-RTC-MPC5748G-S32DS/m-p/1270248#M18141</link>
      <description>&lt;P&gt;I am trying to configure PIT timer to take ADC and RTC reading in every 5 second. But it is never coming to PIT handler to turn on flag as one, so that it will enter into loop and takes the reading. I can't understand where it is going wrong.&lt;/P&gt;&lt;P&gt;For configuring PIT, what I provided is listed below.&lt;/P&gt;&lt;P&gt;/*initialize clocks*/&lt;/P&gt;&lt;P&gt;CLOCK_DRV_Init(&amp;amp;clockMan1_InitConfig0);&lt;/P&gt;&lt;P&gt;/* Install PIT ch0 handler*/&lt;BR /&gt;INT_SYS_InstallHandler(PIT_Ch0_IRQn, &amp;amp;pitCh0Handler, NULL);&lt;/P&gt;&lt;P&gt;/* Initialize the timer module*/&lt;BR /&gt;PIT_DRV_Init(INST_PIT1, &amp;amp;pit1_InitConfig);&lt;/P&gt;&lt;P&gt;/* Initialize the timer channel 0*/&lt;BR /&gt;PIT_DRV_InitChannel(INST_PIT1, &amp;amp;pit1_ChnConfig1);&lt;/P&gt;&lt;P&gt;/* Start the counter for channel 0*/&lt;BR /&gt;PIT_DRV_StartChannel(INST_PIT1, 0U);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="priya_p_0-1619689767961.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/143630iD63A913A200BCB0C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="priya_p_0-1619689767961.png" alt="priya_p_0-1619689767961.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Note: I am using MPC5748G DevKit.&lt;/P&gt;&lt;P&gt;I am attaching the project and the screenshot of pit component Inspector. Please help me.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 09:56:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/PIT-TIMER-IS-NOT-WORKING-with-ADC-and-RTC-MPC5748G-S32DS/m-p/1270248#M18141</guid>
      <dc:creator>priya_p</dc:creator>
      <dc:date>2021-04-29T09:56:31Z</dc:date>
    </item>
    <item>
      <title>Re: PIT TIMER IS NOT WORKING with ADC and RTC ||  MPC5748G || S32DS</title>
      <link>https://community.nxp.com/t5/MPC5xxx/PIT-TIMER-IS-NOT-WORKING-with-ADC-and-RTC-MPC5748G-S32DS/m-p/1270812#M18148</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;I am trying to configure PIT timer to take ADC and RTC reading in every 5 second. But it is never coming to PIT handler to turn on flag as one, so that it will enter into loop and takes the reading. I can't understand where it is going wrong.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Could you please specify what you want to achieve closer?&lt;/P&gt;
&lt;P&gt;Do you want to trigger PIT interrupt handler? Which will then serve ADC or RTC?&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Peter&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Apr 2021 10:58:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/PIT-TIMER-IS-NOT-WORKING-with-ADC-and-RTC-MPC5748G-S32DS/m-p/1270812#M18148</guid>
      <dc:creator>petervlna</dc:creator>
      <dc:date>2021-04-30T10:58:13Z</dc:date>
    </item>
    <item>
      <title>Re: PIT TIMER IS NOT WORKING with ADC and RTC ||  MPC5748G || S32DS</title>
      <link>https://community.nxp.com/t5/MPC5xxx/PIT-TIMER-IS-NOT-WORKING-with-ADC-and-RTC-MPC5748G-S32DS/m-p/1270815#M18149</link>
      <description>&lt;P&gt;I need PIT to run the program and take the readings in every 5 seconds.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PIT HANDLER&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;//TURN FLAG =1&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;int main()&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;while(1)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;IF(FLAG==1)&amp;nbsp; // in every 5 second it goes to interrupt handler and make flag as one.&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;//TAKE ADC READING&lt;/P&gt;&lt;P&gt;//GET TIMESTAMP FROM RTC&lt;/P&gt;&lt;P&gt;// WRITE IT TO EEPROM&lt;/P&gt;&lt;P&gt;//make flag=0&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;&lt;/P&gt;&lt;P&gt;But it is not at all going to PIT handler to turn the flag as one. I don't know where I did wrong.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Apr 2021 11:13:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/PIT-TIMER-IS-NOT-WORKING-with-ADC-and-RTC-MPC5748G-S32DS/m-p/1270815#M18149</guid>
      <dc:creator>priya_p</dc:creator>
      <dc:date>2021-04-30T11:13:44Z</dc:date>
    </item>
    <item>
      <title>Re: PIT TIMER IS NOT WORKING with ADC and RTC ||  MPC5748G || S32DS</title>
      <link>https://community.nxp.com/t5/MPC5xxx/PIT-TIMER-IS-NOT-WORKING-with-ADC-and-RTC-MPC5748G-S32DS/m-p/1271174#M18154</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Lets make sure we both understand what you want to achieve.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;I need PIT to run the program and take the readings in every 5 seconds.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;PIT is a simple timer and it cant run any program. I guess you are referring to PIT interrupt (IVOR4) where the routine should be executed by core.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;But it is not at all going to PIT handler to turn the flag as one. I don't know where I did wrong.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;First make sure your PIT is configured to trigger interrupt. You will see TIF flag set on PIT timeout.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="petervlna_0-1620025813341.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/143781i89112B799F8DC1E9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="petervlna_0-1620025813341.png" alt="petervlna_0-1620025813341.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Once this is setup, you need to setup INTC controller to process the interrupt from PIT.&lt;/P&gt;
&lt;P&gt;Set priority:&lt;/P&gt;
&lt;P&gt;// assing required peripheral priorities and core which will process interrupt (in this case there is only one core)&lt;BR /&gt;INTC_0.PSR[226].R = 0x8001; // PIT0&lt;/P&gt;
&lt;P&gt;Enable external interrupts in core&amp;nbsp; by MSR [EE].&lt;/P&gt;
&lt;P&gt;Once all is set you will get into IVOR4 once PIT timeout occurs.&lt;/P&gt;
&lt;P&gt;You further need to set up interrupt vector table and interrupt handler.&lt;/P&gt;
&lt;P&gt;Please have a look at example SW I have posted where it is demonstrated:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.nxp.com/t5/MPC5xxx-Knowledge-Base/Example-MPC5744P-PIT-triggering-interrupts/ta-p/1102928" target="_blank"&gt;https://community.nxp.com/t5/MPC5xxx-Knowledge-Base/Example-MPC5744P-PIT-triggering-interrupts/ta-p/1102928&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Peter&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 May 2021 07:17:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/PIT-TIMER-IS-NOT-WORKING-with-ADC-and-RTC-MPC5748G-S32DS/m-p/1271174#M18154</guid>
      <dc:creator>petervlna</dc:creator>
      <dc:date>2021-05-03T07:17:41Z</dc:date>
    </item>
  </channel>
</rss>

