SPRAA85E November 2005 – December 2017 SM320F2812 , SM320F2812-EP , TMS320F280021 , TMS320F280021-Q1 , TMS320F280023 , TMS320F280023-Q1 , TMS320F280023C , TMS320F280025 , TMS320F280025-Q1 , TMS320F280025C , TMS320F280025C-Q1 , TMS320F280040-Q1 , TMS320F280040C-Q1 , TMS320F280041 , TMS320F280041-Q1 , TMS320F280041C , TMS320F280041C-Q1 , TMS320F280045 , TMS320F280048-Q1 , TMS320F280048C-Q1 , TMS320F280049 , TMS320F280049-Q1 , TMS320F280049C , TMS320F280049C-Q1 , TMS320F2801 , TMS320F2801-Q1 , TMS320F2802 , TMS320F2802-Q1 , TMS320F28044 , TMS320F2806 , TMS320F2806-Q1 , TMS320F28062 , TMS320F28062-Q1 , TMS320F28062F , TMS320F28062F-Q1 , TMS320F28063 , TMS320F28064 , TMS320F28065 , TMS320F28066 , TMS320F28066-Q1 , TMS320F28067 , TMS320F28067-Q1 , TMS320F28068F , TMS320F28068M , TMS320F28069 , TMS320F28069-Q1 , TMS320F28069F , TMS320F28069F-Q1 , TMS320F28069M , TMS320F28069M-Q1 , TMS320F28075 , TMS320F28075-Q1 , TMS320F2808 , TMS320F2808-Q1 , TMS320F2809 , TMS320F2810 , TMS320F2810-Q1 , TMS320F2811 , TMS320F2811-Q1 , TMS320F2812 , TMS320F2812-Q1 , TMS320F28232 , TMS320F28232-Q1 , TMS320F28234 , TMS320F28234-Q1 , TMS320F28235 , TMS320F28235-Q1 , TMS320F28332 , TMS320F28333 , TMS320F28334 , TMS320F28335 , TMS320F28335-Q1 , TMS320F28374D , TMS320F28374S , TMS320F28375D , TMS320F28375S , TMS320F28375S-Q1 , TMS320F28376D , TMS320F28376S , TMS320F28377D , TMS320F28377D-EP , TMS320F28377D-Q1 , TMS320F28377S , TMS320F28377S-Q1 , TMS320F28379D , TMS320F28379D-Q1 , TMS320F28379S , TMS320R2811
The TMS320x28xx and TMS320x28xxx are members of the C2000 family of microcontrollers (MCUs). These devices are targeted for embedded control applications. To facilitate writing efficient and easy-to-maintain embedded C/C++ code on these devices, Texas Instruments provides hardware abstraction layer methods for accessing memory-mapped peripheral registers. These methods are the bit field and register-file structure approach, and the C2000 Peripheral Driver Library approach. This application report explains the implementation of these hardware abstraction layers and compares them to traditional #define macros. Topics of code efficiency and special case registers are also addressed.
The bit field and register-file structure hardware abstraction layer discussed in this application report has been implemented as a collection of C/C++ header files available for download in C2000Ware™ from Texas Instruments:
Support for all new microcontrollers is available in the device support section of C2000Ware. At this time, it supports and is the preferred approach for the following devices:
Older C28x devices are not supported by C2000Ware and are instead supported in the following downloads:
The C2000 Peripheral Driver Library (often referred to as “Driverlib”) is also available for download in C2000Ware. At this time, it supports the following devices:
Depending on your current needs, the software included in these downloads are learning tools or the basis for a development platform.
The C/C++ Header Files and Peripheral Examples include several example Code Composer Studio™ projects. These examples explain the steps required to initialize the device and utilize the on-chip peripherals. The examples can be copied and modified to quickly experiment with peripheral configurations.
The header files can be incorporated into a project as a hardware abstraction layer for accessing the on-chip peripherals using C or C++ code. You can also pick and choose functions as needed and discard the rest. This application report does not provide a tutorial on C, C++, C28x assembly, or emulation tools. You should have a basic understanding of C code and the ability to load and run code using Code Composer Studio. While knowledge of C28x assembly is not required to understand the hardware abstraction layer, it is useful to understand the code optimization and read-modify-write sections. If you have assembly instruction-related questions, see the TMS320C28x CPU and Instruction Set Reference Guide.
Examples are based on the following software versions:
The following abbreviations are used: