This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DP83826E: Unable to perform MII Loopback on DP83826E PHY in conjunction with F28388D microcontroller.

Part Number: DP83826E
Other Parts Discussed in Thread: C2000WARE

Hi,

My team have a proprietary PCBA with a F28388D microcontroller and an Ethernet PHY on it. We wanted to use the DP83822 PHY (just like the one on the controlCard) but it was sold out at the time, so we substituted it for a DP83826E. We have no issues reading from and writing to the registers in the PHY chip, however we cannot successfully perform a MII loopback. We tried to run the C2000Ware F28388D example project, ethernet_ex2_phy_loopback, on our custom board but it always failed without receiving a good packet. The controlCard had some issues with the wait time (to be explained at the end), but after a slight variable tweaking, the MII loopback project ran perfectly on the controlCard. We are baffled because at first glance, the two PHYs are very similar. More specifically, the Basic Mode Control Register for both the DP83822 and the DP83826 are located at the same address and contain the same fields at the same bit locations. But despite the familiar programming interfaces, the example project only passed for one and not the other. However, we have confirmed that the internal loopback example, ethernet_ex1_basic_tx_rx_loopback, does work (once again with increases to the wait time) with our proprietary board.

So far we have followed the tables and instructions provided by the DP83826 datasheet to the best of our ability, but it is to no avail. Therefore, we would like the TI staff to help us by providing some concrete example code on how do MII loopback on the DP83826E PHY with a F28388D microcontroller. If it is of any relevance, we also use a 25MHz clock signal for PHY just like in the controlCard and we are using BASIC mode Ethernet only.

P.S.: The SysCtl_delay() value to wait for the packets to return is too short even in the internal loopback example. I had to increase it to at least 6000 cycles from 3000 cycles in order to not have issues with receiving the returning packets.

UPDATE1:

We disconnected the PHY RX_ER pin from the microcontroller GPIO pin muxed as the ENET_MII_RX_ERR signal and then ran the MII loopback example.

This time it passed. However, this is a less than ideal solution as it is comparable to putting a penny in a fuse box to get the all the high power house appliances to run at once.

But this does help narrow our search as we are now looking as to how the RX_ER might have been asserted during the operation of our custom board.

Of course, we would gladly welcome any help from TI in finding the cause of the RX_ER assertion.

UPDATE1_EDIT: I would like to correct my earlier statements. There was no way to actually physically disconnect the PHY RX_ER pin from the microcontroller. Instead, my teammate simply did not mux any pin to act as the Ethernet receive error pin.

UPDATE2: 

We attempted to performed an external loopback using a segment of Ethernet cable that we cut apart and shorted certain wires together. We then ran a modified version of the PHY MII loopback project where we don't change any PHY registers so all the packets go through all the stages of the PHY and on to the cable line. The controlCard had no issue with receiving its own packets sent over this loopback cable segment. However, our own proprietary board experienced a strange phenomenon where we don't receive any good packets yet we are not getting any receive errors either (and yes the GPIO pin serving as ENET_MII_RX_ERR was re-enabled to serve that function).

As of this post, all hardware diagnostic attempts so far indicated that there is nothing wrong with the board. If the issues are indeed firmware or PHY register related, then we currently have no idea of what needs to be done to get this PHY to work with the MCU as there dozens of configuration variables for the Ethernet module and at least 17 of the 32 standardly addressed PHY registers have some writable bits in it.

  • Hello,

    From a PHY team standpoint, we have no knowledge of the different projects you are referring to and would recommend the C2000Ware experts comment on such. The only comment that we can give is that on DP83826, in addition to Reg 0x0[14] being set, 0x16[4:0] needs to be set accordingly as per the datasheet. I will reassign the thread to C2000 team for further support.

    Sincerely,

    Gerome

  • We found the datasheet to be unhelpful at times. For example, the following list entries do not correspond to any register addresses yet they are under the heading of "9.3.14.4 Digital Loopback".

    • 0x0122 = 0x2000 /
    • 0x0123 = 0x2000
    • 0x0130 = 0x47FF

    Also the BISCR register field descriptions makes no mention of MII Loopback for the bits of interest, bits 0 to 4. In fact, bit 2 (corresponding to a value of 4 when set) is explicitly associated with Digital Loopback in that register field descriptions table contradicting the sentence "MII Loopback is enabled by setting bit[14] in the BMCR and bit[2] in BISCR."

  • Hi Howard,

    I understand the confusion regarding the datasheet description. However, for MII loopback you only need to enable 0x0[14] and 0x16[2]. Why are you looking at digital loopback if you wanted MII loopback in your initial statement? If you program these bits high, then MII loopback is achieved from a PHY standpoint.

    Sincerely,

    Gerome

  • We are not looking to test the digital loopback. We simply noted that the datasheet seemed to have statements that indicate digital loopback requires setting 0x16[2] and statements that indicate MII loopback requires setting 0x16[2]. If these statements are contradictory, then we don't know which one is true and which one is false. If those statements are not contradictory and that both loopbacks do involve setting the same bit in PHY register 0x16, then there is no explicit statement within the datasheet to back that assumption.

    Hence we found the datasheet to be unhelpful in certain parts.

  • Hi Howard, 

    I appreciate your feedback and will relay to the team for future updating we will be doing on the datasheet. For the time being, I would recommend following the descriptions on section 9.3.14. I will reroute this query to the C2000 team if there are no further queries. Please confirm.

    Sincerely,

    Gerome

  • Yes please send this issue to the C2000 / C2000Ware team.

  • We disconnected the PHY RX_ER pin from the microcontroller GPIO pin muxed as the ENET_MII_RX_ERR signal and then ran the MII loopback example.

    This time it passed. However, this is a less than ideal solution as it is comparable to putting a penny in a fuse box to get the all the high power house appliances to run at once.

    But this does help narrow our search as we are now looking as to how the RX_ER might have been asserted during the operation of our custom board.

    Of course, we would gladly welcome any help from TI in finding the cause of the RX_ER assertion.

    EDIT: I would like to correct my earlier statements. There was no way to actually physically disconnect the PHY RX_ER pin from the microcontroller. Instead, my teammate simply did not mux any GPIO pin to act as the Ethernet receive error pin.

  • We attempted to performed an external loopback using a segment of Ethernet cable that we cut apart and shorted certain wires together. We then ran a modified version of the PHY MII loopback project where we don't change any PHY registers so all the packets go through all the stages of the PHY and on to the cable line. The controlCard had no issue with receiving its own packets sent over this loopback cable segment. However, our own proprietary board experienced a strange phenomenon where we don't receive any good packets yet we are not getting any receive errors either (and yes the GPIO pin serving as ENET_MII_RX_ERR was re-enabled to serve that function).

    As of this post, all hardware diagnostic attempts so far indicated that there is nothing wrong with the board. If the issues are indeed firmware or PHY register related, then we currently have no idea of what needs to be done to get this PHY to work with the MCU as there dozens of configuration variables for the Ethernet module and at least 17 of the 32 standardly addressed PHY registers have some writable bits in it.

  • Hello Howard,

    Apologies for the late response here. On looking through the whole conversation, it seems the control card config seems to work fine and not your proprietary board  ?

  • Yes, the controlCard had no issues with the default PHY loopback example but the proprietary board does.

    However, recent efforts by a teammate in trying out different PHY register configurations has managed to get things working at the very least for a no auto-negotiation, no MDIX, 10 Mbps, half-duplex connection. We even managed to run the lwip example. However, we would still prefer to have the connection speed be at least 100 Mbps.