TMC Tech Access Package

Open-Source IC Software API

The ADI Trinamic application programming interface simplifies use of ADI Trinamic ICs in C or C++ and can be used for different CPU types, including the ones featured on the Landungsbrücke and Startrampe interface boards that are part of the modular evaluation system. These boards contain respectively the Freescale MK20 Cortex® M4 processor and the STM-F205 Cortex M3 processor, but other CPUs are supported as well. The open-source C-code allows a seamless integration into your own firmware project.

Software API Project Structure

The API is structured in various layers ranging from general definitions, such as s32 and int32_t, to high level functions including homing and software ramps. Each layer is represented with its own folder: The folder tmc/helpers contains general definitions for data types and bit handling, independent of the processor used. The folder tmc/ic contains a folder for each ADI Trinamic chip, for example, tmc/ic/TMC4671. Each of these folders contain a header file with the chip’s register address list (for example, TMC4671_Register.h). Another .h and .c file (for example, TMC4671.h/.c) provide low level, mid level, and high level functions for the specific chip. Low level functions are necessary for SPI read and write access. Mid level functions like setTargetVelocity(...) or getActualPosition() demonstrate the typical register access for different application scenarios, for example, velocity or position mode. For some chips, there are also functions for encoder initialization and real-world current scaling available.

Evaluation Board Project Structure

The evaluation board project demonstrates the usage of the API and serves as a starting point for your own firmware development. Serving as an example, it helps you simplify and speed up firmware development based on ADI Trinamic motion control ICs. The project is a makefile and supports the two processor types used in the modular evaluation system. A build-command for the makefile allows processor selection and the complete firmware project is free to use and adapt to your needs. It uses the Eclipse IDE for C or C++ developers and can easily be extended for further processor types and evaluation boards. On top of the CPU-specific firmware part, a hardware abstraction layer is used to abstract access to digital IO, ADC measurement, SPI, communication, PWM, and evaluation board detection from the CPU-specific firmware part. Using the hardware abstraction layer, each eval board has access to a wide range of CPU functions independent of the CPU.

Download the Latest API and Evaluation System Firmware

File Type Size Date
TMC-EvalSystem Project zip 1.9 MB Jul 7, 2020, 4:26 PM
Application Note 038—Using ADI Trinamic IC Software API and Examples html 520 KB Feb 7, 2022, 3:41 PM

Requirements and Installation

To use the API in your own project, there are a few software packages needed. First, the Eclipse software, which is an open-source integrated development environment. Second, the GNU Arm® Embedded Toolchain is needed, which is a prebuilt GNU toolchain for Arm Cortex-M processors. Third, you need the TMCL-IDE, which is the ADI Trinamic GUI to control and update ADI Trinamic modules and evaluation kits.