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.

TMS320F28388S: EtherCAT with DP83826 and 28388S

Part Number: TMS320F28388S
Other Parts Discussed in Thread: TMDSCNCD28388D

Hello Team,

Posting on behalf of customer:

Hi,

I designed the EtherCAT module with 28388S and DP83826.

 - Current status

My custom board is connected via TwinCAT.

But the connection is strange.

Port A is changing between open and close.

DL status is change between 5507 and 5617.

 - ESC_readWord(0x0110U)  -> 5507x or 5617x

 I checked with TMDSCNCD28388D.

So I think the code is right if pin configuration is right.

 - Question 1

Is there a something to change from 28388D to 28388s in the code?

 -Question 2

Could you check the strap configuration?

I attached the circuit.

TABLE3-4 (SNLA344b.pdf) was referenced.

Strap 0 -> 0 : pull-down

Strap 1 -> 0 : pull-down

Strap 2 -> 0 : pull-down

Strap 3 -> 0 : pull-down

Strap 4 -> 0 : pull-down

Strap 5 -> 0 : pull-down

Strap 6 -> 1 : pull-up

Strap 7 -> 1 : pull-up

Strap 8 -> 1 : pull-up

Strap 9 -> 0 : pull-down

Strap 10 -> 0 : pull-down

Pin1             : pull-up

attachment (2).zip

Regards,

