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.

TMDSCNCD28379D: Ethercat : TMDSCNCD28379D and FB111-0141 piggyback

Part Number: TMDSCNCD28379D
Other Parts Discussed in Thread: AMIC110

Hi,

I'm new with EtherCAT protocol, and I try communication between a F28379D control board and a Beckhoff piggyback.

I have many questions :

  • First one is a hardware question :


    Is this mandatory to connect /IRQ and EEPROM_Loaded from the ET1100 ? I've read on Piggyback datasheet that it wasn't mandatory..

    If yes, on which GPIO have I to connect these 2 signals ? 

    Currently, these signals are available on TMDSCNCD28379D, but I'll use later a TMS320F28379D in PTP package, so GPIO119 & GPIO136 won't be available.

  • Software question :

    I've follow SPRUIF9 app notes to execute a simple EtherCAT communication.

    - TwinCAT found the piggyback ; I can write on the EEPROM, but which binary file have I to write ?

                          - The piggyback binary file for SPI (FB1111 SPI-Slave 2xMII (FB1111-0141-0601))
                          - Or I have to create a binary file linked to the F28379D with the SSC Tool ? (in the picture below, I've created a binary file for the TMDSECATCNCD379D, but I don't use this board, it was just to try)

On TwinCAT, I'm INIT mode. But I've read on other topics it was ok, because I am not running an EtherCAT slave stack on the MCU yet, is that right ?

When I execute pdi_hal_test_app on CCS, nothing happens :

  • Do I need to connect also SYNC0 and SYNC1 ?

    In etherCAT_slave_c28x_hal.h, I've found :

            #define ESC_SPI_INT_GPIO            136
    
            //on ET1100 it is 8KB of RAM
            #define ESC_PDI_RAM_START_ADDRESS_OFFSET    0x1000
            #define ESC_PDI_RAM_END_ADDRESS_OFFSET      0x2FFF
    
            #define ESC_SYNC0_GPIO              113
            #define ESC_SYNC1_GPIO              114
            #define ESC_RESET_ET1100_GPIO       137
            #define ESC_EEPROM_LOADED_GPIO      119

    I need to modify these line ?

    I had a look with the oscilloscope, I have no SPI signals.

    When I want to read value in the memory browser, I cannot find "escRegs" ; what's the address ?

    Thank you, regards.

EDIT : 

I've made some modifications :

  • I've connected EEPROMLOADED signal to GPIO53
  • I've connected SPI_INTsignal to GPIO43

In etherCAT_slave_c28x_hal.h, I've modified :

//#define ESC_SPI_INT_GPIO            136
#define ESC_SPI_INT_GPIO            43

//on ET1100 it is 8KB of RAM
#define ESC_PDI_RAM_START_ADDRESS_OFFSET    0x1000
#define ESC_PDI_RAM_END_ADDRESS_OFFSET      0x2FFF

#define ESC_SYNC0_GPIO              113
#define ESC_SYNC1_GPIO              114
#define ESC_RESET_ET1100_GPIO       137

//#define ESC_EEPROM_LOADED_GPIO      119
#define ESC_EEPROM_LOADED_GPIO      53

But nothing has changed, I've still haven't SPI signals on oscilloscope, and I can't find "escRegs" on the memory Browser ; what is it address ?

Thank you,

