<?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>MPC5xxx中的主题 Re: MPC5744P CTU-ADC issue</title>
    <link>https://community.nxp.com/t5/MPC5xxx/MPC5744P-CTU-ADC-issue/m-p/1041582#M15620</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;you have a MRS_RE error too, means MRS appears while double buffered registers are written but before GRE is set. So no update is done.&lt;/P&gt;&lt;P&gt;Do you do any changes of&amp;nbsp;&lt;SPAN&gt;double buffered registers while running? Or you did just the init. For the latter one do you init CTU and ADC first then start FlexPWM?&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR, Petr&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 30 Jun 2020 13:13:52 GMT</pubDate>
    <dc:creator>PetrS</dc:creator>
    <dc:date>2020-06-30T13:13:52Z</dc:date>
    <item>
      <title>MPC5744P CTU-ADC issue</title>
      <link>https://community.nxp.com/t5/MPC5xxx/MPC5744P-CTU-ADC-issue/m-p/1041581#M15619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My application is using FLEXPWM_MRS as reload signal for CTU_0 to trigger 8 channels of ADC1 in trigger mode.&amp;nbsp;&lt;/P&gt;&lt;P&gt;below are the configuration of CTU and ADC module:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CTU_0.TGSISR.R = 1; /* Input 0 Rising edge Enable -- FlexPWM_0_MRS */&lt;BR /&gt; CTU_0.TGSCR.R = 0; /* Prescaler is 1, trigger mode */&lt;/P&gt;&lt;P&gt;CTU_0.TGSCRR.R = 0;&lt;BR /&gt; CTU_0.TGSCCR.R = 8000; /* 20KHz by default */&lt;/P&gt;&lt;P&gt;CTU_0.TCR[0].R = 4000; /* center point trigger sample */&lt;/P&gt;&lt;P&gt;CTU_0.CLCR1.B.T0_INDEX = 0; /* Trigger 0 command list 1st command address */&lt;/P&gt;&lt;P&gt;CTU_0.THCR1.R = 0x41; /* Trigger 0 enable, ADC command output enable */&lt;/P&gt;&lt;P&gt;CTU_0.CLR[0].A.R = 0x0020; /* single conversion, result to FIFO0, ADC1-CH0 */&lt;BR /&gt; CTU_0.CLR[1].A.R = 0x0021; /* single conversion, result to FIFO0, ADC1-CH1 */&lt;BR /&gt; CTU_0.CLR[2].A.R = 0x0022; /* single conversion, result to FIFO0, ADC1-CH2 */&lt;BR /&gt; CTU_0.CLR[3].A.R = 0x0024; /* single conversion, result to FIFO0, ADC1-CH4 */&lt;BR /&gt; CTU_0.CLR[4].A.R = 0x0025; /* single conversion, result to FIFO0, ADC1-CH5 */&lt;BR /&gt; CTU_0.CLR[5].A.R = 0x0026; /* single conversion, result to FIFO0, ADC1-CH6 */&lt;BR /&gt; CTU_0.CLR[6].A.R = 0x0027; /* single conversion, result to FIFO0, ADC1-CH7 */&lt;BR /&gt; CTU_0.CLR[7].A.R = 0x0028; /* single conversion, result to FIFO0, ADC1-CH8 */&lt;BR /&gt; CTU_0.CLR[8].A.R = 0x4000; /* last command */&lt;/P&gt;&lt;P&gt;CTU_0.FTH.R = 7; /* FIFO 0 threshold is 7 to accept 8 ADC results */&lt;BR /&gt; CTU_0.FCR.R = 4; /* FIFO 0 threshold overflow interrupt enable */&lt;/P&gt;&lt;P&gt;INTC_0.PSR[709].R = 0x800E;&lt;/P&gt;&lt;P&gt;// CTU_0.EFR.R = 0xFFFF;&lt;/P&gt;&lt;P&gt;CTU_0.CR.R = 0x3; /* General reload and TGS input selection reload enable */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ADC_1.MCR.R = 0x80020000; /* Enable overwriting older conversion results, ADC clock = half of bus clock (80MHz) */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I observe that ADC_OE bit and ERRCMP bit in EFR register is set, &amp;nbsp;EOCCH0 of ADC1 is set, conversion result is stored in ADC_1_CDR0, but consecutive channels not triggered.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I parse the CTU chapter and demo for several times and still cannot find the root cause.&lt;/P&gt;&lt;P&gt;please help check what is wrong in my code. what cause the ADC_OE ERROR?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/114097i7AA5B599E4683A39/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&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="pastedImage_3.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/114098i966366B3C197836E/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_3.png" alt="pastedImage_3.png" /&gt;&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="pastedImage_4.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/114099i440C2BD0CD87BCFD/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_4.png" alt="pastedImage_4.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jun 2020 14:07:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/MPC5744P-CTU-ADC-issue/m-p/1041581#M15619</guid>
      <dc:creator>zhangzhiming</dc:creator>
      <dc:date>2020-06-29T14:07:02Z</dc:date>
    </item>
    <item>
      <title>Re: MPC5744P CTU-ADC issue</title>
      <link>https://community.nxp.com/t5/MPC5xxx/MPC5744P-CTU-ADC-issue/m-p/1041582#M15620</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;you have a MRS_RE error too, means MRS appears while double buffered registers are written but before GRE is set. So no update is done.&lt;/P&gt;&lt;P&gt;Do you do any changes of&amp;nbsp;&lt;SPAN&gt;double buffered registers while running? Or you did just the init. For the latter one do you init CTU and ADC first then start FlexPWM?&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR, Petr&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jun 2020 13:13:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/MPC5744P-CTU-ADC-issue/m-p/1041582#M15620</guid>
      <dc:creator>PetrS</dc:creator>
      <dc:date>2020-06-30T13:13:52Z</dc:date>
    </item>
    <item>
      <title>Re: MPC5744P CTU-ADC issue</title>
      <link>https://community.nxp.com/t5/MPC5xxx/MPC5744P-CTU-ADC-issue/m-p/1041583#M15621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello Petr, thanks for your quick response.&lt;/P&gt;&lt;P&gt;I do not change any of double buffered registers while running, only reading FIFO0 when FIFO0 overflow interrupt occurs and set GRE. But the overflow never happen as only the first ADC channel conversion executed and errors set in EFR register. I also checked the sequence of initialize and its correct.&lt;/P&gt;&lt;P&gt;Please help check what's wrong in it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2020 13:28:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/MPC5744P-CTU-ADC-issue/m-p/1041583#M15621</guid>
      <dc:creator>zhangzhiming</dc:creator>
      <dc:date>2020-07-01T13:28:54Z</dc:date>
    </item>
    <item>
      <title>Re: MPC5744P CTU-ADC issue</title>
      <link>https://community.nxp.com/t5/MPC5xxx/MPC5744P-CTU-ADC-issue/m-p/1041584#M15622</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;CTU code looks normal. Can you share ADC and PWM code too, or register value.&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is ADC_CLK and MOTC_CLK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR, Petr&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2020 20:30:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/MPC5744P-CTU-ADC-issue/m-p/1041584#M15622</guid>
      <dc:creator>PetrS</dc:creator>
      <dc:date>2020-07-01T20:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: MPC5744P CTU-ADC issue</title>
      <link>https://community.nxp.com/t5/MPC5xxx/MPC5744P-CTU-ADC-issue/m-p/1041585#M15623</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello Petr, thanks for your quick response.&lt;/P&gt;&lt;P&gt;below are clock settings:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* PBRIDGEx_CLK Divide */&lt;BR /&gt; MC_CGM.SC_DC0.B.DIV = 3; /* Freq = sysclk / (3+1) */&lt;BR /&gt;&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /* PBRIDGE_0, PBRIDGE_1 clock: 160/4 = 40MHz */&lt;BR /&gt; MC_CGM.SC_DC0.B.DE = 1; /* Enable divided clock */&lt;/P&gt;&lt;P&gt;PLL_160MHz();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MC_CGM.AC0_SC.B.SELCTL = 0b10; //Select PLL0_PHI as source of ADC analog clock&lt;BR /&gt; MC_CGM.AC0_DC0.R = 0x80000000; //Enable MOTC clock and divide PLL0 by 1&lt;BR /&gt; MC_CGM.AC0_DC2.R = 0x80030000; //Enable ADC_CLK and divide PLL0_PHI source by 4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MC_ME.PCTL237.B.RUN_CFG = 0b001; /* Adc0 : select peripheral configure RUN_PC[1] */&lt;BR /&gt; MC_ME.PCTL126.B.RUN_CFG = 0b001; /* Adc1 : select peripheral configure RUN_PC[1] */&lt;BR /&gt; MC_ME.PCTL235.B.RUN_CFG = 0b001; /* Adc2 : select peripheral configure RUN_PC[1] */&lt;BR /&gt; MC_ME.PCTL124.B.RUN_CFG = 0b001; /* Adc3 : select peripheral configure RUN_PC[1] */&lt;/P&gt;&lt;P&gt;MC_ME.PCTL251.B.RUN_CFG = 0b001; /* CTU 0 : select peripheral configure RUN_PC[1]*/&lt;/P&gt;&lt;P&gt;MC_ME.PCTL255.B.RUN_CFG = 0b001; /* FlexPWM 0: select peripheral configure RUN_PC[1] */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FlexPWM works fine. and there is no issue for ADC1 when works in normal mode.&lt;/P&gt;&lt;P&gt;I also attach the FIFO0 overflow interrupt service function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;uint32_t TEMP[9];&lt;/P&gt;&lt;P&gt;void CTU_FIFO_0_ISR(void)&lt;BR /&gt;{&lt;BR /&gt; FIFO_0_Status = CTU_0.FST.R &amp;amp; 0x0F;&lt;/P&gt;&lt;P&gt;if(FIFO_0_Status == 4) /* if FIFO 0 overflow */&lt;BR /&gt; {&lt;BR /&gt; Counter_CTU_0_TR0++;&lt;/P&gt;&lt;P&gt;TEMP[0] = (uint32_t)CTU_0.FR[0].R;&lt;BR /&gt; TEMP[1] = (uint32_t)CTU_0.FR[0].R;&lt;BR /&gt; TEMP[2] = (uint32_t)CTU_0.FR[0].R;&lt;BR /&gt; TEMP[4] = (uint32_t)CTU_0.FR[0].R;&lt;BR /&gt; TEMP[5] = (uint32_t)CTU_0.FR[0].R;&lt;BR /&gt; TEMP[6] = (uint32_t)CTU_0.FR[0].R;&lt;BR /&gt; TEMP[7] = (uint32_t)CTU_0.FR[0].R;&lt;BR /&gt; TEMP[8] = (uint32_t)CTU_0.FR[0].R;&lt;/P&gt;&lt;P&gt;CTU_0.CR.B.GRE = 1; /* General reload enable */&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;if(FIFO_0_Status == 8)&lt;BR /&gt; {&lt;BR /&gt; CTU_0.FST.R = 8; /* Clear overrun flag */&lt;BR /&gt; }&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can you please try from your side if it works?&lt;/P&gt;&lt;P&gt;thanks for your support.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jul 2020 14:32:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/MPC5744P-CTU-ADC-issue/m-p/1041585#M15623</guid>
      <dc:creator>zhangzhiming</dc:creator>
      <dc:date>2020-07-02T14:32:10Z</dc:date>
    </item>
    <item>
      <title>Re: MPC5744P CTU-ADC issue</title>
      <link>https://community.nxp.com/t5/MPC5xxx/MPC5744P-CTU-ADC-issue/m-p/1041586#M15624</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;per the RM "The CTU MOTC_CLK must be two times of ADC_CLK or equal to ADC_CLK."&lt;/P&gt;&lt;P&gt;You have CTU running on 160MHz and ADC clock on 20MHz.&lt;/P&gt;&lt;P&gt;Try to set&amp;nbsp;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;MC_CGM.AC0_DC2.R = 0x80000000; to have ADC clocked by 80MHz, which is max clock for module.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Also there are few examples you can refer to&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;A href="https://community.nxp.com/docs/DOC-104570"&gt;Example MPC5744P FlexPWM CTU ADC synchronization GHS614&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;A href="https://community.nxp.com/docs/DOC-104627"&gt;https://community.nxp.com/docs/DOC-104627&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;BR, Petr&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jul 2020 08:38:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/MPC5744P-CTU-ADC-issue/m-p/1041586#M15624</guid>
      <dc:creator>PetrS</dc:creator>
      <dc:date>2020-07-03T08:38:04Z</dc:date>
    </item>
    <item>
      <title>Re: MPC5744P CTU-ADC issue</title>
      <link>https://community.nxp.com/t5/MPC5xxx/MPC5744P-CTU-ADC-issue/m-p/1041587#M15625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello Petr&lt;/P&gt;&lt;P&gt;it works after I change the ADC clock as your comment. thanks a lot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best Regards,&lt;/P&gt;&lt;P&gt;Zhiming&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jul 2020 09:40:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/MPC5744P-CTU-ADC-issue/m-p/1041587#M15625</guid>
      <dc:creator>zhangzhiming</dc:creator>
      <dc:date>2020-07-06T09:40:46Z</dc:date>
    </item>
  </channel>
</rss>

