SPRC097 Version 1.00 Readme
September 11, 2003
1
C281x C/C++ Header Files and Peripheral Examples
1
Introduction: .................................................................................................................................2
1.1 Where Files are Located (Directory Structure)........................................................................3
2 Understanding The Peripheral Bit-Field Structure Approach ...................................................4
2.1 Traditional #define approach:..................................................................................................4
2.2 Bit-field and Structure Approach: ............................................................................................5
2.2.1 Peripheral Register Structures.....................................................................................5
2.3 Adding Bit-Fields.....................................................................................................................7
2.3.1 Read-Modify-Write Considerations When Using Bit-Fields:.........................................8
2.3.2 Code-Size Considerations when using Bit-Fields: ......................................................9
3 Peripheral Example Projects .....................................................................................................10
3.1 Getting Started......................................................................................................................10
3.2 Example Program Structure..................................................................................................12
3.2.1 Include Files..............................................................................................................12
3.2.2 Source Code .............................................................................................................13
3.2.3 Linker Command Files ..............................................................................................13
3.3 Example Program Flow......................................................................................................... 15
3.4 Included Examples:...............................................................................................................16
3.5 Executing the Examples From Flash.....................................................................................17
4 Steps for Incorporating the Header Files and Sample Code...................................................20
4.1 Before you begin...................................................................................................................20
4.2 Including the DSP281x Peripheral Header Files ...................................................................20
4.3 Including Common Example Code........................................................................................23
5 Troubleshooting Tips & Frequently Asked Questions.............................................................25
5.1 Effects of read-modify-write instructions................................................................................27
5.1.1 Registers with multiple flag bits in which writing a 1 clears that flag...........................27
5.1.2 Registers with Volatile Bits. .......................................................................................28
6 Migration Tips from V.58 to V1.00 .............................................................................................29
7 Packet Contents: ........................................................................................................................37
7.1 Header File Support – DSP281x_headers ............................................................................37
7.1.1 DSP281x Header Files – Main Files..........................................................................37
7.1.2 DSP281x Header Files – Peripheral Bit-Field and Register Structure Definition Files 38
7.1.3 Code Composer .gel Files.........................................................................................38
7.1.4 Variable Names and Data Sections...........................................................................39
7.2 Common Example Code – DSP281x_common.....................................................................39
7.2.1 Peripheral Interrupt Expansion (PIE) Block Support ..................................................39
7.2.2 Peripheral Specific Files............................................................................................40
7.2.3 Utility Function Source Files ......................................................................................41
7.2.4 Example Linker .cmd files..........................................................................................41