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.

TIDM-CAPTIVATE-MSP432: Assistance Required for Interfacing DP83869 PHY with MSP432P401R LaunchPad.

Other Parts Discussed in Thread: DP83869

Tool/software:

Dear TI Support Team,

I am working on a project involving the interfacing of the DP83869 Ethernet PHY with the MSP432P401R LaunchPad. I am encountering issues when attempting to read the PHY address, consistently receiving "FFFF" as the output. Below are the details of my setup and the steps I have taken so far:

Hardware Configuration:

  1. Ethernet PHY: DP83869
  2. Microcontroller: MSP432P401R
  3. Development Board: MSP432P401R LaunchPad

Connections:

  • The DP83869 is connected to the MSP432P401R via the MII/MDIO interface.
  • MDIO is connected to the P2.7 on the MSP432P401R.
  • MDC is connected to the P2.6 on the MSP432P401R.
  • Power and ground connections are properly established.

Software Configuration:

  • Using TI’s driver libraries for MSP432P401R.
  • MDIO and MDC pins are configured as per the datasheet requirements.
  • Attempting to read the PHY identifier registers to determine the PHY address.

Issue Description:

  • When reading the PHY identifier registers, I consistently receive "FFFF" as the output.
  • I have verified the connections and ensured that the MDIO and MDC signals are correctly set up.

Steps Taken:

  1. Initialized the MII/MDIO interface using the TI driver library functions.
  2. Configured the PHY address as 0x01 based on initial assumptions.
  3. Attempted to read the PHY identifier registers (specifically registers 0x02 and 0x03).
  4. Consistently receiving "FFFF" as the response from the PHY identifier registers.

Specific Questions:

  1. Could you confirm the correct procedure to read the PHY identifier registers for the DP83869?
  2. Are there any specific initialization steps or configurations required for the DP83869 to respond correctly to MDIO read requests?
  3. Could you provide any example code or application notes that specifically address interfacing the DP83869 with the MSP432P401R?
  4. Are there any known issues or additional configurations needed for the DP83869 when used with the MSP432P401R?

Additional Information:

  • I have referred to the DP83869 datasheet and application notes, but have not been able to resolve the issue.
  • If needed, I can provide scope traces of the MDIO and MDC signals for further analysis.

                     Here I  have given my code for Your reference.

#include "ti/devices/msp432p4xx/inc/msp.h"
#include "ti/devices/msp432p4xx/inc/msp432p401r.h"
#include "ti/devices/msp432p4xx/inc/msp.h"
#include "ti/devices/msp432p4xx/driverlib/driverlib.h"
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <NoRTOS.h>
#include <ti/drivers/Board.h>
#include <ti/drivers/GPIO.h>
#include <ti/drivers/UART.h>
#include "ti_drivers_config.h"
#include "ti/devices/msp432p4xx/driverlib/gpio.h"

#define MDC_PIN BIT6 // P2.6
#define MDIO_PIN BIT7 // P2.7
#define GPIO_PORT GPIO_PORT_P2

int PhyReadData = 0;

/*
* ======== main ========
*/
void SysTick_delay(uint32_t delay_ms) {
uint32_t delay_cycles = (3000000 / 1000) * delay_ms;
SysTick->LOAD = delay_cycles - 1;
SysTick->VAL = 0;
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | SysTick_CTRL_ENABLE_Msk;
while ((SysTick->CTRL & SysTick_CTRL_COUNTFLAG_Msk) == 0);
SysTick->CTRL = 0;
}

void mdcPulse() {
GPIO_setOutputHighOnPin(GPIO_PORT, MDC_PIN);
SysTick_delay(100);
GPIO_setOutputLowOnPin(GPIO_PORT, MDC_PIN);
SysTick_delay(100);
}

void writeMDIOBit(int bit) {
if (bit) {
GPIO_setAsOutputPin(GPIO_PORT, MDIO_PIN);
GPIO_setOutputHighOnPin(GPIO_PORT, MDIO_PIN);
} else {
GPIO_setAsOutputPin(GPIO_PORT, MDIO_PIN);
GPIO_setOutputLowOnPin(GPIO_PORT, MDIO_PIN);
}
mdcPulse();
}

int readMDIOBit() {
int bit;
GPIO_setAsInputPin(GPIO_PORT, MDIO_PIN);
mdcPulse();
bit = GPIO_getInputPinValue(GPIO_PORT, MDIO_PIN);
return bit;
}

void writePHYRegister(int phyAddr, int regAddr, int data) {
int i;
for (i = 0; i < 32; i++) writeMDIOBit(1); // Preamble
writeMDIOBit(0);
writeMDIOBit(1);
writeMDIOBit(0);
writeMDIOBit(1);

for (i = 4; i >= 0; i--) writeMDIOBit((phyAddr >> i) & 0x01);
for (i = 4; i >= 0; i--) writeMDIOBit((regAddr >> i) & 0x01);

writeMDIOBit(1);
writeMDIOBit(0);

for (i = 15; i >= 0; i--) writeMDIOBit((data >> i) & 0x01);
}

