C280x/C2833x eCAP

Receive and log capture input pin transitions or configure auxiliary pulse width modulator

Library

c280xdspchiplib and c2833xdspchiplib in Target Support Package™ TC2 software

Description

Dialog Box

The eCAP block dialog box provides configuration parameters on four tabbed panes:

You can add up to four C280x/C2833x eCAP blocks to your model, one block for each capture pin. For example, you can have one block configured for eCAP mode with eCAP1 pin selected and three blocks configured for APWM mode with assigned pins eCAP2, eCAP3, and eCAP4. Or four blocks configured for eCAP mode with each block assigned a different eCAP pin. You cannot assign the same eCAP pin to two eCAP blocks in one model.

Block Input and Output Ports

The C280x/C2833x eCAP block has optional input and output ports as shown in the following table.

PortDescription and When the Port is Enabled
Input port SISynchronization input for input value from software. Enabled when you select Enable software forced counter synchronizing input in either operating mode.
Input port RAOne-shot arming starts the one-shot sequence. Enabled when you set the mode control to One shot.
Output port TSWhen you enable the reset counter, this option resets the capture event counter after capturing the event time stamp. Enabled when you select Enable reset counter after capture event 1 time-stamp.
Output port CFThis port reports the status of the capture event. Enabled when you select Enable capture event status flag output.
Output port OFEnabled when you select Enable overflow status flag output.

General Pane

Operating mode

When you select eCAP, the block captures and logs pin transitions for each capture unit to a FIFO buffer. When you select APWM, the block generates asymmetric pulse width modulation (APWM) waveforms for driving downstream systems.

eCAPx pin

The capture unit includes the following features:

Counter phase offset value (0~4294967295)

The value you enter here provides the time base for event captures, clocked by the system clock. A phase register is used to synchronize with other counters via the software or hardware forced sync (refer to Enable counter Sync-In mode). This is particularly useful in APWM mode when you need a phase offset between capture modules. Enter the phase offset as an integer from 0 (no offset) to 42949667295 (232) counts.

Enable counter Sync-In mode

Select this to enable the TSCTR counter to load from the TSCTR register when the block receives either the SYNC1 signal or a software force event (refer to Enable software-forced counter synchronizing input).

Enable software-forced counter synchronizing input

This option provides a convenient software method for synchronizing one or more eCAP time bases.

Sync output selection

Select one of the list entries Pass through, CTR=PRD, or Disabled to synchronize with other counters.

Sample time

Set the sample time for the block in seconds.

eCAP Pane

To enable the configuration parameters on this pane, select eCAP from the Operating mode list on the General pane.

Event prescaler (integer from 0 to 31)

Prescale the input signal, called a pulse train, by this value. Entering a 0 bypasses the input prescaler, leaving the input capture signal unchanged.

Select mode control

Continuous performs continuous time-stamp captures using a circular buffer to capture events 1 through 4.

One-Shot disables continuous mode and enables the Enable one-shot rearming control via input port option so you can select it.

Enable one-shot rearming control via input port

Select this option to arm the one-shot sequence:

  1. Reset the Mod4 counter to zero.

  2. Unfreeze the Mod4 counter.

  3. Enable capture register loading.

Stop value after

Specifies the number of capture events after which to stop the capture.

Enable reset counter after capture event 1 time-stamp

Enables a reset after capture event 1 and creates an Output port TS. When you select this option, the eCAP process resets the counters after receiving a capture event 1 time-stamp.

Select capture event 1 polarity

Start the capture event on a Rising edge or Falling edge.

Time-Stamp counter data type

Select the data type of the counter. The list includes integer and unsigned 8-, 16-, and 32-bit data types, double, single, and Boolean.

Enable capture event status flag output

Output the capture event status flag on the Output port CF. The block outputs a 0 until the event capture. After the event, the flag value is 1.

Overflow capture event flag data type

Select the data type to represent the capture event flag. The list includes integer and unsigned 8-, 16-, and 32-bit data types, double, single, and Boolean.

Enable overflow status flag output

Output the status of the elements of the FIFO buffer on the Output port OF. After you select this option, set the data type for the flag in Overflow flag data type.

Overflow flag data type

Select the data type to represent the status flag. The list includes integer and unsigned 8-, 16-, and 32-bit data types, double, single, and Boolean.

APWM Pane

To enable the configuration parameters on this pane, select APWM from the Operating mode list on the General pane.

Waveform period units

Set the units for measuring the waveform period. Clock cycles uses the high-speed peripheral clock cycles of the DSP chip, or Seconds. Changing these units changes the Waveform period value and the Duty cycle value and Duty cycle units selection.

Waveform period source

Source from which the waveform period value is obtained. Select Specify via dialog to enter the value in Waveform period or select Input port to use a value from the input port.

Waveform period

Period of the PWM waveform measured in clock cycles or in seconds, as specified in the Waveform period units.

Duty cycle units

Units for the duty cycle. Select Clock cycles or Percentages from the list. Changing these units changes the Duty cycle value, the Waveform period value, and Waveform period units selection.

Duty cycle source

Source from which the duty cycle for the specific PWM pair is obtained. Select Specify via dialog to enter the value in Duty cycle or select Input port to use a value from the input port.

Duty cycle

Ratio of the PWM waveform pulse duration to the PWM waveform period expressed in Duty cycle units.

Output polarity select

Set the active level for the output. Choose Active High or Active Low from the list. When you select Active High, the compare value defines the high time. Selecting Active Low directs the compare value to define the low time.

Interrupt Pane

In the following figure, you see the interrupt options when you put the block in eCAP mode by selecting eCAP for Operating mode on the General pane.

Post interrupt on capture event 1

Enables capture event 1 as an interrupt source. You can use the C280x/C2833x Hardware Interrupt block to react to this interrupt.

Post interrupt on counter overflow

Enables counter overflow as an interrupt source.

The next figure presents the interrupt options when you put the block in APWM mode by selecting APWM for Operating mode on the General pane.

Post interrupt on counter equal period match

Post an interrupt when the value of the counter is the same as the value of the period register (CTR=PRD).

Post interrupt on counter equal compare match

Post an interrupt when the value of the counter is the same as the value of the compare register (CTR=CMP).

References

For detailed information about interrupt processing, see TMS320x28xx, 28xxx Enhanced Capture (eCAP) Module Reference Guide, SPRU807B, available at the Texas Instruments™ website.

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS