TMS320x280x, 2801x, 2804x Enhanced Capture ( · PDF fileTMS320x280x, 2801x, 2804x Enhanced Capture (eCAP) Module Reference Guide Literature Number: SPRU807B November 2004–Revised

  • Upload
    vannhan

  • View
    220

  • Download
    0

Embed Size (px)

Citation preview

  • TMS320x280x, 2801x, 2804x Enhanced Capture(eCAP) Module

    Reference Guide

    Literature Number: SPRU807BNovember 2004Revised September 2007

  • 2 SPRU807BNovember 2004Revised September 2007Submit Documentation Feedback

    http://www.go-dsp.com/forms/techdoc/doc_feedback.htm?litnum=SPRU807B

  • Contents

    Preface ........................................................................................................................................ 61 Introduction......................................................................................................................... 92 Description.......................................................................................................................... 93 Capture and APWM Operating Mode..................................................................................... 114 Capture Mode Description ................................................................................................... 12

    4.1 Event Prescaler .......................................................................................................... 124.2 Edge Polarity Select and Qualifier .................................................................................... 134.3 Continuous/One-Shot Control.......................................................................................... 134.4 32-Bit Counter and Phase Control .................................................................................... 144.5 CAP1-CAP4 Registers .................................................................................................. 154.6 Interrupt Control.......................................................................................................... 154.7 Shadow Load and Lockout Control ................................................................................... 164.8 APWM Mode Operation ................................................................................................ 17

    5 Capture Module - Control and Status Registers ..................................................................... 186 Register Mapping ............................................................................................................... 267 Application of the ECAP Module ......................................................................................... 26

    7.1 Example 1 - Absolute Time-Stamp Operation Rising Edge Trigger .............................................. 277.2 Example 2 - Absolute Time-Stamp Operation Rising and Falling Edge Trigger ................................ 307.3 Example 3 - Time Difference (Delta) Operation Rising Edge Trigger ............................................ 327.4 Example 4 - Time Difference (Delta) Operation Rising and Falling Edge Trigger .............................. 34

    8 Application of the APWM Mode ............................................................................................ 368.1 Example 1 - Simple PWM Generation (Independent Channel/s) ................................................. 368.2 Example 2 - Multi-channel PWM Generation With Synchronization .............................................. 378.3 Example 3 - Multi-channel PWM Generation With Phase Control ................................................ 39

    Appendix A Revision History ...................................................................................................... 42

    SPRU807BNovember 2004Revised September 2007 Table of Contents 3Submit Documentation Feedback

    http://www.go-dsp.com/forms/techdoc/doc_feedback.htm?litnum=SPRU807B

  • www.ti.com

    List of Figures1 Multiple eCAP Modules In A 28x System ............................................................................... 102 Capture and APWM Modes of Operation ............................................................................... 113 Capture Function Diagram ................................................................................................ 124 Event Prescale Control .................................................................................................... 135 Prescale Function Waveforms............................................................................................ 136 Details of the Continuous/One-shot Block .............................................................................. 147 Details of the Counter and Synchronization Block..................................................................... 158 Interrupts in eCAP Module ................................................................................................ 169 PWM Waveform Details Of APWM Mode Operation .................................................................. 1710 Time-Stamp Counter Register (TSCTR) ................................................................................ 1811 Counter Phase Control Register (CTRPHS) ........................................................................... 1812 Capture-1 Register (CAP1) .............................................................................................. 1813 Capture-2 Register (CAP2) ............................................................................................... 1814 Capture-3 Register (CAP3) ............................................................................................... 1915 Capture-4 Register (CAP4) ............................................................................................... 1916 ECAP Control Register 1 (ECCTL1)..................................................................................... 1917 ECAP Control Register 2 (ECCTL2)..................................................................................... 2118 ECAP Interrupt Enable Register (ECEINT) ............................................................................. 2319 ECAP Interrupt Flag Register (ECFLG) ................................................................................. 2420 ECAP Interrupt Clear Register (ECCLR)................................................................................ 2421 ECAP Interrupt Forcing Register (ECFRC) ............................................................................. 2522 Capture Sequence for Absolute Time-stamp and Rising Edge Detect.............................................. 2823 Capture Sequence for Absolute Time-stamp With Rising and Falling Edge Detect............................... 3024 Capture Sequence for Delta Mode Time-stamp and Rising Edge Detect .......................................... 3225 Capture Sequence for Delta Mode Time-stamp With Rising and Falling Edge Detect ........................... 3426 PWM Waveform Details of APWM Mode Operation................................................................... 3627 Multichannel PWM Example Using 4 eCAP Modules ................................................................. 3828 Multi-phase (channel) Interleaved PWM Example Using 3 eCAP Modules ........................................ 40

    List of Figures4 SPRU807BNovember 2004Revised September 2007Submit Documentation Feedback

    http://www.go-dsp.com/forms/techdoc/doc_feedback.htm?litnum=SPRU807B

  • www.ti.com

    List of Tables1 Time-Stamp Counter Register (TSCTR) Field Descriptions .......................................................... 182 Counter Phase Control Register (CTRPHS) Field Descriptions ..................................................... 183 Capture-1 Register (CAP1) Field Descriptions ......................................................................... 184 Capture-2 Register (CAP2) Field Descriptions ......................................................................... 195 Capture-3 Register (CAP3) Field Descriptions ......................................................................... 196 Capture-4 Register (CAP4) Field Descriptions ......................................................................... 197 ECAP Control Register 1 (ECCTL1) Field Descriptions .............................................................. 208 ECAP Control Register 2 (ECCTL2) Field Descriptions .............................................................. 219 ECAP Interrupt Enable Register (ECEINT) Field Descriptions....................................................... 2310 ECAP Interrupt Flag Register (ECFLG) Field Descriptions........................................................... 2411 ECAP Interrupt Clear Register (ECCLR) Field Descriptions ......................................................... 2512 ECAP Interrupt Forcing Register (ECFRC) Field Descriptions....................................................... 2513 Control and Status Register Set.......................................................................................... 26A-1 Changes Made in This Revision ......................................................................................... 42

    SPRU807BNovember 2004Revised September 2007 List of Tables 5Submit Documentation Feedback

    http://www.go-dsp.com/forms/techdoc/doc_feedback.htm?litnum=SPRU807B

  • PrefaceSPRU807BNovember 2004Revised September 2007

    Read This First

    The enhanced capture (eCAP) module is used in systems where accurate timing of external events isimportant. This guide describes the module and how to use it.

    The eCAP module described in this reference guide is a Type 0 eCAP. See the TMS320C28xx, 28xxxDSP Peripheral Reference Guide (SPRU566) for a list of all devices with a eCAP module of the sametype, to determine the differences between the types, and for a list of device-specific differences within atype.

    Related Documentation From Texas InstrumentsThe following documents can be downloaded from the TI website (www.ti.com):

    Data ManualsSPRS230 TMS320F2809, F2808, F2806, F2802, F2801, C2802, C2801, and F2801x DSPs Data