<?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 ENET_SetSMI at 180 MHz for LPC546XX in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/ENET-SetSMI-at-180-MHz-for-LPC546XX/m-p/953419#M37854</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;I'm trying to debug my ethernet&amp;nbsp;phy communication - which does not work yet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My Core Clock is configured to 180 Mhz, which leads to&amp;nbsp; a divisor of 42 in the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void ENET_SetSMI(ENET_Type *base)&lt;BR /&gt;{&lt;BR /&gt; uint32_t crDiv;&lt;BR /&gt; uint32_t srcClock_Hz = CLOCK_GetCoreSysClkFreq() / 1000000U;&lt;/P&gt;&lt;P&gt;if ((srcClock_Hz &amp;gt;= 20U) &amp;amp;&amp;amp; (srcClock_Hz &amp;lt; 35))&lt;BR /&gt; {&lt;BR /&gt; crDiv = 2;&lt;BR /&gt; }&lt;BR /&gt; else if ((srcClock_Hz &amp;gt;= 35) &amp;amp;&amp;amp; (srcClock_Hz &amp;lt; 60))&lt;BR /&gt; {&lt;BR /&gt; crDiv = 3;&lt;BR /&gt; }&lt;BR /&gt; else if ((srcClock_Hz &amp;gt;= 100) &amp;amp;&amp;amp; (srcClock_Hz &amp;lt; 150))&lt;BR /&gt; {&lt;BR /&gt; crDiv = 1;&lt;BR /&gt; }&lt;BR /&gt; else&lt;BR /&gt; {&lt;BR /&gt; crDiv = 0;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;base-&amp;gt;MAC_MDIO_ADDR = ENET_MAC_MDIO_ADDR_CR(crDiv);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this intentional?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Datasheet allows&lt;/P&gt;&lt;P&gt;0x0 CSR clock = 60-100 MHz; MDC clock = CSR clock/42&lt;BR /&gt;0x1 CSR clock = 100-150 MHz; MDC clock = CSR clock/62&lt;BR /&gt;0x2 CSR clock = 20-35 MHz; MDC clock = CSR clock/16&lt;BR /&gt;0x3 CSR clock = 35-60 MHz; MDC clock = CSR clock/26&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I would expect the test to be inclusive of 150 MHz&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;else if ((srcClock_Hz &amp;gt;= 100) &amp;amp;&amp;amp; (srcClock_Hz &amp;lt;= 150))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Or may be even 180 MHz?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;To my surprise this loop is also not left:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt; base-&amp;gt;DMA_MODE |= ENET_DMA_MODE_SWR_MASK;&lt;BR /&gt; while (base-&amp;gt;DMA_MODE &amp;amp; ENET_DMA_MODE_SWR_MASK)&lt;BR /&gt; {&lt;BR /&gt; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have enabled the following clocks:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;CLOCK_EnableClock(kCLOCK_Eth);&lt;BR /&gt; CLOCK_EnableClock(kCLOCK_Dma);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;And I have called&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt; ENET_SetSMI(ENET);&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This command returns 0xFFFF for all PHY Addresses,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;SPAN&gt; &lt;/SPAN&gt;PHY_Read(ENET, i, PHY_ID1_REG, &amp;amp;idReg);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so the bus most likely does not work yet, my PHY may be broken or in a not initalized state... Or I have not yet succesfully enable the Ethernet module. I'm using LPC54616 on a custom board with THA1102, so the example code does not work directly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 21 Sep 2019 10:18:00 GMT</pubDate>
    <dc:creator>thorstenwilmer</dc:creator>
    <dc:date>2019-09-21T10:18:00Z</dc:date>
    <item>
      <title>ENET_SetSMI at 180 MHz for LPC546XX</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/ENET-SetSMI-at-180-MHz-for-LPC546XX/m-p/953419#M37854</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;I'm trying to debug my ethernet&amp;nbsp;phy communication - which does not work yet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My Core Clock is configured to 180 Mhz, which leads to&amp;nbsp; a divisor of 42 in the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void ENET_SetSMI(ENET_Type *base)&lt;BR /&gt;{&lt;BR /&gt; uint32_t crDiv;&lt;BR /&gt; uint32_t srcClock_Hz = CLOCK_GetCoreSysClkFreq() / 1000000U;&lt;/P&gt;&lt;P&gt;if ((srcClock_Hz &amp;gt;= 20U) &amp;amp;&amp;amp; (srcClock_Hz &amp;lt; 35))&lt;BR /&gt; {&lt;BR /&gt; crDiv = 2;&lt;BR /&gt; }&lt;BR /&gt; else if ((srcClock_Hz &amp;gt;= 35) &amp;amp;&amp;amp; (srcClock_Hz &amp;lt; 60))&lt;BR /&gt; {&lt;BR /&gt; crDiv = 3;&lt;BR /&gt; }&lt;BR /&gt; else if ((srcClock_Hz &amp;gt;= 100) &amp;amp;&amp;amp; (srcClock_Hz &amp;lt; 150))&lt;BR /&gt; {&lt;BR /&gt; crDiv = 1;&lt;BR /&gt; }&lt;BR /&gt; else&lt;BR /&gt; {&lt;BR /&gt; crDiv = 0;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;base-&amp;gt;MAC_MDIO_ADDR = ENET_MAC_MDIO_ADDR_CR(crDiv);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this intentional?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Datasheet allows&lt;/P&gt;&lt;P&gt;0x0 CSR clock = 60-100 MHz; MDC clock = CSR clock/42&lt;BR /&gt;0x1 CSR clock = 100-150 MHz; MDC clock = CSR clock/62&lt;BR /&gt;0x2 CSR clock = 20-35 MHz; MDC clock = CSR clock/16&lt;BR /&gt;0x3 CSR clock = 35-60 MHz; MDC clock = CSR clock/26&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I would expect the test to be inclusive of 150 MHz&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;else if ((srcClock_Hz &amp;gt;= 100) &amp;amp;&amp;amp; (srcClock_Hz &amp;lt;= 150))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Or may be even 180 MHz?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;To my surprise this loop is also not left:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt; base-&amp;gt;DMA_MODE |= ENET_DMA_MODE_SWR_MASK;&lt;BR /&gt; while (base-&amp;gt;DMA_MODE &amp;amp; ENET_DMA_MODE_SWR_MASK)&lt;BR /&gt; {&lt;BR /&gt; }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have enabled the following clocks:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;CLOCK_EnableClock(kCLOCK_Eth);&lt;BR /&gt; CLOCK_EnableClock(kCLOCK_Dma);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;And I have called&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt; ENET_SetSMI(ENET);&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This command returns 0xFFFF for all PHY Addresses,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;SPAN&gt; &lt;/SPAN&gt;PHY_Read(ENET, i, PHY_ID1_REG, &amp;amp;idReg);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so the bus most likely does not work yet, my PHY may be broken or in a not initalized state... Or I have not yet succesfully enable the Ethernet module. I'm using LPC54616 on a custom board with THA1102, so the example code does not work directly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Sep 2019 10:18:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/ENET-SetSMI-at-180-MHz-for-LPC546XX/m-p/953419#M37854</guid>
      <dc:creator>thorstenwilmer</dc:creator>
      <dc:date>2019-09-21T10:18:00Z</dc:date>
    </item>
    <item>
      <title>Re: ENET_SetSMI at 180 MHz for LPC546XX</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/ENET-SetSMI-at-180-MHz-for-LPC546XX/m-p/953420#M37855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So I looked with an Logic anylzer onto the MDC/MDIO lines and there is some data. So the Code works, but I don't get a reply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Most likely I have done a mistake with the TJA1102. The 1V8 Pin is not showing any output and SEL_1V8 is left open, though&amp;nbsp;I expected the LDO to work.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Sep 2019 13:19:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/ENET-SetSMI-at-180-MHz-for-LPC546XX/m-p/953420#M37855</guid>
      <dc:creator>thorstenwilmer</dc:creator>
      <dc:date>2019-09-21T13:19:37Z</dc:date>
    </item>
    <item>
      <title>Re: ENET_SetSMI at 180 MHz for LPC546XX</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/ENET-SetSMI-at-180-MHz-for-LPC546XX/m-p/953421#M37856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Thorsten,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the code works correct then probably the TJA1102 is not responding correctly as you mentioned. As I am not expert in this device, I recommend you to submit a question in the following community space.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/community/other"&gt;https://community.nxp.com/community/other&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Felipe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Sep 2019 22:29:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/ENET-SetSMI-at-180-MHz-for-LPC546XX/m-p/953421#M37856</guid>
      <dc:creator>FelipeGarcia</dc:creator>
      <dc:date>2019-09-25T22:29:07Z</dc:date>
    </item>
  </channel>
</rss>

