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.

Signal contention on MDIO with DP83822H PHY Chip

Part Number: F28M36P63C2
Other Parts Discussed in Thread: DP83822H

Hello,

Processor: F28M36P63C2ZWTS

PHY: DP83822H

Software Pin Configuration

MDIO on PM0 has been set up as GPIO_PIN_TYPE_OD

//*****************************************************************************
//
// Set the GPIO port control registers appropriately for the hardware.
//
// This function determines the correct port control settings to enable the
// basic peripheral signals for the development board on their respective pins
// and also ensures that all required EPI signals are correctly routed.  The
// EPI signal configuration is determined from the daughter board information
// structure passed via the \e psInfo parameter.
//
//*****************************************************************************
static void
PortControlSet(void)
{
   
    //
    // To begin with, we set the port control values for all the non-EPI
    // peripherals.
    //


    //UART Setup
    GPIOPinTypeUART(GPIO_PORTE_BASE, GPIO_PIN_4 | GPIO_PIN_5);
    GPIOPinConfigure(GPIO_PE4_U0RX);
    GPIOPinConfigure(GPIO_PE5_U0TX);
    
    //SSI SD Card Setup
    GPIOPinTypeSSI(SDC_GPIO_PORT_BASE, SDC_SSI_TX | SDC_SSI_RX | SDC_SSI_CLK);
    GPIOPinTypeGPIOOutput(SDCARD_CS_BASE, SDCARD_CS_PIN);
    GPIOPadConfigSet(SDC_GPIO_PORT_BASE, SDC_SSI_PINS,
                     GPIO_PIN_TYPE_STD_WPU);
    GPIOPadConfigSet(SDCARD_CS_BASE, SDCARD_CS_PIN,
                     GPIO_PIN_TYPE_STD_WPU);
    GPIOPinConfigure(GPIO_PR0_SSI3TX);
    GPIOPinConfigure(GPIO_PR1_SSI3RX);
    GPIOPinConfigure(GPIO_PR2_SSI3CLK);
    GPIOPinWrite(SDCARD_CS_BASE, SDCARD_CS_PIN, SDCARD_CS_PIN);


    // USB Pins
    GPIOPinConfigure(GPIO_PN6_USB0EPEN);
    GPIOPinConfigure(GPIO_PN7_USB0PFLT);
    GPIOPinTypeUSBDigital(GPIO_PORTN_BASE, GPIO_PIN_6 | GPIO_PIN_7);
    GPIOPinTypeUSBAnalog(GPIO_PORTF_BASE, GPIO_PIN_6);
    GPIOPinTypeUSBAnalog(GPIO_PORTG_BASE, GPIO_PIN_2 | GPIO_PIN_5 | GPIO_PIN_6);


    //Ethernet pin setup
    GPIODirModeSet(GPIO_PORTK_BASE,
                   GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_7,
                   GPIO_DIR_MODE_HW);
	GPIOPadConfigSet(GPIO_PORTK_BASE,
                     GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_7,
                     GPIO_PIN_TYPE_STD);
	GPIOPinConfigure(GPIO_PK4_MIITXEN);
	GPIOPinConfigure(GPIO_PK5_MIITXCK);
	GPIOPinConfigure(GPIO_PK7_MIICRS);


	GPIODirModeSet(GPIO_PORTL_BASE,
                   GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3 |
                   GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7,
                   GPIO_DIR_MODE_HW);
	GPIOPadConfigSet(GPIO_PORTL_BASE,
                     GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3 |
                     GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7,
                     GPIO_PIN_TYPE_STD);
	GPIOPinConfigure(GPIO_PL0_MIIRXD3);
	GPIOPinConfigure(GPIO_PL1_MIIRXD2);
	GPIOPinConfigure(GPIO_PL2_MIIRXD1);
	GPIOPinConfigure(GPIO_PL3_MIIRXD0);
	GPIOPinConfigure(GPIO_PL4_MIICOL);
	GPIOPinConfigure(GPIO_PL5_MIIPHYRSTN);
	GPIOPinConfigure(GPIO_PL6_MIIPHYINTRN);
	GPIOPinConfigure(GPIO_PL7_MIIMDC);

	GPIODirModeSet(GPIO_PORTM_BASE,
                   GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3 |
                   GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7,
                   GPIO_DIR_MODE_HW);
	GPIOPadConfigSet(GPIO_PORTM_BASE,
                     GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3 |
                     GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7,
                     GPIO_PIN_TYPE_STD);
    GPIOPadConfigSet(GPIO_PORTM_BASE,
                     GPIO_PIN_0,
                     GPIO_PIN_TYPE_OD);
	GPIOPinConfigure(GPIO_PM0_MIIMDIO);
	GPIOPinConfigure(GPIO_PM1_MIITXD3);
	GPIOPinConfigure(GPIO_PM2_MIITXD2);
	GPIOPinConfigure(GPIO_PM3_MIITXD1);
	GPIOPinConfigure(GPIO_PM4_MIITXD0);
	GPIOPinConfigure(GPIO_PM5_MIIRXDV);
	GPIOPinConfigure(GPIO_PM6_MIIRXER);
	GPIOPinConfigure(GPIO_PM7_MIIRXCK);





}

