TIDUE74F April   2018  – March 2026

 

  1.   1
  2.   Description
  3.   Resources
  4.   Features
  5.   Applications
  6.   6
  7. 1System Description
    1. 1.1 Key System Specifications
  8. 2System Overview
    1. 2.1 Block Diagram
    2. 2.2 Highlighted Products
      1. 2.2.1 C2000™ Real-Time MCU LaunchPad™ Development Kit
      2. 2.2.2 SN65HVD78
      3. 2.2.3 TLV702
      4. 2.2.4 TPS22918-Q1
    3. 2.3 Design Considerations
      1. 2.3.1 Tamagawa T-Format Protocol
      2. 2.3.2 C2000 T-Format Encoder Interface Overview
      3. 2.3.3 TIDM-1011 Board Implementation
      4. 2.3.4 MCU Resource Requirements
      5. 2.3.5 Device-Specific Resource Usage
        1. 2.3.5.1 CRC Calculations
        2. 2.3.5.2 Input, Output Signals, and CLB Tiles
      6. 2.3.6 CLB T-Format Implementation Details
        1. 2.3.6.1 Transaction Waveforms
          1. 2.3.6.1.1 IDLE State
          2. 2.3.6.1.2 TRANSMIT_DATA State
          3. 2.3.6.1.3 WAIT_FOR_START State
          4. 2.3.6.1.4 RECEIVE_DATA State
        2. 2.3.6.2 Communication Tile Design
        3. 2.3.6.3 Logic View
      7. 2.3.7 CLB Receive Data CRC Implementation
      8. 2.3.8 PM T-Format Encoder Interface Library
        1. 2.3.8.1 PM T-Format Reference Implementation Commands
        2. 2.3.8.2 Functions Supported in PM T-Format Reference Implementation
  9. 3Hardware, Software, Testing Requirements, and Test Results
    1. 3.1 Hardware
      1. 3.1.1 TIDM-1011 Jumper Configuration
    2. 3.2 Software
      1. 3.2.1 C2000 Driver Library (DriverLib)
      2. 3.2.2 C2000 SysConfig
      3. 3.2.3 C2000 Configurable Logic Block Tool
      4. 3.2.4 Installing Code Composer Studio™ and C2000WARE-MOTORCONTROL-SDK
      5. 3.2.5 Locating the Reference Software
    3. 3.3 Testing and Results
      1. 3.3.1 Hardware Configuration
      2. 3.3.2 Building and Loading Project
      3. 3.3.3 Running Code
      4. 3.3.4 Cable Length Validation
      5. 3.3.5 Benchmarks
      6. 3.3.6 Troubleshooting
  10. 4Design Files
  11. 5Related Documentation
    1. 5.1 Trademarks
  12. 6Terminology
  13. 7About the Authors
  14. 8Revision History

Tamagawa T-Format Protocol

Tamagawa is a manufacturer of encoder technology used for obtaining high-precision position information in machine tools, robotics, motor drives and so forth. Tamagawa rotary encoders consist broadly of two types: incremental or absolute. Incremental encoders provide a train of pulses, while the absolute-type provides absolute digital values. Absolute encoders include both single-turn and multi-turn types.

The TIDM-1011 reference design focuses on an absolute-type which provides a digital output through an RS-485 line driver. The protocol format of the transaction supported by TIDM-1011 is known as T-Format.

Note: This section provides an overview of the T-Format protocol. For specific information, refer to the T-format specification available from Tamagawa.
Note: Not all encoders produced by Tamagawa use the T-Format protocol. Check the specification of your encoder.

The C2000 T-Format encoder interface provides the required physical layer for a controller to communicate with an encoder. This encoder interface provides the RS-485 drive control to send and receive digital information with the encoder. In this context, a T-Format transaction is the transmission of a request from the controller plus the response back from the encoder. From the perspective of the encoder interface, a transaction can be divided into FRAME_STATES shown in Figure 2-2:

  1. IDLE: No RS-485 activity
  2. TRANSMIT_DATA: The controller sends a request to the encoder
  3. WAIT_FOR_START: Wait for the encoder's response
  4. RECEIVE_DATA: The controller receives the encoder's response
  5. Back to IDLE.

This pattern is repeated for each transaction with the encoder.

TIDM-1011 T-Format Frame Figure 2-2 T-Format Frame
Note: Figure 2-2 includes information related to the C2000 encoder interface implementation. For example, the CLB drives the SPI CLOCK and the TxEN signal.

The T-format communication protocol is broadly classified into three types of transactions: data readout, reset, and EEPROM access. Each transaction has a unique Data ID defined by the protocol. The Data ID is used to identify the specific request made by the controller through the encoder interface.

Table 2-2 T-Format Transactions
Transaction Type Data ID Transaction
Readout ID 0 Absolute data in one revolution
ID 1 Multi-turn data
ID 2 Encoder ID
ID 3 All of the above plus the encoder error status
Reset ID 7 Reset absolute data in one revolution
ID 8 Reset multi-turn data
ID C Reset errors
EEPROM ID D Read encoder's EEPROM
ID 6 Write to encoder's EEPROM

