| Contents | Index |
Embedded Coder/ Embedded Targets/ Processors/ Texas Instruments C2000/ C2803x
Embedded Coder/ Embedded Targets/ Processors/ Texas Instruments C2000/ C280x
Embedded Coder/ Embedded Targets/ Processors/ Texas Instruments C2000/ C28x3x
Embedded Coder/ Embedded Targets/ Processors/ Texas Instruments C2000/ C2834x
The enhanced quadrature encoder pulse (eQEP) module is used for direct interface with a linear or rotary incremental encoder to get position, direction, and speed information from a rotating machine for use in a high-performance motion and position-control system.

If more than one eQEP module is available on your processor, select the module this block configures.
The input signals QEPA and QEPB are processed by the Quadrature Decoder Unit (QDU) to produce clock (QCLK) and direction (QDIR) signals. Choose the position counter mode appropriate to the way the input to the eQEP module is encoded. Choices are Quadrature-count (the default), Direction-count, Up-count, and Down-count.
This field appears only when you choose Quadrature-count in Position counter mode. Choose the direction that represents positive rotation: Clockwise (the default) or Counterclockwise.
This field appears only when you choose Direction-count, Up-count, or Down-count in Position counter mode. In these cases, you can program clock generation to the position counter to occur on both rising and falling edges of the QEPA input or on the rising edge only. The effect of choosing the former is increasing the measurement resolution by a factor of 2. Choices are 2x resolution: Count the rising/falling edge (the default) or 1x resolution: Count the rising edge only.
This check box appears only when you choose Quadrature-count in Position counter mode. Select this check box if you want to create a port on the block that gives access to the direction flag of the quadrature module.
Select any of these check boxes to invert the polarity of the respective eQEP input signal.
Select this check box to enable gating of the index pulse.
Enter the sample time in seconds.

This check box is selected by default. Leave it selected to output the position counter signal PCSOUT from the position counter and control unit (PCCU).
Enter a maximum value for the position counter. Enter a value from 0 to 4294967295. The value defaults to the maximum allowed value of 4294967295.
Select to set the position counter to its initialization value on an index event. This check box is cleared by default.
This field appears only when Enable set to init value on index event is selected. Choose to set the position counter to its initialization value on the Rising edge (the default) or the Falling edge of the index input.
Select to set the position counter to its initialization value on a strobe event. This check box is cleared by default.
This field appears only when Enable set to init value on strobe event is selected. Rising edge, the default option, sets the position counter to its initialization value on the rising edge of the strobe input. In the forward direction, Depending on direction sets the position counter to its initialization value on the rising edge of the strobe input. In the reverse direction, Depending on direction sets the position counter to its initialization value on the falling edge of the strobe input.
Select to allow the position counter to be set to its initialization value via software. This check box is cleared by default.
This field appears only when Enable software initialization is selected. Choose Set to init value at start up (the default) or Input port to receive the control logic through the input port.
This field appears only when Enable set to init value on index event, Enable set to init value on strobe event, or Enable software initialization check box is selected. Enter the initialization value for the position counter. Enter a value from 0 to 4294967295. The value defaults to 2147483648.
Choose a position counter reset mode, depending on the nature of the system the eQEP module is working with: Reset on an index event (the default), Reset on the maximum position, Reset on the first index event, or Reset on a time unit event.
This check box appears only when Position counter reset mode is set to Reset on an index event. Select this check box to output the position counter error flag on error.
This check box appears only when Position counter reset mode is set to Reset on the maximum position or Reset on the first index event. The eQEP index input can be configured to latch the position counter (QPOSCNT) into QPOSILAT on occurrence of a definite event on this pin. Select this check box to latch the position counter on each index event.
This field appears only when the Output latch position counter on index event check box is selected. Choose one of the following events to configure the eQEP position counter to latch on that event: Rising edge, Falling edge, or Software index marker via input port.
This check box appears only when Position counter reset mode is set to Reset on the maximum position or Reset on the first index event. The eQEP strobe input can be configured to latch the position counter (QPOSCNT) into QPOSSLAT on occurrence of a definite event on this pin. Select this check box to latch the position counter on each strobe event.
This field appears only when the Output latch position counter on strobe event check box is selected. Choose Rising edge to latch on the rising edge of the strobe event input, or Depending on direction to latch on the rising edge in the forward direction and the falling edge in the reverse direction.

