Receive and log transitions on capture input pin or configure auxiliary pulse width modulator
Embedded Coder Support Package for Texas Instruments C2000 Processors / C2802x
Embedded Coder Support Package for Texas Instruments C2000 Processors / C2803x
Embedded Coder Support Package for Texas Instruments C2000 Processors / C2805x
Embedded Coder Support Package for Texas Instruments C2000 Processors / C2806x
Embedded Coder Support Package for Texas Instruments C2000 Processors / C280x
Embedded Coder Support Package for Texas Instruments C2000 Processors / C2833x
Embedded Coder Support Package for Texas Instruments C2000 Processors / C2834x
Embedded Coder Support Package for Texas Instruments C2000 Processors / F2807x
Embedded Coder Support Package for Texas Instruments C2000 Processors / F2837xD
Embedded Coder Support Package for Texas Instruments C2000 Processors / F2837xS
Embedded Coder Support Package for Texas Instruments C2000 Processors / F2838x/ C28x
Embedded Coder Support Package for Texas Instruments C2000 Processors / F28004x
Embedded Coder Support Package for Texas Instruments C2000 F28M3x Concerto Processors / F28M35x / C28x
Embedded Coder Support Package for Texas Instruments C2000 F28M3x Concerto Processors / F28M36x / C28x
The eCAP block captures the timing of important external events, such as Hall sensor signals in speed measurements of rotating machinery. When not used in capture mode, the block can be used in APWM mode, which is a single-channel, asymmetric pulse width modulator (APWM). You can add one eCAP block to your model for each capture pin. You cannot assign the same eCAP pin to two eCAP blocks in a model. eCAP and APWM modes use the same pins. In eCAP mode, the pins are used as input to capture the transitions. In APWM mode, the pins are used to output a PWM waveform.
SI — Synchronization input from softwareThe input from the software used to synchronize the eCAP counter. The synchronization occurs when the synchronization input value is 1.
The port appears only when:
On the General tab, you select Operating mode > eCAP or APWM.
On the General tab, you select Enable counter Sync-In mode and Enable software-forced counter synchronizing input.
Data Types: int8 | uint8 | int16 | uint16 | int32 | uint32 | single | double | Boolean
RA — One-Shot capture sequenceStarts a One-Shot capture sequence.
A 2-bit stop register is used to compare the Mod4 counter output, and when the register and counter values are equal the Mod4 counter is stopped.
The port appears only when:
On the General tab, you select Operating mode > eCAP.
On the eCAP tab, you set Select mode control > One-Shot and select Enable One-Shot re-arming control input.
Data Types: int8 | uint8 | int16 | uint16 | int32 | uint32 | single | double | Boolean
T — APWM periodPeriod of the APWM.
The port appears only when:
On the General tab, you select Operating mode > APWM.
On the APWM tab, you select Waveform period source > Input port.
Data Types: int8 | uint8 | int16 | uint16 | int32 | uint32 | single | double | Boolean
W — APWM widthWidth of the APWM.
The port appears only when:
On the General tab, you select Operating mode > APWM.
On the APWM tab, you select Duty cycle source > Input port.
Data Types: int8 | uint8 | int16 | uint16 | int32 | uint32 | single | double | Boolean
The output ports appear only in eCAP mode.
TS — Output timestamps of capture eventsTS is a vector of 4 signal dimension corresponding to CAP1, CAP2, CAP3 and CAP4 time stamp values depending on the capture event selected in Stop value after on the eCAP tab. Use the Enable reset counter after capture event # time-stamp option to reset the counter after an event. This option is useful for finding the time difference between the events.
Data Types: int8 | uint8 | int16 | uint16 | int32 | uint32 | single | double | Boolean
CF — Status of capture eventCF is a vector of dimension 4, corresponds to CEVT1-CEVT2. The status
of the capture event. 0 indicates that no event has
occurred. 1 indicates that the event specified by the
Stop value after parameter has occurred
at the eCAP pin.
The port appears only when you select Enable capture event status flag output on the eCAP tab.
Data Types: int8 | uint8 | int16 | uint16 | int32 | uint32 | single | double | Boolean
OF — Status of overflowThe status of overflow. 0 indicates that counter
has not overflowed. 1 indicates that the counter has
overflowed from the highest value to 0.
The port appears only when you select Enable overflow status flag output on the eCAP tab.
Data Types: int8 | uint8 | int16 | uint16 | int32 | uint32 | single | double | Boolean
Operating mode — Select eCAP or APWM modeeCAP (default) | APWMWhen 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 — Select capture unit pineCAP1 (default) | eCAP2 | eCAP3 | eCAP4 | eCAP5 | eCAP6 | eCAP7Select the required eCAP module to have a dedicated eCAP pin for capturing the external events.
The pin selection for the eCAP module can be done by browsing to Hardware Implementation > Target hardware resources. The selection option is provided only if the module has more than one pin that can be configured for an eCAP module.
Counter phase offset value (0 ~ 4294967295) — Time base for event captures0 (default) | integer in [0 4294967295]This value provides the time base for event captures, clocked by the system clock. A phase register is used to synchronize with other counters via software- or hardware-forced synchronization. For information about software- or hardware-forced synchronization, see the Enable counter Sync-In mode parameter. This value is useful in APWM mode when you need a phase offset between capture modules. Set the phase offset to an integer from 0 to 42949667295 (232) counts.
Enable counter Sync-In mode — Enable TSCTR counter to load from TSCTR registeroff (default) | onSynchronization can be done using the SYNCI event or the software. When synchronization occurs, the shadow register CTRPHS is loaded into the active counter TSCTR in the current eCAP module and the eCAP modules downstream.
Enable software-forced counter synchronizing input — Synchronize one or more eCAP time basesoff (default) | onA software method for synchronizing one or more eCAP time bases. The synchronization occurs when the synchronization input value is 1.
This parameter appears only when Enable counter Sync-In mode is selected.
Sync output selection — Synchronize eCAP counter with other eCAP countersCTR=PRD (default) | Pass through | DisabledSynchronizes an eCAP counter with other eCAP counters. The options are:
CTR=PRD — Triggers the sync-out
signal when the counter value equals the period.
Pass through — The sync-in
event is passed through as the sync-out signal.
Disabled — Disables the
sync-out signal.
Sample time — Frequency at which block reads input pin value0.001 (default)Sample time for the block in seconds.
To enable configuration parameters on the eCAP tab, set Operating
mode to eCAP on the
General tab.
Event prescaler (integer from 0 to 31) — Prescales input signal in mutiples of 20 (default) | scalar integer in [0 31]The input signal is prescaled by twice the value of this parameter.
For example, if you enter 1, the input is prescaled
by 2, and for 31, the input is prescaled by 62.
Entering 0 bypasses the input prescaler, leaving the
input capture signal unchanged.
Select mode control — Mode of captureContinuous (default) | One-ShotThe Continuous option performs continuous
timestamp captures (events 1 through 4) using a circular buffer.
The One-Shot option enables the
Enable One-Shot rearming control via input port
option.
Enable One-Shot rearming control via input port — Re-arms a One-Shot capture sequenceoff (default) | onWhen this parameter is selected, a One-Shot capture sequence is re-armed as follows:
Mod4 counter is reset to zero.
Mod4 counter is unfrozen.
Capture register loading is enabled.
This parameter appears only when you select
One-Shot for Select mode
control.
Stop value after — Number of capture events after which capture stopsCapture Event 1 (default) | Capture Event 2 | Capture Event 3 | Capture Event 4The number of capture events after which you want to stop the capture sequence.
Enable reset counter after capture event # time-stamp — Resets counter after capture eventoff (default) | onThe eCAP process resets the counter after receiving a capture event
timestamp. In this case, # represents the number of
the capture event set in the Stop value after
parameter.
Select capture event # polarity — Start capture event on rising edge or falling edgeRising Edge (default) | Falling EdgeThe option that starts a capture event. In this case,
# represents the number of the capture event set
in the Stop value after parameter.
Time-Stamp counter data type — Data type of counteruint32 (default) | double | single | int8 | uint8 | int16 | uint16 | int32 | booleanThe data type of the timestamp counter.
Enable capture event status flag output — Output capture event statusoff (default) | onOutputs the capture event status flag at the output port
CF. The block outputs 0
until the event is captured. After the event, the flag value is
1.
Capture flag data type — Data type of output port CFuint32 (default) | double | single | int8 | uint8 | int16 | uint16 | int32 | booleanThe data type of the output port CF.
This parameter appears only when you select Enable capture event status flag output.
Enable overflow status flag output — Output status of elements of FIFO bufferOutputs the status of the elements of the FIFO buffer at the output port OF.
Overflow flag data type — Data type of output port OFuint32 (default) | double | single | int8 | uint8 | int16 | uint16 | int32 | booleanThe data type of the output port OF.
This parameter appears only when you select Enable overflow status flag output.
To enable configuration parameters on the APWM tab, set Operating
mode to APWM in the
General tab.
Waveform period units — Units for measuring waveform periodSeconds (default) | Clock cyclesClock cycles uses the high-speed peripheral
clock cycles of the processor.
Waveform period source — Source from which waveform period value is obtainedSpecify via dialog (default) | Input portSelect Specify via dialog to enter the
value in Waveform period, or select
Input port to use a value from the
T input port.
Waveform period — Period of PWM waveform0.001 (default)Period of the PWM waveform measured in clock cycles or seconds, as specified in Waveform period units.
Note
The term clock cycles refers to the high-speed peripheral clock on the F2812 chip. This high-speed peripheral clock is 75 MHz by default because the high-speed peripheral clock prescaler is set to 2 (150 MHz/2).
This parameter appears only when Waveform period
source is set to Specify via
dialog.
Duty cycle units — Units for measuring duty cyclePercentages (default) | Clock cyclesThe units used for measuring the duty cycle.
Duty cycle source — Source from which duty cycle for PWM waveform is obtainedSpecify via dialog (default) | Input portSelect Specify via dialog to enter the
value in Duty cycle, or select Input
port to use a value from the
W input port.
Duty cycle — Ratio of PWM waveform pulse duration to PWM waveform periodThe ratio of PWM waveform pulse duration to PWM waveform period. This ratio is expressed in Duty cycle units.
Output polarity select — Set active level for outputActive High (default) | Active LowWhen you select Active High, the compare
value (duty cycle) defines the high time. Selecting Active
Low directs the compare value to define the low
time.
Post interrupt on capture event # — Set interrupt source to capture eventoff (default) | onYou can use the C28x Hardware Interrupt block to
respond to this interrupt. In this case, # represents
the number of the capture event set in the Stop value
after parameter.
This parameter appears only when you set Operating
mode to eCAP in the
General tab.
Post interrupt on counter overflow — Trigger interrupt on counter overflowoff (default) | onTriggers an interrupt when the counter overflows.
This parameter appears only when you set Operating
mode to eCAP in the
General tab.
Post interrupt on counter equal period match — Post interrupt when counter equals period registeroff (default) | onPosts interrupt when the value of counter is same as the value of the period register (CTR = PRD).
This parameter appears only when you set Operating
mode to APWM in the
General tab.
Post interrupt on counter equal compare match — Post interrupt when counter equals compare registeroff (default) | onPosts interrupt when the value of the counter is same as the value of the compare register (CTR = CMP).
This parameter appears only when you set Operating
mode to APWM in the
General tab.