Each transaction consists of 10-bit fields. Each field has the format shown in Table 2-3. The first bit is a start bit (always 0) and the last bit is a delimiter bit (always 1). The content of the 8-bits of data between the start bit and delimiter depend on the specific type of field.

Table 2-3 T-Format Field Format
Bit 1 Bit 2 Bit 3 Bit 4 Bit 5 Bit 6 Bit 7 Bit 8 Bit 9 Bit 10
Content Start bit
Always 0
8 data bits: Least significant bit first.
The content depends on the specific field. These 8 bits of data are included in the CRC calculation.
Delimiter bit
Always 1

The fields defined by the T-Format protocol are:

    ControlField (CF) The first field in every request and every response. The ControlField includes the unique Data ID for the transaction.
    StatusField (SF) Status information from the encoder.
    DataFields (DFx) Information from the encoder. The content and number of DataFields depend on the transaction. Examples of DataFields include the encoder's ID, position information, and error codes. Up to 8 DataFields are possible.
    CRCField An 8-bit Cyclic Redundancy Check (CRC) of the data. A CRCField is the last field of an EEPROM read or write request. The CRCField is always the last field in the encoder's response.
    EEPROM AddressField (ADF) Address to be read or written in an EEPROM transaction.
    EEPROM DataField (EDF) Contains the data read, or the data to be written, in an EEPROM transaction.
Note: For the specific contents of each field, refer to the T-Format specification available from Tamagawa.

The fields used in a request are shown in Table 2-4. To begin a transaction, the controller sends a request through the encoder interface. The request starts with the ControlField which includes the Data ID. The encoder uses the Data ID to identify the exact transaction requested. For a readout or reset request, only the ControlField is required. In the case of an EEPROM read or write the controller also sends an EEPROM AddressField and an EEPROM DataField (for a write) followed by a CRCField.

Table 2-4 T-Format Request Fields
Request type Fields Transmitted
Readout ControlField
Reset ControlField
EEPROM Write ControlField EEPROM AddressField EEPROM DataField CRCField(1)
EEPROM Read ControlField EEPROM AddressField CRCField
The CRC calculation includes the 8-bits of data in the Control, EEPROM Address and EEPROM Data fields. The start bits and delimiter bits are excluded.

The fields used in an encoder's response depend on the specific request. For readout and reset transactions (Table 2-5), the encoder responds with an echo of the ControlField, follwed by a StatusField and one or more DataFields. Lastly the encoder always sends a CRCField. The CRCField can be used as an integrity check of the received data.

Table 2-5 T-Format Response Fields for Readout and Reset
Data ID Type Control
Field(1)
Status
Field
DataFields (DF0:DF1:….DF7) + CRC (2) (3)
ID 0 Read CF SF ABS0(4) ABS1 ABS2 CRC
ID 1 Read CF SF ABM0(5) ABM1 ABM2 CRC
ID 2 Read CF SF ENID(6) CRC
ID 3 Read CF SF ABS0 ABS1 ABS2 ENID ABM0 ABM1 ABM2 ALMC(7) CRC
ID 7 Reset CF SF ABS0 ABS1 ABS2 CRC
ID 8 Reset CF SF ABS0 ABS1 ABS2 CRC
ID C Reset CF SF ABS0 ABS1 ABS2 CRC
CF: ControlField. Matches the ControlField sent in the request.
DF: DataField. Up to 8 fields depending on the transaction.
The CRCField is always transmitted immediately after the last used DataField. The CRC includes the 8-bits of data in the CF + SF + DataFields used. The start-bit and delimiter of each field is excluded.
ABS: Absolute data in one revolution. Uses 3 fields.
ABM: Multi-turn data. Uses 3 fields.
ENID: Encoder ID. One field.
ALMC: Encoder error. One field

In the following data readout example, the controller requests the multi-turn data (Data ID 1). Referencing Table 2-5, the response DataFields correspond to the multi-turn data (ABM0:ABM1:ABM2).

Table 2-6 Data Readout Example
Request: ControlField
for Data ID 1
Response: ControlField
for Data ID 1
StatusField DataField0 DataField1 DataField2 CRC

For a EEPROM transaction, the encoder responds with the ControlField + EEPROM AddressField + EEPROM DataField + CRCField as shown in Table 2-7.

Table 2-7 EEPROM Read/Write Response Fields
Data ID Request Field 0 Field 1 Field 2 Field 3
ID 6 Write ControlField EEPROM
AddressField
EEPROM
DataField (1)
CRCField(3)
ID D Read ControlField EEPROM
AddressField
EEPROM
DataField (2)
CRCField
Data written to the encoder's EEPROM. This is an echo of the DataField in the request.
Data read from the encoder's EEPROM.
The CRC calculation includes the 8-bits of data in the Control, EEPROM Address and EEPROM Data fields. The start bit and delimiter of each field are excluded.