<?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 LPC4357 QEI not working in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4357-QEI-not-working/m-p/1272530#M44893</link>
    <description>&lt;P&gt;I am using an LPC4357s QEI peripheral. I cannot get it working. I have read the user manual and see that there is not much to do except configure the input pins. I am not using the index pin. Only the phase A and B pins on PA_3 and PA_2. I have configure the pins as:&lt;/P&gt;&lt;P&gt;// PA_2 Encoder B&lt;BR /&gt;{0xA, 2, SCU_MODE_INACT | SCU_MODE_FUNC1},&lt;BR /&gt;&lt;BR /&gt;// PA_3 Encoder A&lt;BR /&gt;{0xA, 3, SCU_MODE_INACT | SCU_MODE_FUNC1},&lt;/P&gt;&lt;P&gt;This is in the pinmuxing array with all the other pins that are working.&lt;/P&gt;&lt;P&gt;I initialize the QEI like this:&lt;/P&gt;&lt;P&gt;// Setup the QEI interface.&lt;BR /&gt;// Reset the counter.&lt;BR /&gt;Chip_Clock_Enable(CLK_MX_QEI);&lt;BR /&gt;Chip_RGU_TriggerReset(RGU_QEI_RST);&lt;BR /&gt;while (Chip_RGU_InReset(RGU_QEI_RST));&lt;BR /&gt;&lt;BR /&gt;LPC_QEI-&amp;gt;CONF |= 0x00;&lt;BR /&gt;LPC_QEI-&amp;gt;MAXPOS = 4000000000;&lt;BR /&gt;LPC_QEI-&amp;gt;FILTERPHA = 10;&lt;BR /&gt;LPC_QEI-&amp;gt;FILTERPHB = 10;&lt;BR /&gt;LPC_QEI-&amp;gt;FILTERINX = 10;&lt;BR /&gt;LPC_QEI-&amp;gt;CON = 0x0f;&lt;/P&gt;&lt;P&gt;I have tried lots of other things but I only get zero when I read EncoderCount = LPC_QEI-&amp;gt;POS;&lt;/P&gt;&lt;P&gt;I can see my encoder signals on a scope and they look good.&lt;/P&gt;&lt;P&gt;Thank you for any input anyone has.&lt;/P&gt;</description>
    <pubDate>Thu, 06 May 2021 01:26:57 GMT</pubDate>
    <dc:creator>garyaltenberg</dc:creator>
    <dc:date>2021-05-06T01:26:57Z</dc:date>
    <item>
      <title>LPC4357 QEI not working</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4357-QEI-not-working/m-p/1272530#M44893</link>
      <description>&lt;P&gt;I am using an LPC4357s QEI peripheral. I cannot get it working. I have read the user manual and see that there is not much to do except configure the input pins. I am not using the index pin. Only the phase A and B pins on PA_3 and PA_2. I have configure the pins as:&lt;/P&gt;&lt;P&gt;// PA_2 Encoder B&lt;BR /&gt;{0xA, 2, SCU_MODE_INACT | SCU_MODE_FUNC1},&lt;BR /&gt;&lt;BR /&gt;// PA_3 Encoder A&lt;BR /&gt;{0xA, 3, SCU_MODE_INACT | SCU_MODE_FUNC1},&lt;/P&gt;&lt;P&gt;This is in the pinmuxing array with all the other pins that are working.&lt;/P&gt;&lt;P&gt;I initialize the QEI like this:&lt;/P&gt;&lt;P&gt;// Setup the QEI interface.&lt;BR /&gt;// Reset the counter.&lt;BR /&gt;Chip_Clock_Enable(CLK_MX_QEI);&lt;BR /&gt;Chip_RGU_TriggerReset(RGU_QEI_RST);&lt;BR /&gt;while (Chip_RGU_InReset(RGU_QEI_RST));&lt;BR /&gt;&lt;BR /&gt;LPC_QEI-&amp;gt;CONF |= 0x00;&lt;BR /&gt;LPC_QEI-&amp;gt;MAXPOS = 4000000000;&lt;BR /&gt;LPC_QEI-&amp;gt;FILTERPHA = 10;&lt;BR /&gt;LPC_QEI-&amp;gt;FILTERPHB = 10;&lt;BR /&gt;LPC_QEI-&amp;gt;FILTERINX = 10;&lt;BR /&gt;LPC_QEI-&amp;gt;CON = 0x0f;&lt;/P&gt;&lt;P&gt;I have tried lots of other things but I only get zero when I read EncoderCount = LPC_QEI-&amp;gt;POS;&lt;/P&gt;&lt;P&gt;I can see my encoder signals on a scope and they look good.&lt;/P&gt;&lt;P&gt;Thank you for any input anyone has.&lt;/P&gt;</description>
      <pubDate>Thu, 06 May 2021 01:26:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4357-QEI-not-working/m-p/1272530#M44893</guid>
      <dc:creator>garyaltenberg</dc:creator>
      <dc:date>2021-05-06T01:26:57Z</dc:date>
    </item>
    <item>
      <title>Re: LPC4357 QEI not working</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4357-QEI-not-working/m-p/1273433#M44923</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I think your code is correct. If you check the LPC_QEI-&amp;gt;POS register in debugger with the PHA/PHB signal available, can you see if the LPC_QEI-&amp;gt;POS register change or not?&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;XiangJun Rong&lt;/P&gt;</description>
      <pubDate>Fri, 07 May 2021 06:21:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4357-QEI-not-working/m-p/1273433#M44923</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2021-05-07T06:21:34Z</dc:date>
    </item>
    <item>
      <title>Re: LPC4357 QEI not working</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4357-QEI-not-working/m-p/1273730#M44934</link>
      <description>&lt;P&gt;Hi XiangJun Rong,&lt;/P&gt;&lt;P&gt;Thank you for your reply. I do have code that reads the position register and it was always zero. I could even use the debugger and it was always zero.&lt;/P&gt;&lt;P&gt;I got it working! I first attempted to read the pins as GPIO inputs by changing the entries in my pinmuxing array to set the pins as function 0. It still wasn't working. Then I added calls to Chip_SCU_PinMuxSet for each pin setting them to function 0 in my main code. Then I could read the pins. Then I changed them to function 1 and now the QEI is working.&lt;/P&gt;&lt;P&gt;Chip_SCU_PinMuxSet(0xA, 2, SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_PULLUP | SCU_MODE_FUNC1);&lt;BR /&gt;Chip_SCU_PinMuxSet(0xA, 3, SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_PULLUP | SCU_MODE_FUNC1);&lt;/P&gt;&lt;P&gt;I have no idea why my entries in my pinmuxing array do not work. All the other pins I setup in that array work for Ethernet, USB, I2C, GPIOS, etc. all work. This is when I call:&lt;/P&gt;&lt;P&gt;Chip_SCU_SetPinMuxing(pinmuxing, sizeof(pinmuxing) / sizeof(PINMUX_GRP_T));&lt;/P&gt;&lt;P&gt;I have this in the board_sysinit.c file.&lt;/P&gt;&lt;P&gt;Here are the two entries for the encoder PHA and PHB on pins PA_3 and PA_2.&lt;/P&gt;&lt;P&gt;// PA_2 Encoder B GPIO4[9].&lt;BR /&gt;{0xA, 2, SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_PULLUP | SCU_MODE_FUNC1},&lt;BR /&gt;&lt;BR /&gt;// PA_3 Encoder A GPIO4[10]&lt;BR /&gt;{0xA, 3, SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_PULLUP | SCU_MODE_FUNC1},&lt;/P&gt;&lt;P&gt;Any idea why this would not work when all the other pins I setup do?&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Gary Altenberg&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 May 2021 13:42:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4357-QEI-not-working/m-p/1273730#M44934</guid>
      <dc:creator>garyaltenberg</dc:creator>
      <dc:date>2021-05-07T13:42:27Z</dc:date>
    </item>
    <item>
      <title>Re: LPC4357 QEI not working</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4357-QEI-not-working/m-p/1273930#M44943</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Good news that you use the Chip_SCU_PinMuxSet() function to assign the pins as it's function successfully. For your array implementation, pls check the corresponding SPSPA_2 and SPSPA_3 register in debugger&amp;nbsp; if you have written them correctly.&lt;/P&gt;
&lt;P&gt;Hope it can help you&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;XiangJun Rong&lt;/P&gt;</description>
      <pubDate>Sat, 08 May 2021 02:51:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC4357-QEI-not-working/m-p/1273930#M44943</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2021-05-08T02:51:56Z</dc:date>
    </item>
  </channel>
</rss>