Regards

  • Hi,

    I am forwarding this query to our SW expert

    Regards,
    Praveen

  • Hi,

    Any update ?

    I still have the same issue, not signal on SPI bus ; and of course I've modified the Predefined Symbol to use SPIA :

    Other question : is it working if I use the same laptop for TwinCAT and Code Composer ?

    EDIT :

    • When I'm launch the program, I can see a quick SPI frame (with 20MHz clock) at the beginning.
    • 2 leds of the TMDSCNCD28379D are blinking, I'm blocked in this loop I guess : 

    Regards,

  • Hi,

    Can you confirm that you are using TMDSECATCNCD379D hardware kit and what mode (EMIF/SPI) you have set the board up? Twincat and CCS can run on same machine, but Twincat may require ethernet adapters that are compatible which it asks during installation.

    You should use the EEPROM file according to the connectivity option you have chosen - EMIF/SPI

    My understanding is that you need not connect SYNC0/1 unless you want to monitor sync signals.

    Thanks

  • Hello Ranjith,

    As described in the title, I don't use TMDSECATCNCD379D hardware kit. I'm using TMDSCNCD28379D daughter card and FB1111-0141 piggyback (SPI).

    You didn't answer some questions I asked :

    • Is this mandatory to connect /IRQ and EEPROM_Loaded from the ET1100 ? I've read on Piggyback datasheet that it wasn't mandatory.
      If yes, on which GPIO have I to connect these 2 signals ? Does it works with every GPIO ?

    • I can write on the EEPROM, but which binary file have I to write ? File provided by Beckhoff for the FB1111-0141 piggyback ?

    • When I want to read value in the memory browser, I cannot find "escRegs" ; what's the address ?
    • What can I check to solve the issue ?
    • In the function void ESC_readSPI(uint16_t offset_addr,uint16_t numbytes, uint16_t* buffer), why GPIO22 is used ?

    Regards,

  • Hi,

    Please see my responses inline.

    • Is this mandatory to connect /IRQ and EEPROM_Loaded from the ET1100 ? I've read on Piggyback datasheet that it wasn't mandatory.
      If yes, on which GPIO have I to connect these 2 signals ? Does it works with every GPIO ?

    >> SPI_IRQ and EEPROM_Loaded are connected to GPIO136 and GPIO119 respectively on the TI kit. Figure 8 in SPRA1F9 shows this.

    • I can write on the EEPROM, but which binary file have I to write ? File provided by Beckhoff for the FB1111-0141 piggyback ?

    >> The EEPROM content defines ESC and PDI configuration, hence the MCU software need to be in sync. The TI provided EEPROM binary for SPI is matched to the configuration and MCU host software. If FB1111-0141 configuration is very similar, you can try the TI provided EEPROM binary, if not you may have

    • When I want to read value in the memory browser, I cannot find "escRegs" ; what's the address ?

    >> If you are referring to reading escRegs through CCS, it is not a direct memory mapped region. The ESC is mapped as an SPI slave from the MCU side

    • What can I check to solve the issue ?

    >> Keeping the configuration and connectivity similar to  TMDSECATCNCD379D hardware kit may help during initial debug. The SPI read/write access to ESC from MCU should be functional

    • In the function void ESC_readSPI(uint16_t offset_addr,uint16_t numbytes, uint16_t* buffer), why GPIO22 is used ?

    >> Will have to re-check the code, probably this is SPI chip select over GPIO

     

    Thanks,

     

  • Hi,

    • SPI_IRQ and EEPROM_Loaded are connected to GPIO136 and GPIO119 respectively on the TI kit. Figure 8 in SPRA1F9 shows this.

    Currently, these signals are available on TMDSCNCD28379D, but I'll use later a TMS320F28379D in PTP package, so GPIO119 & GPIO136 won't be available.
    Does it works with every GPIO ?

  • As I explained before, I've made some modifications :

    • I've connected EEPROMLOADED signal to GPIO53
    • I've connected SPI_INTsignal to GPIO43

    I've modified also etherCAT_slave_c28x_hal.h.

    I scoped also SPI signals, there're not very clean.

    In the software, it seems the register ii reaches the value 0x100 and then function ESC_signalFail is triggered.

    Any idea ?

  • To resume : 

    • In the "Predefined Symbols", I changed from USE_SPIA

    • Hardware connections :

      • EEPROM LOADED -> GPIO 53
      • SPI_INT  -> GPIO 43
      • SYNC0 -> GPIO 54
      • SYNC1 -> GPIO 55 
      • ESC_RESET_ET1100_GPIO -> Not connected

      • SPI_SEL A  -> GPIO 19
      • SPI_CLK A  -> GPIO 18
      • SPI_DO A  -> GPIO 17
      • SPI_DI A  -> GPIO 16
      • GNDs and 5V supply

    • When writing in memory, I've tried FB1111-0141 binary file, and then TMDSECATCNCD379D binary file ; changes nothing.

    Do you know why the program stops at the specific do-loop mentioned in the previous question ?

  • Hello,

    Have you already referenced the "TMDSECATCNCD379D EtherCAT® Solution Reference Guide" (SPRUIG9)? It documents generating and using the SSC sources for the C28x and is meant to accompany the SPRUIF9 document. It might include some detailed steps your missing to properly run the solutions.

    https://www.ti.com/lit/spruig9

    I'd recommend getting the sample solutions provided to work on your current hardware before changing / removing signals.

    Best,

    Kevin

  • When you say the SPI signals are not very clean? What do you mean exactly?

  • Hello Gus,

    This is SPI_CLK and SPIMOSI signals :

    This is SPI_CLK and SPIMISO signals :

    When I execute void ESC_readSPI function (in ESC_setupPDITestInterface() ), SpixRegs->SPIRXBUF is empty, that means we receive no / bad datas ?

    Maybe we can reduce the frequency ?

    Regards,

  • I've used pdi_test_app_spi.bin, as explained in SPRUIF9, but it doesn't work :

    What's the difference between a binary file (.bin) and a xml file ?

    Regards,

  • Hi,

    So as explained SPRUIF9, I used pdi_test_app_spi.bin, and I used a better shielded cable to connect F28379D to FB1111-0141 piggyback.

    Now, the program doesn't stops anymore in the specific do-loop mentioned in the previous question. Maybe the issue came from the SPI signal due to the first cable I used.

    Just to confirm, can we use all GPIO's for SPI_INIT and EEPROM_LOADED signals ?

    Regards,

  • Hi,

    Following SPRUIF9 and SPRUIG9, TMDSECATCNCD379D_PDI_HAL_API and TMDSECATCNCD379D_EtherCAT_Solution_Ref software's are working.

    I have last questions :

    • I want to develop my own EtherCAT application (a very simple communication between the FB1111-0141 and the F28379D microcontroller) ;  is the easiest way to start with TMDSECATCNCD379D_EtherCAT_Solution_Ref  and modify it ?

    • Do you have any files to help to develop this kind of application ? Because it's very difficult to understand how the CCS software works and the link between both software's (CCS and TwinCAT)

    Regards,

  • Florian,

    Due to inclement weather in our region, many of our subject matter experts(including both Gus and Kevin) are without power and unable to provide support at this time. 

    An expert will get back to you as soon as possible but it likely will not be until next week.

    Best,

    Matthew

  • Hello,

    Sorry for the late response. Things are getting back to normal now with the weather/power issues.

    Good to hear you got the solutions working now with the two guides as reference. Answers and suggestions to your questions below:

    electrocc said:
    I want to develop my own EtherCAT application (a very simple communication between the FB1111-0141 and the F28379D microcontroller) ;  is the easiest way to start with TMDSECATCNCD379D_EtherCAT_Solution_Ref  and modify it ?

    Yes, the solution you're referencing will be the best option we have to offer for interfacing with the ET1100 and FB1111 board you have. If you're open to options other than the ET1100 for your EtherCAT slave controller, there are some options we provide below:

    electrocc said:
    Do you have any files to help to develop this kind of application ? Because it's very difficult to understand how the CCS software works and the link between both software's (CCS and TwinCAT)
    I don't believe there are any additional files or documents for interfacing with the ET1100, other than what you're already referencing.
    Best,
    Kevin
  • Hello Kevin,

    Hope the weather is better in your region.

    Thanks for the answers ; I have last questions : when using TMDSECATCNCD379D_EtherCAT_Solution_Ref software and the .xml file generated for the TMDSECATCNCD379D board (with SSC), is it possible to provide me the .xlsx file generated to see how the application was done ?

    Concerning indexs in the .xlsx file, where can I find description of all ot them? (for example : Input Data of the Module (0x6000 - 0x6FFF) )

    Is there a link between Index and registers address ?

    Thank you.

    Regards

  • Hello,

    I had replied to this yesterday, but I no longer see my post here. Some error must have happened, sorry about that.

    What is the generated .xlsx file you're asking about? You should be able to generate any necessary files on your end following SPRUIG9.

    electrocc said:
    Is there a link between Index and registers address ?

    You're asking about the ESC Register Addresses and what you see in twinCAT? I'm not certain about the link between these, but seeing how the ESC Regs change in the CCS memory browser, like below, may provide some explanation while testing.

    Best,

    Kevin

  • Hello,

    As I explained before, "TMDSECATCNCD379D_EtherCAT_Solution_Ref" is working. Now I want to develop my own application.

    In SSC, I used this configuration (see below) and create a new application (.xlsx file), same than in SPRUIG9 (sheet 21-22).

    In TwinCAT, state is "OP", so it's working. I can modify values in TwinCAT, values are changing on CCS.

    But I have these messages, what is it ?

    Regards

  • Hello,

    When do you receive the error messages while running? The SyncManager Watchdog is on the ET1100 side, which looks like it may be timing out and getting triggered. I'd suggest you review the respective Beckhoff documentation for the ET1100 and TwinCAT.

    Some links for you below:

    ET1100 Datasheet: https://download.beckhoff.com/download/document/io/ethercat-development-products/ethercat_et1100_datasheet_v1i9.pdf

    TwinCAT state Machine Doc: https://infosys.beckhoff.com/english.php?content=../content/1033/tc3_c/2491169163.html&id=

    Best,

    Kevin

  • Hello Kevin,

    As I explained before, I've created a new application (.xlsx file), same than in SPRUIG9 (sheet 21-22). Except the message above on TwinCAT, it worked.

    I've created a new application, based on the previous one. I've just modified the number of inputs and outputs :

          - Old application : Input data : 8 bits, 2 words (16b) and 1 dword (32bits) / Output data : 8 bits, 2 words (16b) and 1 dword (32bits)
          - New application : Input data : 2 bits, 2 words (16b)  / Output data : 2 bits, 2 words (16b)

    So I've created a new .xml file, and I've modified .c and .h files.

    But now, I have an issue on TwinCAT : 

    'SAFEOP to OP' failed! Error: 'check device state for OP'. AL Status '0x0014' read and '0x0008' expected. AL Status Code '0x001b - Sync manager watchdog'	

    Do you know what's the problem is ?

    Thank you.

    Regards,

  • Hello,

    The error code is documented at Beckhoff's page below:

    https://infosys.beckhoff.com/english.php?content=../content/1033/ethercatsystem/1072491019.html&id=

    I'm not sure of the exact solution, something is wrong with the communication where the WD should be getting serviced before the timeout. Did the error happen with the original ET1100 + F2837x solution? And does the error with your new solution occur all the time?

    Best,

    Kevin

  • Hello Kevin,

    - With the original solution, solution works but I just have the message :

    abnormal state change (from 'OP' to 'SAFEOP') with code 0x1b

    - With the new solution, solution doesn't works all the time and I have the message :

    'SAFEOP to OP' failed! Error: 'check device state for OP'. AL Status '0x0014' read and '0x0008' expected. AL Status Code '0x001b - Sync manager watchdog'	

    Regards

  • Hello,

    I'm not sure of the solution to this issue. I think you would be able to get a better answer from the EtherCAT Technology group (ETG). They have a forum you can reference and post on:

    https://www.ethercat.org/default.htm

    Best,

    Kevin