//*****************************************************************************
//
//! Configures the device pinout for the development board.
//!
//! This function configures each pin of the device to route the! appropriate
//! peripheral signal as required by the design of the development board.
//!
//! \note This module can be built in two ways.  If the label SIMPLE_PINOUT_SET
//! is not defined, the PinoutSet() function will attempt to read an I2C EEPROM
//! to determine which daughter board is attached to the development kit board
//! and use information from that EEPROM to dynamically configure the EPI
//! appropriately.  In this case, if no EEPROM is found, the EPI configuration
//! will default to that required to use the SDRAM daughter board which is
//! included with the base development kit.
//!
//! If SIMPLE_PINOUT_SET is defined, however, all the dynamic configuration
//! code is replaced with a very simple function which merely sets the pinout
//! and EPI configuration statically.  This is a better representation of how a
//! real-world application would likely initialize the pinout and EPI timing
//! and takes significantly less code space than the dynamic, daughter-board
//! detecting version.  The example offered here sets the pinout and EPI
//! configuration appropriately for the Flash/SRAM/LCD daughter board.
//!
//! \return None.
//
//*****************************************************************************
void
PinoutSet(void)
{
    
    //
    // Enable all GPIO banks.
    //
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC);
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD);
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOG);
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOH);
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOJ);
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOK);
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOL);
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOM);
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPION);
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOP);
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOQ);
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOR);
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOS);


    //
    // Determine the port control settings required to enable the EPI pins
    // and other peripheral signals for this daughter board and set all the
    // GPIO port control registers.
    //
    PortControlSet();

}

Schematic is setup as follows:

The goal is to use lwip. Using Saleae Logic Analyzer I am seeing contention on the MDIO analog reading where the signal in the data portion of the message is not able to drive high. We believe it is a configuration issue, but are unsure if it is a configuration issue of the processor, or the PHY.  R275 is populated on the MDIO line with a 2.2k resistor.

For further insight the lwip example has been used as a base, and The pin configuration described above, and UART setup has been the only modifications to software.

C:\ti\controlSUITE\device_support\f28m36x\v220\F28M36x_examples_Master\enet_lwip\m3\ccs

Testing with a router: Router Wired port <---Ethernet Cable---> Board

Expectation is the Board Eth port LEDs would respond, and the Router LED would respond. As an additional check the Ethernet cable was connected to the laptop instead of the board and the LEDs on both router and laptop were on.

We believe the contention seen to be the issue and are unsure if it is on the processor, or PHY side setup issue? Let me know if any additional information would be helpful to confirm setup.

  • Hi,

    I am reassinging the thread to C2000 team to look from firmware point of view.

    Regards,
    Geet

  • Hi,

    Paul Lane said:
    I am seeing contention on the MDIO analog reading where the signal in the data portion of the message is not able to drive high. We believe it is a configuration issue, but are unsure if it is a configuration issue of the processor, or the PHY.  R275 is populated on the MDIO line with a 2.2k resistor.

    May I know why you think it is a contention issue. The Digital side of your Saelae shows that the microcontroller is trying to Read PHY address 0 and register address Can you check if the PHY is out of reset?  If the PHY address is properly configured to be address 0. 

    Regards,

    Sudhar

  • This data portion of the signal (analog) appears to be attempting to go high in 4 places, and are unable to reach high. This is what I am calling contention. 

    The five bit address is on RX_D3_RX_D2, RX_D1, RX_D0 & COL. RX_D0-D3 are internally pull low, so if no resistor is placed, then the default will be 0. For COL, internally pull up, however, we have 2.2K resistor pull down, so we change the bit to 0 as well. This is how the address is setup right now, this should result in a PHY address of 0.

  • The signal appears okay to me 

    following the pattern :

    <idle><01><10><AAAAA><RRRRR><Z0><XXXX XXXX XXXX XXXX><idle> for the read operation as shown in the PHY datasheet. 

    Can you please check at the PHY end if it is out of reset by probing the RESET_N pin of PHY

    Regards,

    Sudharsanan

  • Highlighting the section of concern in the image above:

    4 sections of this wave form appear to be not fully low, and not fully high. The two peaks in the image the left and right of the image representing high. The logic analyzer "appears" to capture a successful message but, would be misleading if the correct data message has those highs in it. Also there is no explanation for this contention (What I am calling contention).

    I will work on probing PHY RESET_N, and get back to you.

  • Hi, 

    Paul Lane said:
    The logic analyzer "appears" to capture a successful message but, would be misleading if the correct data message has those highs in it.

    ok. I see that. Hope the R263 is not populated now. 

  • RESET_N on the PHY is showing 3.29 volts, so high, meaning reset is not active.

    We have tested several configurations regarding the pullup resistors:

    Originally R263 was populated this was showing contention

    Then R263 removed and R275 populated, continued to see contention, switched software settings on MDIO pin from GPIO_PIN_TYPE_STD, to GPIO_PIN_TYPE_OD_WPU, and then GPIO_PIN_TYPE_OD with no luck.

    And now we have removed R275 and made software pin type changes with no luck.

    If you could highlight and confirm what hardware/software configuration should work? and I can try those again to confirm.