The eQEP peripheral includes an integrated edge capture unit to measure the elapsed time between the unit position events. Check this check box to enable the edge capture unit. This check box is cleared by default.
Select this check box to output the capture timer into the capture period register. This check box is cleared by default.
Select this check box to output the capture period into the capture period register. This check box is cleared by default.
The eQEP capture timer runs from prescaled SYSCLKOUT. The capture timer period is the value of SYSCLKOUT divided by the value you choose in this field. Choices are 1, 2, 4, 8, 16, 32, 64, and 128 (the default).
The timing of the unit position event is determined by prescaling the quadrature-clock (QCLK). QCLK is divided by the value you choose in this popup. Choices are 4, 8, 16, 32, 64, 128, 256, 512, 1024, and 2048 (the default).
Select this check box to enable and output the eQEP overflow error flag in the event of capture timer overflow between unit position events.
Select this check box to enable and output the direction change error flag.
Choose the event that triggers the latching of the capture timer and capture period register: On position counter read (the default) or On unit time-out event.
This field appears only when you choose On unit time-out event in Capture timer and position. Enter a value for the unit timer period from 0 to 4294967295. The value defaults to 100000000.
Select this check box to output the capture timer latched value from the QCTMRLAT register.
Select this check box to output the capture timer period latched value from the QCPRDLAT register.
Select this check box to output the position counter latched value from the QPOSLAT register.

The eQEP peripheral includes a position-compare unit that is used to generate the position-compare sync signal on compare match between the position counter register (QPOSCNT) and the position-compare register (QPOSCMP). Select this check box to enable the position-compare sync signal output. This check box is cleared by default.
Choose which pin is used for the sync signal output. Choices are Index pin is used for sync output (the default) and Strobe pin is used for sync output.
Choose the source of the value to use in the position comparison. Choose Specify via dialog (the default) to specify a fixed value or Input port to read the value from the input port.
This field lets you enable or disable shadow mode for use in generating the position-compare sync signal (shadow mode is enabled by default). When shadow mode is enabled, you can also choose an event to trigger the loading of the shadow register value into the active register.
Choose Disable shadow mode to disable shadow mode. Choose Load on QPOSCNT=0 (the default) to load on the position-counter zero event. Choose Load on QPOSCNT=QPOSCMP to load on compare match.
This field appears only when you choose Specify via dialog in Compare value source. Enter a value from 0 to 4294967295. The value defaults to 4294967295. This value is loaded into the position-compare register (QPOSCMP).
The pulse stretcher logic in the position-compare unit generates a programmable position-compare sync pulse output on the position-compare match.
Enter a value from 1 to 4096 to determine the pulse width of the position-compare sync output signal. The value defaults to 1.
Choose a value to determine the polarity of the sync output signal: Active high (the default) or Active low.

The eQEP peripheral contains a watchdog timer that monitors the quadrature-clock to indicate proper operation of the motion-control system. Select this check box to enable the watchdog time out flag.
Enter the time-out value for the watchdog timer. Enter a value from 0 to 65535 (the default).

The image above shows the default condition of the Signal data types pane. Choosing any of a number of options in other panes of the eQEP dialog box causes a corresponding popup to appear in the Signal data types pane.
The following table summarizes the options for which you can set the data type in the Signal data types pane:
| Pane | Option |
|---|---|
| General | Quadrature direction flag output port |
| Position counter | Output position counter (selected by default) |
| Output position counter error flag | |
| Output latch position counter on index event | |
| Output latch position counter on strobe event | |
| Speed calculation | Output capture timer |
| Output capture period timer | |
| Enable and output overflow error flag | |
| Enable and output direction change error flag | |
| Output capture timer latched value | |
| Output capture timer period latched value | |
| Output position counter latched value | |
| Watchdog unit | Enable watchdog time out flag via output port |
The fields that appear on the Signal data types pane are named similarly to these options. For example, Position counter value data type on the Signal data types pane corresponds to the Output position counter option on the Position counter pane.
For all data type fields, valid data types are auto, double, single, int8, uint8, int16, uint16, int32, uint32, and boolean.

The image above shows the default condition of the Interrupt pane. Interrupts corresponding to specific events are enabled or disabled based on the settings in this pane.
Check this box to enable position counter error interrupts. This checkbox is cleared by default.
Check this box to enable quadrature phase error interrupts. This checkbox is cleared by default.
Check this box to enable quadrature direction change interrupts for changes in the counting direction. This checkbox is cleared by default.
The eQEP Peripheral contains a watchdog timer that monitors the quadrature clock. Check this box to enable watchdog timeout interrupts. This checkbox is cleared by default.
Check this box to enable position counter underflow interrupts. This checkbox is cleared by default.
Check this box to enable position counter overflow interrupts. This checkbox is cleared by default.
Check this box to enable position-compare ready interrupts. This checkbox is cleared by default.
Check this box to enable position-compare match interrupts. This checkbox is cleared by default.
Check this box to enable strobe event latch interrupts. This checkbox is cleared by default.
Check this box to enable index event latch interrupts. This checkbox is cleared by default.
Check this box to enable unit timeout interrupts. This checkbox is cleared by default.
For more information on the QEP module, consult the following documents, available at the Texas Instruments Web site:
TMS320x280x, 2801x, 2804x Enhanced Quadrature Encoder Pulse (eQEP) Module Reference Guide, Literature Number SPRU790
Using the Enhanced Quadrature Encoder Pulse (eQEP) Module in TMS320x280x, 28xxx as a Dedicated Capture Application Report, Literature Number SPRAAH1

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |