<?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: P1010 Global Timers issues in P-Series</title>
    <link>https://community.nxp.com/t5/P-Series/P1010-Global-Timers-issues/m-p/438475#M2525</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First of all, thanks for your quick answer!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The IVPR/IVORX registers are indeed all pointing at code to handle the specific interrupts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I'm saying the activity bit is "always" set, I mean it only changes to 1 when counting is enabled by setting the PIC_GTBCRXX register.&lt;/P&gt;&lt;P&gt;If I just &lt;SPAN lang="EN-US" style="font-family: 'Arial','sans-serif';"&gt;specify the interrupt priority and set the vector field of the PIC_GTVPRA0/B0 register, &lt;/SPAN&gt;the activity bit remains the same and doesn't change at all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you mentioned previously, I'm reading IACK before putting the PIC into mixed mode. As a consequence, I have tried to do the inverse and it seems to work properly. The timer interruptions cause external interrupts and call the corresponding handlers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Jun 2015 11:16:00 GMT</pubDate>
    <dc:creator>harryjucquois</dc:creator>
    <dc:date>2015-06-10T11:16:00Z</dc:date>
    <item>
      <title>P1010 Global Timers issues</title>
      <link>https://community.nxp.com/t5/P-Series/P1010-Global-Timers-issues/m-p/438471#M2521</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: 'Arial','sans-serif';"&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: 'Arial','sans-serif';"&gt;I’m currently working on an electronic board based on the P1010. I’m trying to use global timers on the P1010 but I have been unable to get A0 and B0 global timers working. Indeed, timer interruptions don't cause external interrupts.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: 'Arial','sans-serif';"&gt;You could find below more explanations about what I have done so far.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: 'Arial','sans-serif';"&gt;Concerning the initialization of the processor, I have set two main things :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL style="list-style-type: disc;"&gt;&lt;LI&gt;&lt;SPAN lang="EN-US" style="font-family: 'Arial','sans-serif';"&gt;Initialize MSR register by setting the MSR[EE] bit to 0 (wrteei&amp;nbsp; 0) &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN lang="EN-US" style="font-family: 'Arial','sans-serif';"&gt;Initialize the IRQ module : &lt;/SPAN&gt;&lt;UL style="list-style-type: circle;"&gt;&lt;LI&gt;&lt;SPAN lang="EN-US" style="font-family: 'Arial','sans-serif';"&gt;Reset PIC writing RST bit to 1&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN lang="EN-US" style="font-family: 'Arial','sans-serif';"&gt;Clear CTPR register&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN lang="EN-US" style="font-family: 'Arial','sans-serif';"&gt;Clear all pending interrupts reading IACK and writing&amp;nbsp; EOI&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN lang="EN-US" style="font-family: 'Arial','sans-serif';"&gt;Set PIC operating mode equals to Mixed mode (interrupts are handled by the normal priority and delivery mechanisms of the PIC)&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN lang="EN-US" style="font-family: 'Arial','sans-serif';"&gt;Enable global interrupts changing MSR[EE] bit to 1 (wrteei&amp;nbsp; 1)&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: 'Arial','sans-serif';"&gt;After having got the timer configuration register reference (CCSRBAR address + 40000h + 1100h for A0 Global timer and CCSRBAR address + 40000h + 2100h for B0 Global timer), I have :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL style="list-style-type: disc;"&gt;&lt;LI&gt;&lt;SPAN lang="EN-US" style="font-family: 'Arial','sans-serif';"&gt;Set internal interrupt destination register to 1 of the PIC_GTDRA0/B0 register in order to direct timer interrupts to processor core&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN lang="EN-US" style="font-family: 'Arial','sans-serif';"&gt;Specified the interrupt priority to 1 and set the vector field of the PIC_GTVPRA0/B0 register&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN lang="EN-US" style="font-family: 'Arial','sans-serif';"&gt;Enabled counting and set the base count of the PIC_GTBCRA0/B0 register&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: 'Arial','sans-serif';"&gt;Before the initialization of the A0 Global timer :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="P1010_Global_Timer_A0_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/30848iA0EF7A5E44CAFEDF/image-size/large?v=v2&amp;amp;px=999" role="button" title="P1010_Global_Timer_A0_1.png" alt="P1010_Global_Timer_A0_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: 'Arial','sans-serif';"&gt;After initialization :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="P1010_Global_Timer_A0_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/30897iEA13472D322C5D7F/image-size/large?v=v2&amp;amp;px=999" role="button" title="P1010_Global_Timer_A0_2.png" alt="P1010_Global_Timer_A0_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: 'Arial','sans-serif';"&gt;At runtime :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="P1010_Global_Timer_A0_3.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/30912i9642CE140B62C885/image-size/large?v=v2&amp;amp;px=999" role="button" title="P1010_Global_Timer_A0_3.png" alt="P1010_Global_Timer_A0_3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: 'Arial','sans-serif';"&gt;The global timers seem to work since I can see the PIC_GTCCRA0 register values decrementing. Reading the P1010 QorIQ Integrated Processor Reference Manual, it mentions that the PIC_GTCCRA0[TOG]&amp;nbsp; is toggled when the current count decrements to zero and cleared when PIC_GTBCRA0[CI] goes from 1 to 0. However, the CI bit is always set to 1 and doesn’t change at all.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: 'Arial','sans-serif';"&gt;Looking at the PIC_GTVPRA0 register, I have noticed that the Activity bit is always set to 1 and interrupt request from the PIC should cause the processor to take an external interrupt, right ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: 'Arial','sans-serif';"&gt;Is there any additional register/step needed to setup and use global timers? Anyone can explain me in details how they work?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: 'Arial','sans-serif';"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jun 2015 14:53:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/P-Series/P1010-Global-Timers-issues/m-p/438471#M2521</guid>
      <dc:creator>harryjucquois</dc:creator>
      <dc:date>2015-06-08T14:53:36Z</dc:date>
    </item>
    <item>
      <title>Re: P1010 Global Timers issues</title>
      <link>https://community.nxp.com/t5/P-Series/P1010-Global-Timers-issues/m-p/438472#M2522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm assuming you have IVPR/IVOR4 pointing at code to handle the interrupt, and that code isn't executing.&amp;nbsp; You said the activity bit is "always" set -- this is from the instant you unmask it?&amp;nbsp; Did you write to any of the timer registers (besides vector/priority and destination) between resetting the MPIC and unmasking the timer interrupt?&amp;nbsp; Was the MPIC used at all before reset?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It looks like you're reading IACK before you put the MPIC into mixed mode, which is bad -- I'm not sure what effect that would have.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jun 2015 20:02:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/P-Series/P1010-Global-Timers-issues/m-p/438472#M2522</guid>
      <dc:creator>scottwood</dc:creator>
      <dc:date>2015-06-08T20:02:45Z</dc:date>
    </item>
    <item>
      <title>Re: P1010 Global Timers issues</title>
      <link>https://community.nxp.com/t5/P-Series/P1010-Global-Timers-issues/m-p/438473#M2523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: 'Times New Roman';"&gt;Look at simple program example for the MPC8555 Global timer. Similar code can be used on the P1010.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jun 2015 03:37:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/P-Series/P1010-Global-Timers-issues/m-p/438473#M2523</guid>
      <dc:creator>Pavel</dc:creator>
      <dc:date>2015-06-09T03:37:37Z</dc:date>
    </item>
    <item>
      <title>Re: P1010 Global Timers issues</title>
      <link>https://community.nxp.com/t5/P-Series/P1010-Global-Timers-issues/m-p/438474#M2524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello HARRY JUCQUOIS,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have valid interrupt routine to service this request?&lt;/P&gt;&lt;P&gt;As you wrote the "Activity" bit is always set, it seems there is interrupt pending on the same source, so the later ones are lost. I guess the two possibilities, one is there is timer interrupt with priority 0 pending there, it may happens when you clear its mask bit and priority is not setting yet; and the second one, there are higher priority interrupts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may try below sequence:&lt;/P&gt;&lt;P&gt;1. Reset PIC;&lt;/P&gt;&lt;P&gt;2. Disable all external interrupt of MSE;&lt;/P&gt;&lt;P&gt;3&amp;nbsp; Set priority and vector of GTVPR (Leave mask bit set);&lt;/P&gt;&lt;P&gt;4. Clear CTPR;&lt;/P&gt;&lt;P&gt;5. Set GCR[M] to be mixed mode;&lt;/P&gt;&lt;P&gt;6. Loop with FRR[NIRQ] to clear all IACK and write EOI;&lt;/P&gt;&lt;P&gt;7. Enable interrupt by GTVPR[MSE];&lt;/P&gt;&lt;P&gt;6. Set CTPR to be required;&lt;/P&gt;&lt;P&gt;7. Enable counting of GTBCR;&lt;/P&gt;&lt;P&gt;8. Enable external interrupt of MSE;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Lunmin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jun 2015 08:54:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/P-Series/P1010-Global-Timers-issues/m-p/438474#M2524</guid>
      <dc:creator>lunminliang</dc:creator>
      <dc:date>2015-06-10T08:54:36Z</dc:date>
    </item>
    <item>
      <title>Re: P1010 Global Timers issues</title>
      <link>https://community.nxp.com/t5/P-Series/P1010-Global-Timers-issues/m-p/438475#M2525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First of all, thanks for your quick answer!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The IVPR/IVORX registers are indeed all pointing at code to handle the specific interrupts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I'm saying the activity bit is "always" set, I mean it only changes to 1 when counting is enabled by setting the PIC_GTBCRXX register.&lt;/P&gt;&lt;P&gt;If I just &lt;SPAN lang="EN-US" style="font-family: 'Arial','sans-serif';"&gt;specify the interrupt priority and set the vector field of the PIC_GTVPRA0/B0 register, &lt;/SPAN&gt;the activity bit remains the same and doesn't change at all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you mentioned previously, I'm reading IACK before putting the PIC into mixed mode. As a consequence, I have tried to do the inverse and it seems to work properly. The timer interruptions cause external interrupts and call the corresponding handlers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jun 2015 11:16:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/P-Series/P1010-Global-Timers-issues/m-p/438475#M2525</guid>
      <dc:creator>harryjucquois</dc:creator>
      <dc:date>2015-06-10T11:16:00Z</dc:date>
    </item>
  </channel>
</rss>