Renan

  • Hi Renan,

    Is there a something to change from 28388D to 28388s in the code?

    No, there shouldn't be any difference. Which core do you have EtherCAT allocated to?

    Could you check the strap configuration?

    The strap states you list look right. I didn't do a thorough look at your schematic to see if it matches however.

    From Beckhoff's material:

    Best,

    Kevin

  • Hello Kevin,

    Please see my customer response below:

    Which core do you have EtherCAT allocated to?
    --> CPU1 was used. It has 176pins. So I change the pins for 176 pins.

    In enhance mode, PIN31 is LED1 and strap1.
    I put the pull-down resistor on the pin31 for strap1.
    I think LED1 is indication ths status
    So, LED was not placed for pin31.

    Is it essential to use LED on the PIN 31?

    Could you check the schematic of PHY?

    Regards,

    Renan

  • Hi Renan,

    Is it essential to use LED on the PIN 31?

    No, I believe this is optional still.

    Could you check the schematic of PHY?

    The schematic looks OK to me (from C2000 point of view). I will see if someone from the Ethernet PHY team can take a look.

    What kind of 25 MHz clock source are you using to your PHYs and F2838x device? Please explain the circuitry for this clocking.

    Best,

    Kevin

  • Hi Renan,

    Can customer go through the attached schematic checklist for DP83826 and share it here ? I will review customers comments and provide my feedback.

    Thanks,
    Rahul

    DP83826_Schematic_Design_Review_Checklist.xlsx

  • Hello Rahul,

    Good day, please see response from my customer:

    What kind of 25 MHz clock source are you using to your PHYs and F2838x device? Please explain the circuitry for this clocking
    --> oscillator and clock buffer are used.

    I attached the MCU and clock schematics.


    Can customer go through the attached schematic checklist for DP83826 and share it here ? I will review customers comments and provide my feedback.
    --> I attached the checklist file.

    1348.DP83826_Schematic_Design_Review_Checklist_Answer.zip

    Regards,

    Renan

  • Hi Renan,

    Thank you for sharing the schematics and checklist file, I will review them and update you by end of this week.

    Thanks,
    Rahul

  • Hello Rahul,

    Any update?

    Regards,

    Renan

  • Hi Renan,

    Apologies for the delay, I am currently out of office. I will review your schematic and respond on Wednesday.

    Thank you for your patience.

    Regards,
    Rahul

  • Hello Rahul,

    Any update?

    Regards,

    Renan

  • Hi Renan,

    Apologies for the delay, I went through the schematics and the checklist - everything looks good.

    Can the registers of the PHY be read in this setup?

    Regards,
    Rahul

  • Hello Rahul,

    Good day and I apologize for this late update. My customer just got back in the office and provided the feedback below:

    Can the registers of the PHY be read in this setup?
    --> I can not read the register of the PHY.
    Is it possible to read the register of the PHY with 28388S?
    I folllwed the method according to thread
    https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1034794/tms320f28388d-how-to-access-write-read-the-phy-register-using-mdc-mdio-interface-within-esc-peripheral-of-28388

    Regards,

    Renan

  • Hi Renan,

    Yes, you can read the PHY registers using MDC/MDIO bus of 28388S. I will redirect this thread back to C2000 team for help.

    Regards,
    Rahul

  • Hi Renan,

    The code snippet I provided in the past was for reading / writing PHY registers when running from CM core, which is 8-bit (byte) addressable. The C28 core for CPU1 is 16-bit (word) addressable, so this needs to be considered. all the ESC registers in Beckhoff's datasheet are in terms of 8-bit bytes.

    It has been some time since I've tested this with CPU1, but I do have the functions attached that should help with reading / writing.

    #define ESC_MII_CTRL_STATUS_1_OFFSET         0x0510 // 0x288 - Low
    #define ESC_MII_CTRL_STATUS_2_OFFSET         0x0511 // 0x288 - High
    #define ESC_PHY_ADDRESS_OFFSET               0x0512 // 0x289 - Low
    #define ESC_PHY_REG_ADDRESS_OFFSET           0x0513 // 0x289 - High
    #define ESC_PHY_DATA_OFFSET                  0x0514 // 0x28A - Low
    #define ESC_MII_ECAT_ACCESS_OFFSET           0x0516 // 0x28B - Low
    #define ESC_MII_PDI_ACCESS_OFFSET            0x0517 // 0x28B - High
    
    //
    // Function for writing to a ESC PHY register using CPU1 -
    //      Assumes Word and address are 16-bit values
    //
    void write_ESC_PHY_CPU1(uint16_t word, uint16_t address)
    {
        // Set PHY address to read/write, (0x0512//0x289 low)
        ESC_writeWordISR(address, ESC_PHY_ADDRESS_OFFSET);
    
        // Set the value to write to PHY register, (0x0514//0x28A low)
        HW_EscWriteWord(word, ESC_PHY_DATA_OFFSET);
    
        // Write PHY reg, (0x0510//0x288 low)
        HW_EscWriteWord(0x0200,ESC_MII_CTRL_STATUS_1_OFFSET);
    
        return;
    }
    
    //
    // Function for reading from an ESC PHY register using CPU1 -
    //      Assumes Word and address are 16-bit values
    //
    void read_ESC_PHY_CPU1(uint16_t word, uint16_t address)
    {
        // Set PHY address to read/write, (0x0512//0x289 low)
        ESC_writeWordISR(address, ESC_PHY_ADDRESS_OFFSET);
    
        // Write PHY reg, (0x0510//0x288 low)
        HW_EscWriteWord(0x0100,ESC_MII_CTRL_STATUS_1_OFFSET);
    
        return;
    }

    Best,

    Kevin

  • Hello Kevin,

    Good day. Please see response from my customer:

    I tried to read the phy regiter with your code snippet.

    write_ESC_PHY_CPU1(0x01,ESC_MII_PDI_ACCESS_OFFSET); // PDI access to MII management
    write_ESC_PHY_CPU1(0x0A,ESC_PHY_REG_ADDRESS_OFFSET); // Set Phy register to read/write
    read_ESC_PHY_CPU1(0x01,ESC_MII_CTRL_STATUS_2_OFFSET); // Read Phy reg

    But there is no return value of funtion of read_ESC_PHY_CPU1.
    So I tried "ESC_readWord(0x0518U)"
    But there is no value.
    How can I read and write the phy regiter status?

    Regards,

    Renan

  • Hi Renan,

    I tried to read the phy regiter with your code snippet.

    The code snippet I provided is not being used properly. It handles most of what you've written within the functions already.

    Please review the Beckhoff ESC datasheet registers section MII Management Interface (0x0510:0x0515) to make sense of the register write sequences.

    https://download.beckhoff.com/download/document/io/ethercat-development-products/ethercat_esc_datasheet_sec2_registers_2i9.pdf

    The ESC register below is used for both writing to the PHY registers and reading their values. If reading from the PHY register you should use a read function at this address.

    Best,

    Kevin