AM263x Motor Control SDK  09.01.00
Tamagawa over Uart Example

Introduction

Tamagawa over uart application does below,

  • Configures pinmux, GPIO, UART (UART clock to 192MHz, Baud rate, etc.)
  • Initializes UART0 for debug log & UART1 for communication
  • Select UART LLD with polling mode for encoder communication
  • Load and executes tamagawa example on R5_0

Connect the Tamagawa encoder via RS-485 Half-Duplex EVM to Am263x-LP. The connections between AM263x LP and RS-485

UART RX Pin(UART1_RXD)->JMP1-R, UART TX Pin(UART1_TXD)->JMP4-D, GPIO Pin(GPIO62)->JM3-DE

The tamagawa over uart example runs on R5 and communicates with tamagawa encoder by UART instance 1. It presents the user with menu options to select Data ID code (as defined by Tamagawa) to be sent to the encoder. The application collects the data entered by the user and configures the relevant command. Then via the UART LLD write API, the command is passed to encoder. Once the command is sent, the encoder starts to respond, and UART LLD read API starts to read this response. Response is stored in the tamagawa interface, the status of the transaction is check by CRC calculation. If the status indicates success, the result is presented to the user otherwise print CRC failure.

Example Flow-Chart

Tamagawa UART example flow-chart

Important files and directory structure

Folder/Files Description
${SDK_INSTALL_PATH}/examples/position_sense/tamagawa_diagnostic_over_soc_uart
uart_tamagawa.c Tamagawa UART application
${SDK_INSTALL_PATH}/source/position_sense/tamagawa_over_soc_uart
include/ Folder containing tamagawa interface file.
driver/ Tamagawa uart driver

Supported Combinations

Parameter Value
CPU + OS r5fss0-0 freertos
Toolchain ti-arm-clang
Board am263x-lp
Example folder examples/position_sense/tamagawa_diagnostic_over_soc_uart

Steps to Run the Example

Hardware Prerequisites

  • Tamagawa Encoders
  • AM263x LP
  • RS-485 Half Duplex EVM
  • 5V and 3.3V power supplier

Hardware Setup

Tamagawa Encoder Hardware Setup with AM263x

Hardware Setup For AM263x-LP

Build, load and run

  • When using CCS projects to build, import the CCS project and build it using the CCS project menu (see Using SDK with CCS Projects ).
  • When using makefiles to build, note the required combination and build using make command (see Using SDK with Makefiles )
  • Launch a CCS debug session and run the executable, see CCS Launch, Load and Run
  • Refer to UART terminal for user interface menu options.

Sample Output

Shown below is a sample output when the application is run:

Tamagawa UART Sample Output

Test Case Description

Data_ID Name Description Pass/fail Criteria
Data ID 0 Data readout (absolute position data) In this command we will receive: Absolute rotor position value in field name ABS. Errors and warnings in field name SF(status field) CRC success with ABS, SF, CF and CRC values printed in the terminal.
Data ID 1 Data readout (multi-turn data) In this command we will receive data about: No. of rotor turns in field name ABM. Errors and warnings in field name SF(status field). CRC success with ABM, SF, CF and CRC values printed in the terminal.
Data ID 2 Endoder-ID In this command we will receive data about : Tamagawa encoder make-ID in ENID field. Errors and warnings in field name SF(status field) CRC success with ENID, SF, CF and CRC values printed in the terminal.
Data ID 3 Data readout(absolute+multiturn+encoder-ID) In this command we will receive : Absolute rotor position value in field name ABS. No. of rotor turns in field name ABM. Tamagawa encoder make-ID in ENID field. Errors and warnings in field name SF(status field) Other warnings in field name ALMC CRC success with ABS, ENID, ABM, ALMC, SF, CF and CRC values printed in the terminal.
Data ID 6 Writing to EEPROM In this command you provide : Proper address of the EEPROM where you want to write Proper data that you want to write.
As a response you recieve: Control Field for EEPROM Write command EEPROM address that you want to write to Data that you want to write to the EEPROM CRC value
CRC success with EDF, ADF, CF and CRC values printed in the terminal.
Data ID D Readout from EEPROM In this command you provide : Proper address of the EEPROM that you want to read.
As a response you recieve: Control Field for EEPROM Write command EEPROM address that you want to write to Data that you want to write to the EEPROM CRC value
CRC success with EDF, ADF, CF and CRC values printed in the terminal.
Data ID 7 Reset-Error This command used to reset errors. CRC success with ABS, SF, CF and CRC values printed in the terminal.
Data ID 8 Reset- absolute This command used to reset absolute position data(ABS) CRC success with ABS, SF, CF and CRC values printed in the terminal.
Data ID C Reset- multiturn This command used to reset multi-turn data(ABM) CRC success with ABS, SF, CF and CRC values printed in the terminal.