SSZT442 July   2019 TMS320F28388D

 

  1.   1
  2.   2
    1.     3
    2.     Getting Started
    3.     Validating Operation and Connections
    4.     Evaluating the EtherCAT Slave-node Solution
    5.     Creating Your Own EtherCAT Slave-node Solution

Christopher Chiarella

GUID-1EA5E38B-AFCF-452C-9294-CF55BF2D5C7A-low.jpg

Part 1 of this blog series gave an overview of the market opportunities for EtherCAT slave stack support on C2000™ microcontrollers (MCUs) and an introduction to a three-phased solution to jump-start slave stack development. Part 2 detailed what’s different and compelling about the TI C2000 MCU EtherCAT implementation. Part 3 broke down the three phases of development for your own slave-node application using the EtherCAT slave and C2000 Delfino MCU controlCARD kit, and how the TI EtherCAT package in C2000 controlSUITE™ software supports each phase. In part 4 of this series, I will step through the development of your own EtherCAT slave controller using the latest C2000 TMS320F28388D real-time controller.

The C2000 F28388D MCU has the EtherCAT peripheral from Beckhoff integrated onto the chip. The EtherCAT peripheral ownership can be allocated to CPU1 or CM. To support this, a set of software solutions have been released into C2000Ware, the software package for C2000 MCUs. These F28388D EtherCAT software solutions will help you:

  • Validate the correct EtherCAT operation of your F28388D ControlCARD or custom F28388D board.
  • Evaluate the EtherCAT slave stack and create a slave-node application using the F28388D.

Getting Started

To get started evaluating and experimenting with EtherCAT on F28388D, you’ll need to download and install:

  • C2000Ware – contains all of the EtherCAT software for the F28388D.
  • EtherCAT Master Software (Select one from below)

For F28388D EtherCAT example code and more detailed usage documentation beyond what is described here, navigate within C2000Ware to ~\C2000Ware_X_XX_XX_XX\libraries\communications\Ethercat\f2838x.

Validating Operation and Connections

The F28388D EtherCAT software solution includes a set of hardware abstraction layer (HAL) test applications (one for CPU1 and one for CM) that exercise the ASYNC16 processor data interface (PDI) between the EtherCAT subsystem and device central processing unit in order to perform a series of reads and writes to EtherCAT registers and memory. The software stack for this application is detailed in Figure 1. Additionally, these applications include checks to confirm that the device’s electrically erasable programmable read-only memory (EEPROM) is programmed with the required minimum set of data that EtherCAT needs.

GUID-2E7172A3-2A2A-4218-8334-C2813D30D5AC-low.png Figure 1 F28388D EtherCAT HAL test application

You don’t need the EtherCAT slave stack to perform this validation. Once you’ve loaded this application onto the device, an EtherCAT master will be able to identify the EtherCAT slave controller on the network, which will confirm that the physical interfaces are working. From here, you can program the EEPROM for the EtherCAT slave and then rerun the application to perform the PDI checks described earlier.

Evaluating the EtherCAT Slave-node Solution

The F28388D EtherCAT software solution includes both an EtherCAT slave demo as well as a reference solution. Both include a variant for running from CPU1 or from CM.

The EtherCAT slave demo application is a simple “echoback” example, where data sent from the EtherCAT master is received by the EtherCAT slave controller and sent back to the master. The demo application software stack is depicted in Figure 2. Using the TwinCAT PC software for the EtherCAT master node, you can set up a multinode EtherCAT network in minutes on your bench.

GUID-6F27EBAE-49E2-4809-BD50-F3E422E64FCC-low.png Figure 2 F28388D EtherCAT Echoback Demo App

The demo application is provided as a binary image and is configured for the F28388D controlCARD. The EtherCAT slave stack is integrated into the image; therefore, you don’t need to generate the slave stack code yourself. All you need to do is program the F28388D controlCARD with the application and connect a CAT5 cable from the controlCARD to the EtherCAT master (in this case, TwinCAT PC/PLC).

Creating Your Own EtherCAT Slave-node Solution

After evaluating using the EtherCAT slave demo application, the F28388D EtherCAT software includes a reference solution for creating your own slave-node application.

The EtherCAT slave reference solution is setup to perform the same echoback functionality as the demo. This solution, however, includes all of the necessary source code (except for the EtherCAT slave stack itself) for debugging the solution and developing it into your own application. Figure 3 details the software stack for the solution. You can obtain the EtherCAT slave stack code through the EtherCAT Technology Group’s (ETG) slave stack code (SSC) ET9300 tool.

GUID-FFFAEA08-3634-4E49-A60F-EB1502946AA5-low.png Figure 3 F28388D EtherCAT echoback solution with the ETG slave stack

To generate slave stack code for F28388D devices, a configuration file is provided within the F28388D EtherCAT software solution package that, once imported into the SSC tool, will make the F28388D stack configurations available via the tool’s drop-down menu. Upon selection of a configuration, the tool will generate the slave stack source code for integrating into the solution. The F28388D EtherCAT software usage documentation within C2000Ware provides further details.

Once the slave stack is generated and linked into the F28388D EtherCAT slave reference solution, you’re ready to start running the solution and developing it into your own EtherCAT slave application.

Download C2000Ware today and jump-start your development of an EtherCAT slave controller with the C2000 F28388D MCU.

Additional resources: