Beckoff Ethercat
Beckoff Ethercat
Slave Controller
Section I – Technology
EtherCAT Protocol, Physical Layer,
EtherCAT Processing Unit, FMMU,
SyncManager, SII EEPROM, Distributed
Clocks
Version 2.2
Date: 2014-07-07
DOCUMENT ORGANIZATION
DOCUMENT ORGANIZATION
The Beckhoff EtherCAT Slave Controller (ESC) documentation covers the following Beckhoff ESCs:
ET1200
ET1100
EtherCAT IP Core for Altera® FPGAs
EtherCAT IP Core for Xilinx® FPGAs
ESC20
The documentation is organized in three sections. Section I and section II are common for all Beckhoff
ESCs, Section III is specific for each ESC variant.
The latest documentation is available at the Beckhoff homepage (http://www.beckhoff.com).
Additional Documentation
Application notes and utilities like pinout configuration tools for ET1100/ET1200 can also be found at
the Beckhoff homepage.
Trademarks
Beckhoff®, TwinCAT®, EtherCAT®, Safety over EtherCAT®, TwinSAFE® and XFC® are registered trademarks of and licensed by
Beckhoff Automation GmbH. Other designations used in this publication may be trademarks whose use by third parties for their
own purposes could violate the rights of the owners.
Patent Pending
The EtherCAT Technology is covered, including but not limited to the following German patent applications and patents:
DE10304637, DE102004044764, DE102005009224, DE102007017835 with corresponding applications or registrations in
various other countries.
Disclaimer
The documentation has been prepared with care. The products described are, however, constantly under development. For that
reason the documentation is not in every case checked for consistency with performance data, standards or other
characteristics. In the event that it contains technical or editorial errors, we retain the right to make alterations at any time and
without warning. No claims for the modification of products that have already been supplied may be made on the basis of the
data, diagrams and descriptions in this documentation.
Copyright
© Beckhoff Automation GmbH 07/2014.
The reproduction, distribution and utilization of this document as well as the communication of its contents to others without
express authorization are prohibited. Offenders will be held liable for the payment of damages. All rights reserved in the event of
the grant of a patent, utility model or design.
DOCUMENT HISTORY
Version Comment
1.0 Initial release
1.1 Chapter Interrupts – AL Event Request: corrected AL Event Mask register
address to 0x0204:0x0207
EtherCAT Datagram: Circulating Frame bit has position 14 (not 13)
PHY addressing configuration changed
Loop control: a port using Auto close mode is automatically opened if a valid
Ethernet frame is received at this port
EEPROM read/write/reload example: steps 1 and 2 swapped
EEPROM: Configured Station Alias (0x0012:0x0013) is only taken over at first
EEPROM load after power-on or reset
SyncManager: Watchdog trigger and interrupt generation in mailbox mode with
single byte buffers requires alternating write and read accesses for some ESCs,
thus buffered mode is required for Digital I/O watchdog trigger generation
National Semiconductor DP83849I Ethernet PHY deprecated because of large
link loss reaction time and delay
Added distinction between permanent ports and Bridge port (frame processing)
Added PDI chapter
PDI and DC Sync/Latch signals are high impedance until the SII EEPROM is
successfully loaded
Editorial changes
1.2 PHY address configuration revised. Refer to Section III for ESC supported
configurations
Added Ethernet Link detection chapter
Added MI Link Detection and Configuration, link detection descriptions updated
Added EEPROM Emulation for EtherCAT IP Core
Added General Purpose Input chapter
Corrected minimum datagram sizes in EtherCAT header figure
Editorial changes
1.2.1 Chapter 5.1.1: incompatible PHYs in footnote 1 deleted
1.3 Added advisory for unused MII/RMII/EBUS ports
Ethernet PHY requirements revised: e.g., configuration by strapping options,
recommendations enhanced. Footnote about compatible PHYs removed,
information has moved to the EtherCAT Slave Controller application note “PHY
Selection Guide”.
Frame Error detection chapter enhanced
FIFO size reduction chapter enhanced
EBUS enhanced link detection chapter enhanced
Ethernet PHY link loss reaction time must be faster than 15 µs, otherwise use
Enhanced link detection
Enhanced link detection description corrected. Enhanced link detection does
not remain active if it is disabled by EEPROM and EBUS handshake frames are
received
ARMW/FRWM commands increase the working counter by 1
Editorial changes
1.4 Update to EtherCAT IP Core Release 2.1.0/2.01a
Added restriction to enhanced link configuration: RX_ER has to be asserted
outside of frames (IEEE802 optional feature)
ESC power-on sequence for IP Core corrected
Removed footnote on tDiff figures, refer to Section III for actual figures
Editorial changes
Version Comment
1.5 EEPROM Read/Write/Reload example: corrected register addresses
Updated/clarified PHY requirements, PHY link loss reaction time is mandatory
Enhanced Link Detection can be configured port-wise depending on ESC
Added DC Activation and DC Activation State features for some ESCs
ESC10 removed
Editorial changes
1.6 Fill reserved EEPROM words of the ESC Configuration Area with 0
Interrupt chapter: example for proper interrupt handling added
Use Position Addressing only for bus scanning at startup and to detect newly
attached devices
System Time PDI controlled: detailed description added
Added MII back-to-back connection example
Renamed Err(x) LED to PERR(x)
Editorial changes
1.7 Link status description enhanced
Clarifications for DC System Time and reference between clocks and registers
Chapter on avoiding unconnected Port 0 configurations added
Direct ESC to standard Ethernet MAC MII connection added
MI link detection and configuration must not be used without LINK_MII signals
Added criteria for detecting when DC synchronization is established
SII EEPROM interface is a point-to-point connection
PHY requirements: PHY startup should not rely on MDC clocking, ESD
tolerance and baseline wander compensation recommendations added
Editorial changes
1.8 Update to EtherCAT IP Core Release 2.3.0/2.03a
EEPROM acknowledge error (0x0502[13]) can also occur for a read access
ERR and STATE LED updated
Editorial changes
1.9 EtherCAT state machine: additional AL status codes defined
EtherCAT protocol: LRD/LRW read data depends on bit mask
Updated EBUS Enhanced Link Detection
Updated FMMU description
Loop control description updated
EtherCAT frame format (VLAN tag) description enhanced
Update to EtherCAT IP Core Release 2.3.2/2.03c
2.0 Update to EtherCAT IP Core Release 2.4.0/2.04a
SII/ESI denotation now consistent with ETG
Updated AL Status codes
Editorial changes
2.1 Update to EtherCAT IP Core Release 3.0.0/3.00a
Update to ET1100-0003 and ET1200-0003
RUN/ERR LED description enhanced
Added RGMII and FX operation
Added Gigabit Ethernet PHY chapter
Updated FIFO size configuration (default from SII)
Updated PHY address configuration
Added PDI register function acknowledge by write
Added propagation delay measurement in reverse mode (especially ET1200)
Enhanced ERR_LED description
Editorial changes
2.2 Update to EtherCAT IP Core Release 3.0.6/3.00g
Added resetting Distributed Clocks Time Loop Control filters to the
synchronization steps
Extended Back-to-Back MII connection schematic
Clarified EBUS standard link detection restrictions
Editorial changes
CONTENTS
1 EtherCAT Slave Controller Overview 1
1.1 EtherCAT Slave Controller Function Blocks 2
1.2 Further Reading on EtherCAT and ESCs 3
1.3 Scope of Section I 3
2 EtherCAT Protocol 4
2.1 EtherCAT Header 4
2.2 EtherCAT Datagram 5
2.3 EtherCAT Addressing Modes 6
2.3.1 Device Addressing 7
2.3.2 Logical Addressing 7
2.4 Working Counter 8
2.5 EtherCAT Command Types 9
3 Frame Processing 12
3.1 Loop Control and Loop State 12
3.2 Frame Processing Order 14
3.3 Permanent Ports and Bridge Port 15
3.4 Shadow Buffer for Register Write Operations 15
3.5 Circulating Frames 15
3.5.1 Unconnected Port 0 16
3.6 Non-EtherCAT Protocols 16
3.7 Special Functions of Port 0 16
4 Physical Layer Common Features 17
4.1 Link Status 17
4.2 Selecting Standard/Enhanced Link Detection 18
4.3 FIFO Size Reduction 19
4.4 Frame Error Detection 19
5 Ethernet Physical Layer 20
5.1 Requirements to Ethernet PHYs 20
5.2 PHY reset and Link partner notification/loop closing 20
5.3 MII Interface 21
5.4 RMII Interface 22
5.5 RGMII Interface 22
5.5.1 RGMII In-Band Link Status 22
5.6 Link Detection 22
5.6.1 LINK_MII Signal 22
5.6.2 MI Link Detection and Configuration 23
5.7 Standard and Enhanced MII Link Detection 23
5.8 EtherCAT over Optical Links (FX) 24
5.8.1 Link partner notification and loop closing 24
TABLES
Table 1: ESC Main Features ................................................................................................................... 1
Table 2: EtherCAT Frame Header........................................................................................................... 4
Table 3: EtherCAT Datagram .................................................................................................................. 6
Table 4: EtherCAT Addressing Modes .................................................................................................... 6
Table 5: Working Counter Increment ...................................................................................................... 8
Table 6: EtherCAT Command Types .................................................................................................... 10
Table 7: EtherCAT Command Details ................................................................................................... 11
Table 8: Registers for Loop Control and Loop/Link Status ................................................................... 13
Table 9: Frame Processing Order ......................................................................................................... 14
Table 10: Link Status Description .......................................................................................................... 17
Table 11: Registers for Enhanced Link Detection ................................................................................. 18
Table 12: Registers for FIFO Size Reduction ........................................................................................ 19
Table 13: Special/Unused MII Interface signals .................................................................................... 21
Table 14: Registers used for Ethernet Link Detection ........................................................................... 22
Table 15: PHY Address configuration matches PHY address settings ................................................. 27
Table 16: PHY Address configuration does not match actual PHY address settings ........................... 27
Table 17: MII Management Interface Register Overview ...................................................................... 28
Table 18: MII Management Interface timing characteristics .................................................................. 29
Table 19: Signals used for Fast Ethernet .............................................................................................. 32
Table 20: EBUS Interface signals ......................................................................................................... 35
Table 21: EBUS timing characteristics .................................................................................................. 36
Table 22: Example FMMU Configuration .............................................................................................. 39
Table 23: SyncManager Register overview ........................................................................................... 41
Table 24: EtherCAT Mailbox Header .................................................................................................... 44
Table 25: Registers for Propagation Delay Measurement .................................................................... 50
Table 26: Parameters for Propagation Delay Calculation ..................................................................... 53
Table 27: Registers for Offset Compensation ....................................................................................... 55
Table 28: Registers for Resetting the Time Control Loop ..................................................................... 56
Table 29: Registers for Drift Compensation .......................................................................................... 57
Table 30: Reference between DC Registers/Functions and Clocks ..................................................... 58
Table 31: Distributed Clocks signals ..................................................................................................... 60
Table 32: SyncSignal Generation Mode Selection ................................................................................ 61
Table 33: Registers for SyncSignal Generation .................................................................................... 62
Table 34: Registers for Latch Input Events ........................................................................................... 65
Table 35: Registers for the EtherCAT State Machine ........................................................................... 71
Table 36: AL Control and AL Status Register Values ........................................................................... 71
Table 37: ESC Configuration Area ........................................................................................................ 73
Table 38: SII EEPROM Content Excerpt ............................................................................................... 74
Table 39: SII EEPROM Interface Register Overview ............................................................................ 74
Table 40: SII EEPROM Interface Errors ................................................................................................ 75
Table 41: I²C EEPROM signals ............................................................................................................. 78
Table 42: EEPROM Size ....................................................................................................................... 78
Table 43: I²C Control Byte ..................................................................................................................... 79
Table 44: I²C Write Access .................................................................................................................... 79
Table 45: I²C Read Access.................................................................................................................... 80
Table 46: EEPROM timing characteristics ............................................................................................ 80
Table 47: Registers for AL Event Request Configuration ..................................................................... 82
Table 48: Registers for ECAT Event Request Configuration ................................................................ 83
Table 49: Registers for Watchdogs ....................................................................................................... 84
Table 50: Error Counter Overview ......................................................................................................... 85
Table 51: Errors Detected by Physical Layer, Auto-Forwarder, and EtherCAT Processing Unit ......... 86
Table 52: RUN LED state indication ...................................................................................................... 87
Table 53: Registers for RUN LED control ............................................................................................. 87
Table 54: Automatic ESC ERR LED state indication ............................................................................ 88
Table 55: Registers for ERR LED control .............................................................................................. 88
Table 56: LINKACT LED States ............................................................................................................ 89
Table 57: Available PDIs depending on ESC ........................................................................................ 91
Table 58: Functions/registers affected by PDI register function acknowledge by write ........................ 92
Table 59: ESC Power-On Sequence ..................................................................................................... 94
Table 60: Registers for Write Protection ............................................................................................... 95
FIGURES
Figure 1: EtherCAT Slave Controller Block Diagram .............................................................................. 1
Figure 2: Ethernet Frame with EtherCAT Data ....................................................................................... 4
Figure 3: EtherCAT Datagram ................................................................................................................. 5
Figure 4: Auto close loop state transitions ............................................................................................ 13
Figure 5: Frame Processing .................................................................................................................. 14
Figure 6: Circulating Frames ................................................................................................................. 15
Figure 7: All frames are dropped because of Circulating Frame Prevention ........................................ 16
Figure 8: Write access ........................................................................................................................... 29
Figure 9: Read access ........................................................................................................................... 29
Figure 10: MII management example schematic .................................................................................. 30
Figure 11: Termination and Grounding Recommendation .................................................................... 31
Figure 12: RJ45 Connector ................................................................................................................... 32
Figure 13: M12 D-code Connector ........................................................................................................ 32
Figure 14: Back-to-Back MII Connection (two ESCs) ........................................................................... 33
Figure 15: Back-to-Back MII Connection (ESC and standard MAC)..................................................... 34
Figure 16: EBUS Interface Signals ........................................................................................................ 35
Figure 17: EBUS Protocol ..................................................................................................................... 36
Figure 18: Example EtherCAT Network ................................................................................................ 37
Figure 19: EBUS Connection ................................................................................................................ 38
Figure 20: FMMU Mapping Principle ..................................................................................................... 39
Figure 21: FMMU Mapping Example ..................................................................................................... 40
Figure 22: SyncManager Buffer allocation ............................................................................................ 42
Figure 23: SyncManager Buffered Mode Interaction............................................................................. 42
Figure 24: SyncManager Mailbox Interaction ........................................................................................ 43
Figure 25: EtherCAT Mailbox Header (for all Types) ............................................................................ 44
Figure 26: Handling of a Repeat Request with Read Mailbox .............................................................. 46
Figure 27: Propagation Delay, Offset, and Drift Compensation ............................................................ 49
Figure 28: Propagation Delay Calculation ............................................................................................. 52
Figure 29: Distributed Clocks signals .................................................................................................... 60
Figure 30: SyncSignal Generation Modes ............................................................................................. 61
Figure 31: SYNC0/1 Cycle Time Examples .......................................................................................... 63
Figure 32: System Time PDI Controlled with three steps ..................................................................... 66
Figure 33: System Time PDI Controlled with two steps ........................................................................ 67
Figure 34: DC Timing Signals in relation to Communication ................................................................. 68
Figure 35: EtherCAT State Machine ..................................................................................................... 70
Figure 36: SII EEPROM Layout............................................................................................................. 72
Figure 37: I²C EEPROM signals ............................................................................................................ 78
Figure 38: Write access (1 address byte, up to 16 Kbit EEPROMs) ..................................................... 80
Figure 39: Write access (2 address bytes, 32 Kbit - 4 Mbit EEPROMs) ............................................... 81
Figure 40: Read access (1 address byte, up to 16 Kbit EEPROMs) .................................................... 81
Figure 41: PDI Interrupt Masking and interrupt signals ......................................................................... 82
Figure 42: ECAT Interrupt Masking ....................................................................................................... 83
ABBREVIATIONS
µC Microcontroller
ADR Address
AL Application Layer
Auto Crossover Automatic detection of whether or not the send and receive lines are crossed.
Big Endian Data format (also Motorola format). The more significant byte is transferred first
when a word is transferred. However, for EtherCAT the least significant bit is
the first on the wire.
Boundary Clock A station that is synchronized by another station and then passes this
information on.
Bridge A term for switches used in standards. Bridges are devices that pass on
messages based on address information.
Cat Category – classification for cables that is also used in Ethernet. Cat 5 is the
minimum required category for EtherCAT. However, Cat 6 and Cat 7 cables are
available.
Cut Through Procedure for cutting directly through an Ethernet frame by a switch before the
complete message is received.
DC Distributed Clocks
Mechanism to synchronize EtherCAT slaves and master
Dest Addr Destination address of a message (the destination can be an individual network
station or a group (multicast).
DHCP Dynamic Host Configuration Protocol, used to assign IP addresses (and other
important startup parameter in the Internet context).
DL Data Link Layer, also known as Layer 2. EtherCAT uses the Data Link Layer of
Ethernet, which is standardized as IEEE 802.3.
DNS Domain Name Service, a protocol for domain name to IP addresses resolution.
ECAT EtherCAT
EtherType Identification of an Ethernet frame with a 16-bit number assigned by IEEE. For
example, IP uses EtherType 0x0800 (hexadecimal) and the EtherCAT protocol
uses 0x88A4.
EPU EtherCAT Processing Unit. The logic core of an ESC containing e.g. registers,
memory, and processing elements.
Firewall Routers or other network component that acts as a gateway to the Internet and
enables protection from unauthorized access.
Follow Up Message that follows Sync and indicates when the Sync frame was sent from
the last node (defined in IEEE 1588).
GND Ground
HW Hardware
I²C Inter-Integrated Circuit, serial bus used for SII EEPROM connection
IP Internet Protocol: Ensures transfer of data on the Internet from end node to end
node.
Intellectual Property
ISO/OSI Model ISO Open Systems Interconnection Basic Reference Model (ISO 7498):
describes the division of communication into 7 layers.
Little Endian Data format (also Intel format). The less significant byte is transferred first when
a word is transferred. With EtherCAT, the least significant bit is the first on the
wire.
LLDP Lower Layer Discovery Protocol – provides the basis for topology discovery and
configuration definition (see IEEE802.1ab)
MAC Address Media Access Control Address: Also known as Ethernet address; used to
identify an Ethernet node. The Ethernet address is 6 bytes long and is assigned
by the IEEE.
MBX Mailbox
NOP No Operation
Octet Term from IEC 61158 – one octet comprises exactly 8 bits.
Optional Service Optional services can be fulfilled by a PROFINET station in addition to the
mandatory services.
PDI Process Data Interface or Physical Device Interface: an interface that allows
access to ESC from the process side.
PDU Protocol Data Unit: Contains protocol information (Src Addr, Dest Addr,
Checksum and service parameter information) transferred from a protocol
instance of transparent data to a subordinate level (the lower level contains the
information being transferred).
PE Protection Earth
PHY Physical layer device that converts data from the Ethernet controller to electric
or optical signals.
Ping Frame that verifies whether the partner device is still available.
Protocol Rules for sequences – here, also the sequences (defined in state machines)
and frame structures (described in encoding) of communication processes.
Provider Device that sends data to other consumers in the form of a broadcast message.
PTP Precision Time Protocol in accordance with IEEE 1588: Precise time
synchronization procedures.
Quad Cable Cable type in which the two cable pairs are twisted together. This strengthens
the electromagnetic resistance.
RAM Random Access Memory. ESC have User RAM and Process Data RAM.
RSTP Rapid Spanning Tree Protocol: Prevents packet from looping infinitely between
switches; RSTP is specified in IEEE 802.1 D (Edition 2004)
RT Real-time. Name for a real-time protocol that can be run in Ethernet controllers
without special support.
RX Receive
RXPDO Receive PDO, i.e. Process Data that will be received by ESC20
SM SyncManager
SNMP Simple Network Management Protocol: SNMP is the standard Internet protocol
for management and diagnostics of network components (see also RFC 1157
and RFC 1156 at www.ietf.org ).
Store and Currently the common operating mode in switches. Frames are first received in
Forward their entirety, the addresses are evaluated, and then they are forwarded. This
result in considerable delays, but guarantees that defective frames are not
forwarded, causing an unnecessary increase in the bus load.
STP Shielded Twisted Pair: Shielded cable with at least 2 core pairs to be used as
the standard EtherCAT cable.
Subnet Mask Divides the IP address into two parts: a subnet address (in an area separated
from the rest by routers) and a network address.
SyncManager ESC unit for coordinated data exchange between master and slave µController
TX Transmit
TXPDO Transmit PDO, i.e. Process Data that will be transmitted by ESC20
UTP Unshielded Twisted Pair: Unshielded cable with at least 2 core pairs are not
recommended for industrial purpose but are commonly used in areas with low
electro-magnetic interference.
WD Watchdog
Ports (Ethernet/EBUS)
SPI / µC parallel /
0 1 2 3
Digital I/O / On-chip bus
AutoForwarder +
PDI
Loopback
PHY MI
ECAT Interface PDI Interface
PHY
Management
FMMU
SyncManager
ECAT
Processing
Unit
ESC address space
Distributed
Monitoring EEPROM Status
Clocks
Auto-Forwarder
The Auto-Forwarder receives the Ethernet frames, performs frame checking and forwards it to the
Loop-back function. Time stamps of received frames are generated by the Auto-Forwarder.
Loop-back function
The Loop-back function forwards Ethernet frames to the next logical port if there is either no link at a
port, or if the port is not available, or if the loop is closed for that port. The Loop-back function of port 0
forwards the frames to the EtherCAT Processing Unit. The loop settings can be controlled by the
EtherCAT master.
FMMU
Fieldbus Memory Management Units are used for bitwise mapping of logical addresses to physical
addresses of the ESC.
SyncManager
SyncManagers are responsible for consistent data exchange and mailbox communication between
EtherCAT master and slaves. The communication direction can be configured for each SyncManager.
Read or write transactions may generate events for the EtherCAT master and an attached µController
respectively. The SyncManagers are responsible for the main difference between and ESC and a
dual-ported memory, because they map addresses to different buffers and block accesses depending
on the SyncManager state. This is also a fundamental reason for bandwidth restrictions of the PDI.
Monitoring
The Monitoring unit contains error counters and watchdogs. The watchdogs are used for observing
communication and returning to a safe state in case of an error. Error counters are used for error
detection and analysis.
Reset
The integrated reset controller observes the supply voltage and controls external and internal resets
(ET1100 and ET1200 ASICs only).
PHY Management
The PHY Management unit communicates with Ethernet PHYs via the MII management interface. This
is either used by the master or by the slave. The MII management interface is used by the ESC itself
for optionally restarting auto negotiation after receive errors with the enhanced link detection
mechanism, and for the optional MI link detection and configuration feature.
Distributed Clock
Distributed Clocks (DC) allow for precisely synchronized generation of output signals and input
sampling, as well as time stamp generation of events. The synchronization may span the entire
EtherCAT network.
Memory
An EtherCAT slave can have an address space of up to 64Kbyte. The first block of 4 Kbyte (0x0000-
0x0FFF) is used for registers and user memory. The memory space from address 0x1000 onwards is
used as the process memory (up to 60 Kbyte). The size of process memory depends on the device.
The ESC address range is directly addressable by the EtherCAT master and an attached µController.
SII EEPROM
One non-volatile memory is needed for EtherCAT Slave Information (ESI) storage, typically an I²C
EEPROM. If the ESC is implemented as an FPGA, a second non-volatile memory is necessary for the
FPGA configuration code.
Status / LEDs
The Status block provides ESC and application status information. It controls external LEDs like the
application RUN LED/ERR LED and port Link/Activity LEDs.
2 EtherCAT Protocol
EtherCAT uses standard IEEE 802.3 Ethernet frames, thus a standard network controller can be used
and no special hardware is required on master side.
EtherCAT has a reserved EtherType of 0x88A4 that distinguishes it from other Ethernet frames. Thus,
EtherCAT can run in parallel to other Ethernet protocols 1.
EtherCAT does not require the IP protocol, however it can be encapsulated in IP/UDP. The EtherCAT
Slave Controller processes the frame in hardware. Thus, communication performance is independent
from processor power.
An EtherCAT frame is subdivided into the EtherCAT frame header followed by one or more EtherCAT
datagrams. At least one EtherCAT datagram has to be in the frame. Only EtherCAT frames with Type
1 in the EtherCAT Header are currently processed by the ESCs. The ESCs also support IEEE802.1Q
VLAN Tags, although the VLAN Tag contents are not evaluated by the ESC.
If the minimum Ethernet frame size requirement is not fulfilled, padding bytes have to be added.
Otherwise the EtherCAT frame is exactly as large as the sum of all EtherCAT datagrams plus
EtherCAT frame header.
16-1478 Byte
EtherType UDP Header
Destination Source VLAN Tag IP Header EtherCAT Header Datagrams FCS
0x0800 dest. port 0x88A4
EtherCAT in UDP/IP frame
with VLAN tag
11 bit 1 bit 4 bit
Length Res. Type
EtherCAT frame header
1 ESCs have to be configured to forward non-EtherCAT frames via DL Control register 0x0100[0].
EtherCAT header
14 Byte 11 bit 1 bit 4 bit 44*-1498 Byte 4 Byte
Ethernet header Length Res. Type 1...n Datagrams FCS
1bit_mask depends on FMMU configuration if bit-wise mapping is used: only masked bits are actually addressed
by the logical read/write command.
3 Frame Processing
The ET1100, ET1200, IP Core, and ESC20 slave controllers only support Direct Mode addressing:
neither a MAC address nor an IP address is assigned to the ESC, they process EtherCAT frames with
any MAC or IP address.
It is not possible to use unmanaged switches between these ESCs or between master and the first
slave, because source and destination MAC addresses are not evaluated or exchanged by the ESCs.
Only the source MAC address is modified when using the default settings, so outgoing and incoming
frames can be distinguished by the master.
NOTE: Attaching an ESC directly to an office network will result in network flooding, since the ESC will reflect any
frame – especially broadcast frames – back into the network (broadcast storm).
The frames are processed by the ESC on the fly, i.e., they are not stored inside the ESC. Data is read
and written as the bits are passing the ESC. The forwarding delay is minimized to achieve fast cycle
times. The forwarding delay is defined by the receive FIFO size and the EtherCAT Processing Unit
delay. A transmit FIFO is omitted to reduce delay times.
The ESCs support EtherCAT, UDP/IP, and VLAN tags. EtherCAT frames and UDP/IP frames
containing EtherCAT datagrams are processed. Frames with VLAN tags are processed by the ESCs,
the VLAN settings are ignored and the VLAN tag is not modified.
The source MAC address is changed for every frame passing the EtherCAT Processing Unit
(SOURCE_MAC[1] is set to 1 – locally administered address). This helps to distinguish between
frames transmitted by the master and frames received by the master.
Manual open
The port is open regardless of the link state. If there is no link, outgoing frames will be lost.
Manual close
The port is closed regardless of the link state. No frames will be sent out or received at this port, even
if there is a link with incoming frames.
Auto
The loop state of each port is determined by the link state of the port. The loop is open if there is a
link, and it is closed without a link.
link lost
closed
closed
wait
link establishd
A port is considered open if the port is available, i.e., it is enabled in the configuration, and one of the
following conditions is met:
The loop setting in the DL Control register is Auto and there is an active link at the port.
The loop setting in the DL Control register is Auto close and there is an active link at the port and
the DL Control register was written again after the link was established.
The loop setting in the DL Control register is Auto close and there is an active link at the port and
a valid frame was received at this port after the link was established.
The loop setting in the DL control register is Always open
A port is considered closed if one of the following conditions is met:
The port is not available or not enabled in the configuration.
The loop setting in the DL Control register is Auto and there is no active link at the port.
The loop setting in the DL Control register is Auto close and there is no active link at the port or
the DL Control register was not written again after the link was established
The loop setting in the DL Control register is Always closed
NOTE: If all ports are closed (either manually or automatically), port 0 will be opened as the recovery port.
Reading and writing via this port is possible, although the DL status register reflects the correct status. This can
be used to correct DL control register settings.
Registers used for loop control and loop/link status are listed in Table 8.
The direction through an ESC including the EtherCAT Processing Unit is called “processing” direction,
other directions without passing the EtherCAT Processing Unit are called “forwarding” direction.
Ports which are not implemented behave similar to closed ports, the frame is forwarded to the next
port.
Figure 5 shows the frame processing in general:
Port 3
1
Auto-
Forwarder
port 3 open
EtherCAT
Processing Unit port 3 closed
Loopback function
Forwarder
Loopback function
Loopback function
Auto-
port 0 closed
port 1 closed
port 0 open
port 1 open
or all ports
EtherCAT
closed
Port 0 Port 1
Forwarder
Slave Controller 1
Auto-
Loopback function
port 2 closed
port 2 open
Auto-
Forwarder
Port 2
Port 1
Port 0
Port 1
Port 0
Port 1
Port 0
Both slave 1 and slave 2 detect the link failure and close their ports (port 1 at slave 1 and port 0 at
slave 2). A frame currently traveling through the ring at the right side of slave 2 might start circulating.
If such a frame contains output data, it might trigger the built-in watchdog of the ESCs, so the
watchdog never expires, although the EtherCAT master cannot update the outputs anymore.
To prevent this, a slave with no link at port 0 and loop control for port 0 set to Auto or Auto close (ESC
DL Control register 0x0100) will do the following inside the EtherCAT Processing Unit:
If the Circulating bit of the EtherCAT datagram is 0, set the Circulating bit to 1
If the Circulating bit is 1, do not process the frame and destroy it
The result is that circulating frames are detected and destroyed. Since the ESCs do not store the
frames for processing, a fragment of the frame will still circulate triggering the Link/Activity LEDs.
Nevertheless, the fragment is not processed.
EtherCAT
master
Port 3
Port 0
Port 1
Port 0
EtherCAT EtherCAT
slave 1 slave 2
Port 2
Port 3
Port 0
Port 1
Port 0
EtherCAT EtherCAT
slave 3 slave 4
In redundancy operation, only one Port 0 is automatically closed, so the communication remains
active.
MII
EBUS
LINK_MII signal Management Interface
Status register Enhanced Enhanced Enhanced
Standard link Standard link Standard link
link link link
detection detection detection
detection detection detection
ESC DL Status: LINK_MII signal state LINK_MII signal combined with Result of the standard link
Physical link MI Link Detection and detection mechanism
0x0110[7:4] Configuration result
ESC DL Status: LINK_MII LINK_MII LINK_MII LINK_MII Result of the Result of the
Communication signal state signal state signal signal standard link enhanced link
established combined with combined with combined with detection detection
0x0110[15,13,11,9] RX_ERR MI Link RX_ERR mechanism. mechanism.
threshold Detection and threshold
state Configuration state and MI
result Link Detection
and
Configuration
result
PHY port status: PHY has detected link
physical link status (PHY Status register 1[2])
0x0518[0],
0x0519[0],
0x051A[0],
0x051B[0]
n.a. n.a.
PHY port status: PHY has detected link,
Link status link is suitable for ECAT
0x0518[1],
0x0519[1],
0x051A[1],
0x051B[1]
If all ports are closed (either manually or automatically, e.g., because no port has a communication
link), port 0 is automatically opened as the recovery port. Reading and writing via this port is possible,
although the DL status register reflects the correct status. This can be used to correct erroneous DL
control register settings or to fix LINK_MII polarity configuration.
Refer to the EtherCAT Slave Controller application note “PHY Selection Guide” for Ethernet PHY
requirements and example Ethernet PHYs.
Refer to Section III for ESC specific information about supported features.
Direction
Signal Description
at PHY
TX_CLK OUT ESC20:
TX_CLK of one PHY is used as clock source, TX_CLK of other
PHY is unused, leave open.
ESC dependent (e.g., IP Core):
TX_CLK is optionally used for automatic TX Shift compensation.
Other Beckhoff ESCs:
Unused, leave unconnected.
COL OUT Collision detected.
ESC20:
Connected, but not used.
Other Beckhoff ESCs:
Unused. Leave unconnected.
CRS OUT Carrier sense.
ESC20:
Connected, but not used.
Other Beckhoff ESCs:
Unused. Leave unconnected
TX_ER IN Transmit error.
ESC20:
Connected, always driven low.
Other Beckhoff ESCs:
Connect to GND.
For more details about the MII interface, refer to IEEE Standard 802.3 (Clause 22), available from the
IEEE.
FEF Generation
If an FEF-supporting PHY receives a signal with a quality which is not sufficient, the PHY will transmit
a special FEF pattern to the link partner.
FEF Detection
If an FEF-supporting PHY receives the FEF pattern with good signal quality, it will continue
transmitting regularly, but it will indicate “no link” locally to the ESC, until the FEF pattern ends.
Conclusion
The FEF feature is advantageous for EtherCAT, because the PHYs will only indicate a link when the
signal quality is high enough. Without FEF, the EtherCAT slave controllers have to rely on the
Enhanced Link detection feature for detecting a low quality link.
Nevertheless, Enhanced Link detection becomes active only after the link is already established, thus,
in case of a low quality link, the link status will be toggling on/off (link up → Enhanced link detection
tears down link → link up …). This is sufficient to locate an issue in the network, but it might disturb
operation of the remaining network.
So, it is highly recommended to use PHYs which fully implement FEF generation and detection.
NOTE: Some PHYs are claiming FEF support, but they are either not supporting FEF generation or detection, or
they require configuration commands via MI management interface, which cannot be issued by the ESCs
automatically.
Logical Port Configured address of the PHY PHY address register value
PHY address PHY address used by EtherCAT master
offset = 0 offset = 16
0 0 16 0
1 1 17 1
2 2 18 2
3 3 19 3
none 4-15 20-31 4-15
none 16-31 0-15 16-31
If the actual PHY address settings differ from the PHY address configuration of the ESC, the
EtherCAT master has to use the actual PHY address mapping, i.e., PHY addresses 1-4 for accessing
the PHYs of logical ports 0-3.
Table 16: PHY Address configuration does not match actual PHY address settings
1ET1100 only: MI Control is transferred to PDI if the Transparent Mode is enabled. IP Core: MI Control by PDI is
possible.
5.10.3 MI Protocol
Each MI access begins with a Preamble of “Ones“(32 without preamble suppression, less if both ESC
and PHY support preamble suppression), followed by a Start-of-Frame (01) and the Operation Code
(01 for write and 10 for read operations). Then the PHY address (5 bits) and the PHY register address
(5 bits) are transmitted to the PHY. After a Turnaround (10 for write and Z0 for read operations – Z
means MDIO is high impedance), two bytes of data follow. The transfer finishes after the second data
byte and at least one IDLE cycle.
Parameter Comment
tClk MDC period
tWrite Write access time
tRead Read access time
tWrite
tClk
MDC
MDIO 0 1 0 1 A4 A4 A2 A1 A0 R4 R3 R2 R1 R0
tWrite
MDC
tRead
tClk
MDC
MDIO 0 1 1 0 A4 A4 A2 A1 A0 R4 R3 R2 R1 R0
tRead
MDC
Turn-
High Data Byte Low Data Byte IDLE
around
VCC I/O
4K7
ESC
Ethernet PHY
MDIO MDIO
MCLK MDC
Ethernet PHY
MDIO
MDC
Ethernet PHY
MDIO
MDC
2
TX-
3
RX+ 4
RJ-45
5
RX-
6
8
75R
75R
75R
75R
10
> 1mm
gap
10 nF/500 V
1M
1M
plane connection
4 1
3 2
Figure 13: M12 D-code Connector
ESC ESC
REF_CLK REF_CLK
LINK_MII* RESET*
RESET* LINK_MII*
TX_CLK
RX_CLK CLK25_OUT
RX_DV TX_EN
RXD[3:0] TXD[3:0]
TX_CLK
CLK25_OUT RX_CLK
TX_EN RX_DV
TXD[3:0] RXD[3:0]
4K7
MDC MDC
MDIO MDIO
25 MHz
LINK_MII*
RX_CLK TX_CLK
RX_DV TX_EN
RXD[3:0] TXD[3:0]
RX_ER
TX_CLK RX_CLK
TX_EN RX_DV
TXD[3:0] RXD[3:0]
4K7
MDC MDC
MDIO MDIO
6.1 Interface
Two LVDS signal pairs per EBUS link are used, one for reception and one for transmission of
Ethernet/EtherCAT frames.
The EBUS interface has the following signals:
EBUS-TX+
EBUS-TX-
EtherCAT EBUS-RX+
device
EBUS-RX-
RBIAS
Unused EBUS ports can be left unconnected, only the LVDS termination resistor and the RBIAS
resistor are mandatory.
Clock
Paramet
Min Typ Max Comment
er
tClk 10 ns EBUS Clock (100 Mbit/s)
tSOF 15 ns Positive level of SOF before falling edge
tEOF 15 ns Negative level of EOF after last edge
NOTE: After power-on, a receiver which receives IDLE symbols cannot distinguish incoming ‘0’ bits from ‘1’ bits,
because it is not synchronized to the transmitters phase. Synchronization is established at the falling edge at the
end of the EBUS SOF, which indicates the center of the first preamble bit. After synchronization, idle errors can
be detected by the ESC.
NOTE: SOF is detected at a falling edge following a period of at least 15 ns (nominal) of positive level, EOF is
detected after a period of at least 15 ns (nominal) of negative level. I.e., the length of SOF and EOF can be even
longer.
Link A
Port 0
Port 1
Port 0
Port 1
EtherCAT EtherCAT EtherCAT
master slave 1 slave 2
Link B
This method addresses these two cases of partial link failure (see Figure 18):
A failure on Link A will be detected by Slave 2, which will stop transmitting anything on Link B (and
close the loop at port 0). This is detected by Slave 1, which will close the loop at port 1. The
master can still communicate with slave 1.
A failure on Link B will be detected by Slave 1, which will close the loop at port 1. The master can
still communicate with slave 1. This failure cannot be detected by slave 2, which will leave port 0
open.
Do not connect any EBUS port 0 to another EBUS port 0 (same ESC or different ESCs) using
standard link detection, because standard link detection will not establish a link after it was down.
Do not connect any EBUS port 1-3 to another EBUS port 1-3 (same ESC or different ESCs) using
standard link detection, because partial link failures will not result in closed ports.
NOTE: Standard link detection cannot cope with a specific partial link fault (Link B failure), which affects
redundancy operation (e.g., port 1 of slave 2 is connected to the master), because the master cannot
communicate with slave 2 which leaves its port 0 open.
NOTE: Another advantage of this mechanism is that in case slave 2 is added to the network, at first port 0 of
slave 2 is opened because there is activity on Link A, then transmission on Link B is started, and finally slave 1
opens Port 1. This assures that no frames get lost during link establishment.
Link disconnection is signaled to the link partner by stopping transmission for a certain time. This will
be detected by the default link detection mechanism. The link gets disconnected at both sides, and
both sides close their loops. After that, the first phase of the handshake protocol starts again.
EBUS enhanced link detection is not compatible with older devices which forward enhanced link
detection handshake frames depending on the direction (e.g. ESC20 and bus terminals without
ASICs): the handshake frames are not forwarded through the EtherCAT Processing Unit, but they are
forwarded without modification alongside the EtherCAT Processing Unit.
A device using enhanced link detection will stop generating handshake frames after the link is
established or the enhanced link detection is disabled by SII EEPROM setting. It will restart generating
handshake frames shortly after a link is lost (unless enhanced link detection is disabled).
EtherCAT EtherCAT
device device
TX+ RX+
100R
TX- RX-
RX+ TX+
100R
RX- TX-
7 FMMU
Fieldbus Memory Management Units (FMMU) convert logical addresses into physical addresses by
the means of internal address mapping. Thus, FMMUs allow to use logical addressing for data
segments that span several slave devices: one datagram addresses data within several arbitrarily
distributed ESCs. Each FMMU channel maps one continuous logical address space to one continuous
physical address space of the slave. The FMMUs of Beckhoff ESCs support bit wise mapping, the
number of supported FMMUs depends on the ESC. The access type supported by an FMMU is
configurable to be either read, write, or read/write.
IPC
DVI
..
..
Ethernet HDR HDR 1 PLC Data HDR 2 NC Data HDR n Data n FCS
Data n
PLC Data
NC Data
Sub- Sub- Sub-
Telegram 1 Telegram 2 Telegram n
0
Figure 20: FMMU Mapping Principle
The following example illustrates the functions of an FMMU configured to map 14 bits from logical
address 0x00010011.3 to 0x00010013[0] to the physical register bits 0x0F01[1] to 0x0F02[6]. The
FMMU length is 3 Byte, since the mapped bits span 3 Bytes of the logical address space. Length
calculation begins with the first logical byte which contains mapped bits, and ends with the last logical
byte which contains mapped bits.
Byte 0x00010011
Byte 0x00010012 Byte 0x00010013
Logical Start Address
6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1
Logical Start bit = 3 Logical Stop Bit = 0
14 Bits mapped
Attention: This drawing of the bit string shows the least significant bit first, in a hexadecimal representation of the
octets the least significant value is at the right place and the most significant on the left place (00110011 is
represented as octet by 0xCC).
8 SyncManager
The memory of an ESC can be used for exchanging data between the EtherCAT master and a local
application (on a µController attached to the PDI) without any restrictions. Using the memory for
communication like this has some drawbacks which are addressed by the SyncManagers inside the
ESCs:
Data consistency is not guaranteed. Semaphores have to be implemented in software for
exchanging data in a coordinated way.
Data security is not guaranteed. Security mechanisms have to be implemented in software.
Both EtherCAT master and application have to poll the memory in order to find out when the
access of the other side has finished.
SyncManagers enable consistent and secure data exchange between the EtherCAT master and the
local application, and they generate interrupts to inform both sides of changes.
SyncManagers are configured by the EtherCAT master. The communication direction is configurable,
as well as the communication mode (Buffered Mode and Mailbox Mode). SyncManagers use a buffer
located in the memory area for exchanging data. Access to this buffer is controlled by the hardware of
the SyncManagers.
A buffer has to be accessed beginning with the start address, otherwise the access is denied. After
accessing the start address, the whole buffer can be accessed, even the start address again, either as
a whole or in several strokes. A buffer access finishes by accessing the end address, the buffer state
changes afterwards and an interrupt or a watchdog trigger pulse is generated (if configured). The end
address cannot be accessed twice inside a frame.
Two communication modes are supported by SyncManagers:
Buffered Mode
- The buffered mode allows both sides, EtherCAT master and local application, to access the
communication buffer at any time. The consumer always gets the latest consistent buffer which
was written by the producer, and the producer can always update the content of the buffer. If the
buffer is written faster than it is read out, old data will be dropped.
- The buffered mode is typically used for cyclic process data.
Mailbox Mode
- The mailbox mode implements a handshake mechanism for data exchange, so that no data will
be lost. Each side, EtherCAT master or local application, will get access to the buffer only after
the other side has finished its access. At first, the producer writes to the buffer. Then, the buffer
is locked for writing until the consumer has read it out. Afterwards, the producer has write
access again, while the buffer is locked for the consumer.
- The mailbox mode is typically used for application layer protocols.
The SyncManagers accept buffer changes caused by the master only if the FCS of the frame is
correct, thus, buffer changes take effect shortly after the end of the frame.
The configuration registers for SyncManagers are located beginning at register address 0x0800.
0x1000
Buffer 0
- All buffers are
(visible)
0x10FF controlled by the
SyncManager.
0x1100 Only buffer 0 is
Buffer 1
- configured by the
(invisible shall not be used)
0x11FF SyncManager and
addressed by
0x1200 ECAT and
Buffer 2
- µController.
(invisible shall not be used)
0x12FF
Write begin
The Status register of the SyncManager reflects the current state. The last written buffer is indicated
(informative only, access redirection is performed by the ESC), as well as the interrupt states. If the
SyncManager buffer was not written before, the last written buffer is indicated to be 3 (start/empty).
Master µController
Write Mailbox
Write Mailbox full
Write w. failure
(Mailbox full) Mailbox empty Read
Read w. failure
(Mailbox empty)
Read Mailbox
Mailbox full Write
Write w. failure
Read Mailbox empty (Mailbox full)
Read w. failure
(Mailbox empty)
Figure 24: SyncManager Mailbox Interaction
0
Length 16
Address 32
Channel Prio
38 40
Type 44
Ctr. 047
.
Figure 25: EtherCAT Mailbox Header (for all Types)
8.5 Single Byte Buffer Length / Watchdog Trigger for Digital Output PDI
If a SyncManager is configured for a length of 1 byte (or even 0), the buffer mechanism is disabled,
i.e., read/write accesses to the configured address will pass the SyncManager without interference.
The additional buffers 1 and 2 are not used in buffered mode, and alternation of write/read accesses is
not necessary for mailbox mode. Consistency is not an issue for a single byte buffer.
Nevertheless, watchdog generation is still possible if the buffer length is 1 byte (interrupt generation as
well).
NOTE: For some ESCs in Mailbox mode, watchdog and interrupt generation are depending on the alternation of
write and read accesses, although the write/read accesses itself are executed without interference. I.e., Buffered
mode should be used for single byte buffers for watchdog generation.
Watchdog trigger generation with single byte SyncManagers is used for Digital Outputs, because the
outputs are only driven with output data if the Process Data watchdog is triggered. One SyncManager
has to be configured for each byte of the Digital Output register (0x0F00:0x0F03) which is used for
outputs. The SyncManagers have to be configured like this:
Buffered Mode (otherwise the process data watchdog will not be wound up with some ESCs upon
the second and following writes, because the Digital I/O PDI does not read the addresses)
Length of 1 byte
EtherCAT write / PDI read
Watchdog Trigger enabled
For more details refer to the Digital I/O PDI description of Section III and the chapters about Watchdog
and Digital Output in this document.
NOTE: A SyncManager with length 0 behaves like a disabled SyncManager. It does not interfere accesses nor
generate interrupt or watchdog trigger signals.
Write data A
Slave writes data into mailbox
9 Distributed Clocks
The Distributed Clocks (DC) unit of EtherCAT slave controllers supports the following features:
Clock synchronization between the slaves (and the master)
Generation of synchronous output signals (SyncSignals)
Precise time stamping of input events (LatchSignals)
Generation of synchronous interrupts
Synchronous Digital Output updates
Synchronous Digital Input sampling
Propagation Delay
The propagation delay between Reference Clock and slave clock has to be taken into account when
the System Time is distributed to the slaves.
Offset
The offset between local clock and Reference Clock has two reasons: the propagation delay from the
ESC holding the Reference Clock to the device with the slave clock, and initial differences of the local
times resulting from different times at which the ESCs have been powered up. This offset is
compensated locally in each slave.
The ESC holding the Reference Clock derives the System Time from its local time by adding a local
offset. This offset represents the difference between local time (started at power-up) and master time
(starting on January, 1st 2000 at 0:00h).
Drift
Since Reference Clock and DC slaves are typically not sourced by the same clock source (e.g., a
quartz), their clock sources are subject to small deviations of the clock periods. The result is that one
clock is running slightly faster than the other one, their local clocks are drifting apart.
e
fram
tion m Time R
X
s a
o m pen Syste e la y Propagation delay compensation
tc n t ion d
D r i f g cu r r e p agat Local time
i n P r o
c a rry Offset compensation
TX
Drift compensation
System Time Goal: Slave clock has
copy of System Time
x
Reference Slave Clock
Clock
D Offset compensation
car rift com Pro
pag
r yi n
g cu p e n sa atio
n de
RX
rren tion lay
t Sy fram Propagation delay compensation
stem e
Tim Local time
e
x
Reference Slave Clock
Clock
Master
Port 0
Port 1
Port 0
Port 1
Port 0
Port 1
Port 0
EtherCAT EtherCAT
Processing Processing
Unit Unit
Slave E Slave F
Parameters used for propagation delay calculation are listed in Table 26:
Parameter Description
tPx Processing delay of slave x (through EtherCAT Processing Unit, x=A-F)
tFx Forwarding delay of slave x (alongside EtherCAT Processing Unit, x=A-F)
txy Propagation delay from slave x to slave y (x/y=A-F)
tWxy Wire propagation delay between slaves x and y (assumed to be symmetrical in both
directions, x/y=A-F)
tx0, tx1, tx2 Receive Time Port 0/1/2 values of slave x (time when first preamble bit is detected,
x=A-F), measured with a write access to DC Receive Time 0 register.
tP Processing delay (through EtherCAT Processing Unit) if all slaves are identical
tF Forwarding delay (alongside EtherCAT Processing Unit) if all slaves are identical
tDiff Difference between Processing delay and forwarding delay tDiff = tP – tF if all slaves are
identical. ESC specific information, part of the ESI. Refer to Section III for actual
figures.
tRef_x Propagation delay from Reference Clock (slave A) to slave x
The System Time Difference Filter Depth register (0x0934) and the Speed Counter Filter Depth
register (0x0935) set filter depths for mean value calculation of the received System Times and of the
calculated clock period deviations.
Registers used for Control Loop/Drift Compensation are listed in Table 29.
9.2.1 Interface
The Distributed Clocks unit has the following external signals (depending on the ESC and the ESC
configuration):
EtherCAT SYNC/LATCH[1:0]
device
or
SYNC[1:0]
EtherCAT
device LATCH[1:0]
9.2.2 Configuration
The mapping of Distributed Clocks SyncSignals and LatchSignals to the external SYNC/LATCH[1:0]
signals is controlled by the setting of the Sync/Latch PDI Configuration register 0x0151. The
SYNC[1:0] driver characteristics are also selected in this register. The SyncSignals are internally
available for interrupt generation and Digital I/O synchronization regardless of the Sync/Latch PDI
Configuration. The mapping of SyncSignals to the AL Event Request register is also controlled by the
Sync/Latch PDI Configuration register 0x0151.
The length of a SyncSignal pulse is defined in the DC Pulse Length of SYNC Signals register
(0x0982:0x0983). A value of 0 selects acknowledged modes.
Some ESCs support power saving options (partly disabling DC units) controlled by two bits of the ESC
Configuration register (0x0141[3:2]), others have individual configuration options for each
SyncSignal/LatchSignal.
The Sync/Latch signals are not driven (high-impedance) by some ESCs until the SII EEPROM is
successfully loaded. Refer to Section III for details. Take care of proper SyncSignal usage while the
EEPROM is not loaded (e.g. pull-down/pull-up resistors).
Cyclic generation
SYNC0
Single shot
SYNC0
Acknowlege
Cyclic Acknowledge mode
SYNC0
Acknowlege
Single shot Acknowledge mode
SYNC0
The SyncSignal operation mode is selected by the configuration of the Pulse Length and the SYNC0
Cycle Time, according to the following table:
The cycle time of the SYNC0 signal is configured in the SYNC0 Cycle Time register (0x09A0:0x09A3),
the start time is set in the Start Time Cyclic Operation register (0x0990:0x0997). After the Sync Unit is
activated and the output of the SYNC0/1 signals is enabled (DC Activation register 0x0981), the Sync
Unit waits until the start time is reached and generates the first SYNC0 pulse.
Some ESCs support additional activation options like auto-activation when the Start Time is written, or
64 bit extension if only 32 bit of the Start Time is written. Other options are to detect invalid Start
Times and provide debug output of SyncSignals.
Internally, the SyncSignals are generated with an update rate of 100 MHz (10 ns update cycle). The
jitter of the internal SyncSignal generation in comparison to the System Time is 12 ns.
The registers used for SyncSignal Generation are shown in Table 33.
SYNC1 Cycle Time < SYNC0 Cycle Time SYNC0 Cycle Time
SYNC0
SYNC1 Cycle Time
SYNC1
SYNC1
SYNC1
SYNC1
9.2.4 LatchSignals
The DC Latch Unit enables time stamping of LatchSignal events for two external signals, LATCH0 and
LATCH1. Both rising edge and falling edge time stamps are recorded. Additionally, time stamping of
SyncManager events is possible with some ESCs.
LatchSignals are sampled with a sample rate of 100 MHz, the corresponding time stamp has an
internal jitter of 11 ns.
The state of the LatchSignals can be read from the Latch Status registers (0x09AE:0x09AF) – if
supported by the ESC.
The DC Latch Unit supports two modes: single event or continuous mode, configured in the Latch0/1
Control registers (0x09A8:0x09A8).
The registers used for LatchSignal event time stamping are shown in Table 34:
Latch0
ESC 2
ESC 1
DC
DC source
destination
1
µC generates
rising edge for
ESC 1 & 2
2 Output 3
µC reads Latch0 Time pos. edge µC writes Latch0 Time pos. edge
from ESC 1 µController from ESC 1 to System Time
register of ESC 2
The second option uses a SyncSignal output of ESC 1 to trigger Latch0 at ESC 2 and an interrupt at
the µController. Upon receiving an interrupt, the µController writes the time of the SyncSignal pulse to
the System Time register of ESC 2. The µController has to calculate the time of the SyncSignal based
upon Start Time Cyclic Operation and SYNC Cycle Time configuration of ESC 1 from interrupt to
interrupt. The advantage of the second solution is less communication, the disadvantages are more
calculation overhead and error detection/troubleshooting.
1
ESC 1 generates SyncPulse
for ESC 2 and IRQ for µC
Latch0
Sync0
ESC 2
ESC 1
DC
DC source
destination
IRQ 2
µC writes Sync time of ESC 1
µController (calculated by µC) to System
Time register of ESC 2
NC Task
Example:
I O Calc I O Calc 10% of Cycle Time
reserved for Jitter
U U
Sync0 Sync0
IO(Master)
Time to load IO Data to communication buffer and vice versa.
Calc(Master)
Processing time of the master.
Frame(Communication)
Time to transmit the IO-Data-Frame (about 5µs overhead plus 80ns per Byte of Data).
D(Communication)
Delay time of the EtherCAT-Slaves to transfer data (approx. 1 µs with 100BASE-TX, plus line delay of
approx. 5ns per m).
Jitter(Communication)
Depends mostly on Master timing quality.
U(Communication-Master)
Shift time that is adjusted internally by the master to deal with delays needed by the master and adjust
the cycle time.
U(Slave)
Delay time of the EtherCAT-Slaves. This can be set by each slave individually and is usually 0. There
is a need to set this parameter in case of timing inaccuracies of the slave or to deal with slaves that
have a slow output method compared to others with high speed output.
Init
Pre-Operational Bootstrap
(optional)
Safe-Operational
(SO) (OS)
Operational
NOTE: Not all state changes are possible, e.g., the transition from ‘Init’ to ‘Operational’ requires the following
sequence: Init → Pre-Operational → Save-Operational → Operational.
Each state defines required services. Before a state change is confirmed by the slave all services
required for the requested state have to be provided or stopped respectively.
11 SII EEPROM
EtherCAT slave controllers use a mandatory NVRAM (typically a serial EEPROM with I²C interface) to
store EtherCAT Slave Information (ESI). EEPROM sizes from 1 Kbit up to 4 Mbit are supported,
depending on the ESC.
The EtherCAT IP Core supports omitting the serial I²C EEPROM if a µController with read/write
access to an NVRAM (e.g., the one which contains the µController’s program and data, or the FPGA
configuration EPPROM) is used to emulate the EEPROM transactions. Since the logical interface is
the same in this case, the EEPROM emulation is treated to be equivalent to the typical I²C EEPROM
solution throughout this chapter. Refer to chapter 11.2.4 for more details about EEPROM emulation.
The EEPROM structure is shown in Figure 36. The ESI uses word addressing.
Word
0
EtherCAT Slave Controller Configuration Area
8
VendorId ProductCode RevisionNo SerialNo
16
Hardware Delays Bootstrap Mailbox Config
24
Mailbox Sync Man Config
Reserved
64
Additional Information (Subdivided in Categories)
…
Category Strings
Category Generals
Category FMMU
Category SyncManager
At least the information stored in the address range from word 0 to 63 (0x00 to 0x3F) is mandatory, as
well as the general category (→ absolute minimum SII EEPROM size is 2Kbit, complex devices with
many categories should be equipped with 32 Kbit EEPROMs or larger). The ESC Configuration area
is used by the ESC for configuration. All other parts are used by the master or the local application.
For a more detailed description of the ESI and other mandatory parts refer to the ETG.2000 EtherCAT
Slave Information (ESI) Specification, available from the download section of the EtherCAT
Technology Group website (http://www.ethercat.org).
NOTE: Reserved words or reserved bits of the ESC Configuration Area should be filled with 0.
An excerpt of the SII EEPROM content following the ESC Configuration area is shown in Table 38.
For more information, refer to the ETG.2000 EtherCAT Slave Information (ESI) Specification, available
from the download section of the EtherCAT Technology Group website (http://www.ethercat.org).
The EEPROM interface supports three commands: write to one EEPROM address (1 Word), read
from EEPROM (2 or 4 Words, depending on ESC), or reload ESC configuration from EEPROM.
EEPROM_CLK
EtherCAT EEPROM_DATA
device
EEPROM_SIZE
Both EEPROM_CLK and EEPROM_DATA must have a pull-up resistor (4.7 kΩ recommended for
ESCs), either integrated into the ESC or connected externally.
11.3.1 Addressing
EtherCAT and ESCs use word addressing when accessing the EEPROM, although the I²C interface
actually uses byte addressing. The lowest address bit A[0] is added internally by the EEPROM
interface controller of the ESCs. I.e., the EEPROM address register (0x0504:0x0507) reflects the
physical EEPROM address bits A[18:1] (higher address bits are reserved/are zero).
SII EEPROM word 0 is located at I²C address 0, i.e., the I²C device address has to be set to 0.
EEPROM Size Address Bytes Max. I²C Address Bits EEPROM_SIZE signal
1 Kbit – 16 Kbit 1 11 0
32 Kbit – 4 Mbit 2 19 1
1 The availability of the EEPROM signals as well as their names depend on the specific ESC.
Bit Description
0 Read/Write access:
0: Write
1: Read
[3:1] Chip Select Bits/Highest Address Bits
[7:4] Control Code: 1010
Depending on the access, either read data will follow or additional address bytes and write data. This
is described in the following chapters.
The EEPROM has an internal byte pointer, which is incremented automatically after each data byte
transfer.
For more details about the I²C protocol, refer to “The I²C-Bus Specification”, available from NXP
(http://www.nxp.com, document number 39340011) and http://www.i2c-bus.org.
Parameter Comment
tClk
EEPROM_CLK
tWrite
EEPROM_CLK
tWrite
tClk
EEPROM_CLK
EEPROM_DATA 1 0 1 0 A18 A17 A16 R/W Ack A15 A14 A13 A12 A11 A10 A9 A8 Ack
EEPROM_CLK
tWrite
EEPROM_CLK
EEPROM_CLK
EEPROM_CLK
tRead
EEPROM_CLK
No
EEPROM_DATA D15 D14 D13 D12 D11 D10 D9 D8 Ack DN.7 DN.6 DN.5 DN.4 DN.3 DN.2 DN.1 DN.0
Ack
12 Interrupts
ESCs support two types of interrupts: AL Event Requests targeted at a µController, and ECAT event
requests targeted at the EtherCAT master. Additionally, the Distributed Clocks SyncSignals can be
used as interrupts for a µController as well.
SYNC/Latch
PDI Config. 8
Register
(0x0151)
ECAT Event
Request
16
Register
(0x0210:0x0211) 16
&
ECAT Event 16 Transmitted
≥1
Mask ECAT Event
16 Received 16
Register
ECAT Event
(0x0200:0x0201)
13 Watchdogs
The ESCs support up to two internal watchdogs (WD), a Process Data watchdog used for monitoring
process data accesses, and a PDI watchdog monitoring PDI activity.
The timeout for both watchdogs can be configured individually, but they share a single Watchdog
Divider (WD_DIV, register 0x0400:0x0401). The watchdog timeout is calculated from the Watchdog
Divider settings multiplied with the Watchdog Time settings for PDI (WD_PDI, register 0x0410:0x0411)
or Process Data (WD_PD, register 0x0420:0x0421). Base time unit is 40 ns. The Watchdog timeout
jitters, the jitter depends on the Watchdog Divider settings. I.e., selecting smaller Watchdog Divider
settings results in smaller jitter.
The following equations are used for a quick estimation of the watchdog timeout (they are not exact in
terms of nanoseconds):
tWD_Div = (WD_DIV + 2) * 40ns
tWD_PDI = [tWD_Div * WD_PDI ; tWD_Div * WD_PDI + tWD_Div ]
tWD_PD = [tWD_Div * WD_PD ; tWD_Div * WD_PD + tWD_Div ]
Registers used for Watchdogs are described in Table 49:
14 Error Counters
The ESCs have numerous error counters which help in detecting and locating errors. All error
counters are saturated at 0xFF (no wrap-around) and they are cleared individually or group-wise by
writing any value to them.
Table 51: Errors Detected by Physical Layer, Auto-Forwarder, and EtherCAT Processing Unit
* Some ESCs support RUN LED flickering while the SII EEPROM is loaded.
NOTE: Do not confuse the application ERR LED with the port receive error LEDs (PERR(x)) supported by some
ESCs.
It is recommended to use the LINKACT LED signals of the ESCs instead of the Link/Activity LED
signals of the PHY, because the ESC signals reflect the actual link/activity state of the device – not
only the state of the PHYs –, and the ESC signals adhere to the ETG.1300 EtherCAT Indicator and
Labeling Specification.
IP Core
ET1100
ET1200
ESC20
(PDI Control
register
0x0140)
0 Interface deactivated x x x x
4 Digital I/O x x x
5 SPI Slave x x x x
7 EtherCAT Bridge (port 3) x
8 16 Bit async. µC x x x
9 8 Bit async. µC x x x
10 16 Bit sync. µC x
11 8 Bit sync. µC x
16 32 Digital Input/0 Digital Output x
17 24 Digital Input/8 Digital Output x
18 16 Digital Input/16 Digital Output x
19 8 Digital Input/24 Digital Output x
20 0 Digital Input/32 Digital Output x
128 On-chip bus x
Others Reserved
NOTE: On-Chip bus: different On-chip buses are supported by the EtherCAT IP Core for Altera FPGAs and the
EtherCAT IP Core for Xilinx FPGAs.
17 Additional Information
18 Appendix
Beckhoff Support
Support offers you comprehensive technical assistance, helping you not only with the application of
individual Beckhoff products, but also with other, wide-ranging services:
world-wide support
design, programming and commissioning of complex automation systems
and extensive training program for Beckhoff system components
hotline: + 49 (0) 5246/963-157
fax: + 49 (0) 5246/963-9157
e-mail: [email protected]
Beckhoff Service
The Beckhoff Service Center supports you in all matters of after-sales service:
on-site service
repair service
spare parts service
hotline service
hotline: + 49 (0) 5246/963-460
fax: + 49 (0) 5246/963-479
e-mail: [email protected]