<?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: How to setup eMIOS QDEC function?</title>
    <link>https://community.nxp.com/t5/MPC5xxx/How-to-setup-eMIOS-QDEC-function/m-p/905055#M13451</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;I would like to test the QDEC function of the eMIOS. I am working with MPC5634 on the evaluation board.&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;I am generating A/B 1khz 90° shift square signals on the EMIOS8/9 channels and I have configured the eMIOS this way&lt;/P&gt;&lt;P&gt;//MPC5634 - EMIOS -QDEC&amp;nbsp;&lt;/P&gt;&lt;P&gt;void vfn_emios_Qdec_set(uint8_t ui8_chan)&lt;BR /&gt;{&lt;BR /&gt; EMIOS.CH[ui8_chan-1].CCR.B.MODE= 0x00;&lt;BR /&gt; EMIOS.CH[ui8_chan-1].CCNTR.R = 10000;&lt;BR /&gt; EMIOS.CH[ui8_chan-1].CADR.R = 10000;&lt;BR /&gt; EMIOS.CH[ui8_chan-1].CBDR.R = 10000;&lt;BR /&gt; EMIOS.CH[ui8_chan-1].CCR.B.BSL = 0;&lt;BR /&gt; EMIOS.CH[ui8_chan-1].CCR.B.UCPRE = 0;&lt;BR /&gt; EMIOS.CH[ui8_chan-1].CCR.B.UCPREN = 1;&lt;BR /&gt; EMIOS.CH[ui8_chan-1].CCR.B.EDPOL = 1; &lt;BR /&gt; &lt;BR /&gt; EMIOS.CH[ui8_chan-1].CCR.B.IF= 0x08;&lt;BR /&gt; EMIOS.CH[ui8_chan-1].CCR.B.EDSEL=0; &lt;BR /&gt; EMIOS.CH[ui8_chan-1].CCR.B.DMA=0;&lt;BR /&gt; EMIOS.CH[ui8_chan-1].CCR.B.FEN = 1;&lt;BR /&gt; &lt;BR /&gt; EMIOS.CH[ui8_chan-1].CCR.B.MODE= 0x10; &lt;BR /&gt;// EMIOS.CH[ui8_chan-1].CCR.B.MODE= 0x4;&lt;BR /&gt; &lt;BR /&gt; EMIOS.CH[ui8_chan-1].CADR.R = 1;&lt;BR /&gt; SIU.PCR[187].R = 0x0500; /* Initialize pad for eMIOS chan. 2 output */&lt;BR /&gt; &lt;BR /&gt; EMIOS.CH[ui8_chan].CCR.B.MODE= 0x00; &lt;BR /&gt; EMIOS.CH[ui8_chan].CCNTR.R = 10000;&lt;BR /&gt; EMIOS.CH[ui8_chan].CADR.R = 10000;&lt;BR /&gt; EMIOS.CH[ui8_chan].CBDR.R = 10000;&lt;BR /&gt; EMIOS.CH[ui8_chan].CCR.B.BSL = 0;&lt;BR /&gt; EMIOS.CH[ui8_chan].CCR.B.UCPRE = 0;&lt;BR /&gt; EMIOS.CH[ui8_chan].CCR.B.UCPREN = 1;&lt;BR /&gt; EMIOS.CH[ui8_chan].CCR.B.EDPOL = 1; &lt;BR /&gt;;&lt;BR /&gt; EMIOS.CH[ui8_chan].CCR.B.IF= 0x08;&lt;BR /&gt; EMIOS.CH[ui8_chan].CCR.B.EDSEL=0; &lt;BR /&gt; EMIOS.CH[ui8_chan].CCR.B.DMA=0;&lt;BR /&gt; EMIOS.CH[ui8_chan].CCR.B.FEN = 1;&lt;BR /&gt; &lt;BR /&gt; EMIOS.CH[ui8_chan].CCR.B.MODE= 0x0D;&lt;BR /&gt;// EMIOS.CH[ui8_chan].CCR.B.MODE= 0x02;&lt;BR /&gt; &lt;BR /&gt; EMIOS.CH[ui8_chan].CADR.R = 1;&lt;BR /&gt; SIU.PCR[188].R = 0x0500; /*4 Initialize pad for eMIOS chan. 2 output */ &lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;Many thanks,&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;RH&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jul 2020 05:53:28 GMT</pubDate>
    <dc:creator>阮浩ruanhaosk</dc:creator>
    <dc:date>2020-07-15T05:53:28Z</dc:date>
    <item>
      <title>How to setup eMIOS QDEC function?</title>
      <link>https://community.nxp.com/t5/MPC5xxx/How-to-setup-eMIOS-QDEC-function/m-p/905051#M13447</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to test the QDEC function of the eMIOS. I am working with MPC5777C on the evaluation board.&lt;/P&gt;&lt;P&gt;I am generating A/B 1khz 90° shift square signals on the EMIOS0/1 channels and I have configured the eMIOS this way :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;// IO Pin configuration&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; emios_configInpuQD = PA_PRIF | IBE;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; //eMIOS 0 channel 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; SIU.PCR[179].R = emios_configInpuQD;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; //eMIOS 0 channel 1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; SIU.PCR[180].R = emios_configInpuQD;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;//eMIOS configuration&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;eMIOS_0.MCR.B.GPRE= 63; /* Divide 64 MHz sysclk by 63+1 = 64 for 1MHz eMIOS clk*/&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; eMIOS_0.MCR.B.ETB = 1; /* External time base is disabled; Ch 23 drives ctr bus A */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; eMIOS_0.MCR.B.FRZ = 1; /* Enable stopping channels when in debug mode */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;eMIOS_0.UC[0].C.B.BSL = 3; // Use internal counters?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; eMIOS_0.UC[1].C.B.BSL = 3; // Use internal counters&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; eMIOS_0.UC[1].C.B.MODE = 0x0D; /* Quadrature decode (for phase A and phase B encoders type) */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; eMIOS_0.MCR.B.GPREN = 1; /* Enable eMIOS clock */&lt;BR /&gt; eMIOS_0.MCR.B.GTBE = 1; /* Enable global time base */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am expecting the see the CNT register of UC(1) incrementing but nothing is happening, looks like I'm missing something very basic. Any clue?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Many thanks,&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Daniel&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 May 2019 05:44:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/How-to-setup-eMIOS-QDEC-function/m-p/905051#M13447</guid>
      <dc:creator>daniel_fernande</dc:creator>
      <dc:date>2019-05-23T05:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to setup eMIOS QDEC function?</title>
      <link>https://community.nxp.com/t5/MPC5xxx/How-to-setup-eMIOS-QDEC-function/m-p/905052#M13448</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;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;you will need to configure IGF module, otherwise inputs does not pass&lt;/SPAN&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&amp;nbsp;to eMIOS module.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IGF_0.FILTER[16].MCR.B.FGEN = 1;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;IGF_0.FILTER[17].MCR.B.FGEN = 1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;BR, Petr&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 May 2019 11:04:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/How-to-setup-eMIOS-QDEC-function/m-p/905052#M13448</guid>
      <dc:creator>PetrS</dc:creator>
      <dc:date>2019-05-23T11:04:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to setup eMIOS QDEC function?</title>
      <link>https://community.nxp.com/t5/MPC5xxx/How-to-setup-eMIOS-QDEC-function/m-p/905053#M13449</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks that was the problem !&lt;/P&gt;&lt;P&gt;Maybe additional question :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ok now Im trying to drive global counter A with the encoder events.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I'm configuring UC[23] in QDEC mode and this channel is working fine, I can see the internal counter of UC[23] incrementing correctly but I am not sure if counter A is incrementing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I want to&amp;nbsp;configure for example UC[20] with a modulo 4096 driven by counter A, but unfortunatelly this does not work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my configuration :&amp;nbsp;&lt;/P&gt;&lt;P&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/83863i8EE757ED53BAFF10/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;Regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 May 2019 12:36:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/How-to-setup-eMIOS-QDEC-function/m-p/905053#M13449</guid>
      <dc:creator>daniel_fernande</dc:creator>
      <dc:date>2019-05-23T12:36:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to setup eMIOS QDEC function?</title>
      <link>https://community.nxp.com/t5/MPC5xxx/How-to-setup-eMIOS-QDEC-function/m-p/905054#M13450</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;unfortunately counter wrap (e.g. 4095-&amp;gt;0 when counting up, 0&amp;gt;4095 when counting down) is not supported by HW for QDEC mode. Neither I do not see SW workaround. You can set CADR register to generate flag on counter match, but this does not bring big benefit.&lt;/P&gt;&lt;P&gt;When ch 23 is running in QDEC mode, its internal counter is providing counter bus A.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If using MC, MCB modes the internal counter is always selected.&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>Mon, 27 May 2019 11:31:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/How-to-setup-eMIOS-QDEC-function/m-p/905054#M13450</guid>
      <dc:creator>PetrS</dc:creator>
      <dc:date>2019-05-27T11:31:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to setup eMIOS QDEC function?</title>
      <link>https://community.nxp.com/t5/MPC5xxx/How-to-setup-eMIOS-QDEC-function/m-p/905055#M13451</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;I would like to test the QDEC function of the eMIOS. I am working with MPC5634 on the evaluation board.&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;I am generating A/B 1khz 90° shift square signals on the EMIOS8/9 channels and I have configured the eMIOS this way&lt;/P&gt;&lt;P&gt;//MPC5634 - EMIOS -QDEC&amp;nbsp;&lt;/P&gt;&lt;P&gt;void vfn_emios_Qdec_set(uint8_t ui8_chan)&lt;BR /&gt;{&lt;BR /&gt; EMIOS.CH[ui8_chan-1].CCR.B.MODE= 0x00;&lt;BR /&gt; EMIOS.CH[ui8_chan-1].CCNTR.R = 10000;&lt;BR /&gt; EMIOS.CH[ui8_chan-1].CADR.R = 10000;&lt;BR /&gt; EMIOS.CH[ui8_chan-1].CBDR.R = 10000;&lt;BR /&gt; EMIOS.CH[ui8_chan-1].CCR.B.BSL = 0;&lt;BR /&gt; EMIOS.CH[ui8_chan-1].CCR.B.UCPRE = 0;&lt;BR /&gt; EMIOS.CH[ui8_chan-1].CCR.B.UCPREN = 1;&lt;BR /&gt; EMIOS.CH[ui8_chan-1].CCR.B.EDPOL = 1; &lt;BR /&gt; &lt;BR /&gt; EMIOS.CH[ui8_chan-1].CCR.B.IF= 0x08;&lt;BR /&gt; EMIOS.CH[ui8_chan-1].CCR.B.EDSEL=0; &lt;BR /&gt; EMIOS.CH[ui8_chan-1].CCR.B.DMA=0;&lt;BR /&gt; EMIOS.CH[ui8_chan-1].CCR.B.FEN = 1;&lt;BR /&gt; &lt;BR /&gt; EMIOS.CH[ui8_chan-1].CCR.B.MODE= 0x10; &lt;BR /&gt;// EMIOS.CH[ui8_chan-1].CCR.B.MODE= 0x4;&lt;BR /&gt; &lt;BR /&gt; EMIOS.CH[ui8_chan-1].CADR.R = 1;&lt;BR /&gt; SIU.PCR[187].R = 0x0500; /* Initialize pad for eMIOS chan. 2 output */&lt;BR /&gt; &lt;BR /&gt; EMIOS.CH[ui8_chan].CCR.B.MODE= 0x00; &lt;BR /&gt; EMIOS.CH[ui8_chan].CCNTR.R = 10000;&lt;BR /&gt; EMIOS.CH[ui8_chan].CADR.R = 10000;&lt;BR /&gt; EMIOS.CH[ui8_chan].CBDR.R = 10000;&lt;BR /&gt; EMIOS.CH[ui8_chan].CCR.B.BSL = 0;&lt;BR /&gt; EMIOS.CH[ui8_chan].CCR.B.UCPRE = 0;&lt;BR /&gt; EMIOS.CH[ui8_chan].CCR.B.UCPREN = 1;&lt;BR /&gt; EMIOS.CH[ui8_chan].CCR.B.EDPOL = 1; &lt;BR /&gt;;&lt;BR /&gt; EMIOS.CH[ui8_chan].CCR.B.IF= 0x08;&lt;BR /&gt; EMIOS.CH[ui8_chan].CCR.B.EDSEL=0; &lt;BR /&gt; EMIOS.CH[ui8_chan].CCR.B.DMA=0;&lt;BR /&gt; EMIOS.CH[ui8_chan].CCR.B.FEN = 1;&lt;BR /&gt; &lt;BR /&gt; EMIOS.CH[ui8_chan].CCR.B.MODE= 0x0D;&lt;BR /&gt;// EMIOS.CH[ui8_chan].CCR.B.MODE= 0x02;&lt;BR /&gt; &lt;BR /&gt; EMIOS.CH[ui8_chan].CADR.R = 1;&lt;BR /&gt; SIU.PCR[188].R = 0x0500; /*4 Initialize pad for eMIOS chan. 2 output */ &lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;Many thanks,&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="border: 0px; font-weight: inherit;"&gt;RH&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2020 05:53:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MPC5xxx/How-to-setup-eMIOS-QDEC-function/m-p/905055#M13451</guid>
      <dc:creator>阮浩ruanhaosk</dc:creator>
      <dc:date>2020-07-15T05:53:28Z</dc:date>
    </item>
  </channel>
</rss>

