C281x C/C++ Header Files and Peripheral Examples Quick Start
Version 1.10
May 1, 2007
1
C281x C/C++ Header Files and Peripheral Examples
Quick Start
1
Device Support:............................................................................................................................2
2 Introduction: .................................................................................................................................2
2.1 Revision History......................................................................................................................3
2.2 Where Files are Located (Directory Structure)........................................................................4
3 Understanding The Peripheral Bit-Field Structure Approach ...................................................5
3.1 Traditional #define approach:..................................................................................................5
3.2 Bit-field and Structure Approach: ............................................................................................5
3.2.1 Peripheral Register Structures.....................................................................................6
3.3 Adding Bit-Fields.....................................................................................................................8
3.3.1 Read-Modify-Write Considerations When Using Bit-Fields:.........................................9
3.3.2 Code-Size Considerations when using Bit-Fields: ....................................................10
4 Peripheral Example Projects .....................................................................................................10
4.1 Getting Started......................................................................................................................10
4.2 Example Program Structure..................................................................................................14
4.2.1 Include Files..............................................................................................................14
4.2.2 Source Code .............................................................................................................15
4.2.3 Linker Command Files ..............................................................................................15
4.3 Example Program Flow.........................................................................................................17
4.4 Included Examples:...............................................................................................................18
4.5 Executing the Examples From Flash.....................................................................................19
5 Steps for Incorporating the Header Files and Sample Code ...................................................22
5.1 Before you begin...................................................................................................................22
5.2 Including the DSP281x Peripheral Header Files ...................................................................22
5.3 Including Common Example Code........................................................................................25
6 Troubleshooting Tips & Frequently Asked Questions.............................................................27
6.1 Effects of read-modify-write instructions................................................................................29
6.1.1 Registers with multiple flag bits in which writing a 1 clears that flag...........................29
6.1.2 Registers with Volatile Bits. .......................................................................................30
7 Migration Tips from V.58 to V1.00 and newer...........................................................................30
8 Packet Contents: ........................................................................................................................38
8.1 Header File Support – DSP281x_headers ............................................................................38
8.1.1 DSP281x Header Files – Main Files..........................................................................38
8.1.2 DSP281x Header Files – Peripheral Bit-Field and Register Structure Definition Files 39
8.1.3 Code Composer .gel Files.........................................................................................39
8.1.4 Variable Names and Data Sections...........................................................................40
8.2 Common Example Code – DSP281x_common.....................................................................40
8.2.1 Peripheral Interrupt Expansion (PIE) Block Support ..................................................40
8.2.2 Peripheral Specific Files............................................................................................41
8.2.3 Utility Function Source Files...................................................................................... 42
8.2.4 Example Linker .cmd files..........................................................................................42
9 Detailed Revision History: .........................................................................................................42
10 Errata:..........................................................................................................................................44
- 1
- 2
前往页