int readPHYRegister(int phyAddr, int regAddr) {
int i;
for (i = 0; i < 32; i++) writeMDIOBit(1); // Preamble
writeMDIOBit(0);
writeMDIOBit(1);
writeMDIOBit(1);
writeMDIOBit(0);

for (i = 4; i >= 0; i--) writeMDIOBit((phyAddr >> i) & 0x01);
for (i = 4; i >= 0; i--) writeMDIOBit((regAddr >> i) & 0x01);

writeMDIOBit(1);
writeMDIOBit(0);

for (i = 15; i >= 0; i--) {
PhyReadData <<= 1;
PhyReadData |= readMDIOBit();
}

return PhyReadData;
}

int main(void)
{
char input;
const char echoPrompt[] = "WELCOME TO PODS TCIM DE TEST:\r\n";
UART_Handle uart;
UART_Params uartParams;

Board_init();
NoRTOS_start();
GPIO_init();
UART_init();

GPIO_setConfig(CONFIG_GPIO_LED_0, GPIO_CFG_OUT_STD | GPIO_CFG_OUT_LOW);
GPIO_write(CONFIG_GPIO_LED_0, CONFIG_GPIO_LED_ON);

UART_Params_init(&uartParams);
uartParams.writeDataMode = UART_DATA_BINARY;
uartParams.readDataMode = UART_DATA_BINARY;
uartParams.readReturnMode = UART_RETURN_FULL;
uartParams.readEcho = UART_ECHO_OFF;
uartParams.baudRate = 115200;

uart = UART_open(CONFIG_UART_0, &uartParams);
if (uart == NULL) {
while (1);
}

UART_write(uart, echoPrompt, sizeof(echoPrompt));

WDT_A->CTL = WDT_A_CTL_PW | WDT_A_CTL_HOLD;

GPIO_setAsOutputPin(GPIO_PORT, MDC_PIN);
GPIO_setAsInputPin(GPIO_PORT, MDIO_PIN);
GPIO_setOutputHighOnPin(GPIO_PORT, MDC_PIN);

// writePHYRegister(0, 0x00, 0x8000); // Reset the PHY (assuming PHY address 0)

int phyID1 = readPHYRegister(0, 0x31); // Read PHYIDR1
int phyID2 = readPHYRegister(0, 0x31); // Read PHYIDR2

char phyID1_str[10];
char phyID2_str[10];
snprintf(phyID1_str, 10, "%x\n", phyID1);
snprintf(phyID2_str, 10, "%x\n", phyID2);

UART_write(uart, (const uint8_t*)phyID1_str, sizeof(phyID1_str));
UART_write(uart, (const uint8_t*)phyID2_str, sizeof(phyID2_str));
printf("\nPhyID1:%x\nPhyID2:%x\n", phyID1, phyID2);

return 0;
}

Thank you for your assistance. I look forward to your guidance on resolving this issue.

  • Hi,

      Please note that MSP432P is a EOL device. You can't even find this device on ti.com. I will suggest you look at alternative MCU such as TM4C123/TM4C129 MCU. As far as your code is presenting, it seems like you are using some bit-bang method for MDIO/MDC. Where did you get the writeMDIOBit, writePHYRegister and readPHYRegister. I don't think MSP432P SDK provides these functions albeit the device is EOL and no longer supported. If these are functions you get from DP83869 then I will suggest you contact the experts of the respective forum group there for support or I can transfer your post. 

  • Dear charles,

                        Thank you for your reply.

    I took these functions from the internet and using bit banging method to read and write the PHY but it was not happening.can you suggest if i want to read the PHY registers what are the different ways are there.

    Can you share any link or code  for  Reading PHY address and accessing(Read/Write) the PHY registers that will be very great full for solving the Issue.  

  • Hi,

    I took these functions from the internet and using bit banging method to read and write the PHY

    Sorry, I cannot support your internet code. I will suggest you look at the waveform on a scope or logic analyzer for the MDIO and MDC signals. Compare your signals with a reference MDC/MDIO waveform. Wikipedia has a simple example waveform. See https://en.wikipedia.org/wiki/Management_Data_Input/Output. You can certainly find more example waveforms on line if you do some search. Start with the basics. Do you even see any signals coming out of P2.6 and P2.7? Perhaps, start with something that is simple first, can you even toggle P2.6 and P2.7 to produce a square waveform? This is to make sure the device is properly initialized to begin with. 

**Attention** This is a public forum