SPRAC77E January 2022 – February 2022 TMS320F28379D , TMS320F28379D-Q1 , TMS320F28379S
After translating the absolute position into QCLK pulses as described in Section 4.2, the C28x loads the PTO parameters into the HLC's FIFO. When it is time to start the PTO, a command via the GPREG bits will signal the HLC to pull the parameters from the FIFO, to load them into the counters, and then to start the PTO. Once started, the CLB generates the PTO-QEP waveform independently.
Once the PTO is complete, the HLC will set a CLB interrupt tag. The C28x can use this to flag to check if the PTO is complete before loading a new configuration.
Figure 4-6 shows PTO-QEP waveforms and their tie to CLB components. In this example, the position sampling period is controlled by an ePWM ISR on the C28x.
The CLB Tile block diagram is shown in Figure 4-7 and Table 4-3 describes the functionality of each CLB component in detail.
Resource | Function | Notes |
---|---|---|
Inputs | ||
In0 | LOAD control Rising edge: Loads new PTO configuration (HLC). |
Connected to GPREG bit 0. Before loading a new configuration, check that the last PTO is complete (INTR tag == 2) |
In1 | DIRECTION control
1: clockwise (forward) 0: counter-clockwise (backward) |
Connected to GPREG bit 1. Change only when the last PTO is complete (Intr Tag 2) |
In2 | Not used | Not used |
In3 | Not used | Not used |
In4 | Not used | Not used |
In5 | Not used | Not used |
In6 | Not used | Not used |
In7 | Not used | Not used |
Outputs | ||
Out0 | Not used | Not used |
Out1 | Not used | Not used |
Out2 | PTO_QEP-I The index transiton from 0 to 1 indicates the absolute zero position has been crossed. |
The index output signal. |
Out3 | Not used | Not used |
Out4 | PTO_QEP-A | PTO quadrature output A |
Out5 | PTO_QEP-B | PTO quadrature output B |
Out6 | Not used | Not used |
Out7 | Not used | Not used |
Logic Resources | ||
LUT0 | Not used | Not used |
LUT1 | Not used | Not used |
LUT2 | Not used | Not used |
FSM0 | Generate PTO_QEP-A and PTO-QEP-B | Generate 1 edge on each QCLK input. The lead/lag of QEP-A/B is based on the current state and the DIRECTION input signal. |
FSM1 | Generate HALT/RUN signal | Halt the PTO output if either of these conditions is true:
|
FSM2 | Generate PTO_QEP-I signal | Force PTO_QEP-I high and low based on the QEP-I control. Enables the user to configure QEP-I to stay high for more than one QCLK if desired. |
CNT0 | Generate QCLK (PTO width control) signal | Counts up by 1 each CLB clock.
|
CNT1 | PTO edge-count control | Increments by 1 every QCLK event to count the total QEP-A + QEP-B edges sent during a PTO.
|
CNT2 | PTO_QEP-I control | Increments by 1 every QCLK event to count the total QEP-A + QEP-B edges sent during a PTO.
Note: If PTO-QEP-I should remain low for the whole PTO, then configure match1 and match2 to be a large number to avoid a match. (i.e. 0xFFFFFFFF). |
High Level Controller | ||
HLC | Event 1: LOAD new PTO configuration. |
Responds to a rising edge on the LOAD input from the C28x. This will configure and start a new PTO. For all of the steps, refer to the program description in Section 4.3.3 |
Event 2: Signal PTO is complete. | Responds to the completion of PTO signal by setting Interrupt Tag 2. At this point, it is safe to load a new PTO counter configuration. |