SPRAC77E January 2022 – February 2022 TMS320F28379D , TMS320F28379D-Q1 , TMS320F28379S
The PTO API implementation source files are located under [C2000Ware_MotorControl_SDK]\libraries\position_sensing\pto\source.
The following resources are used inside the CLB tile to achieve the desired function detailed in Section 3.1.
Implementation is described in detail, below and visualized in Figure 3-4.
Resource | Function | Notes |
---|---|---|
Inputs | ||
In0 | On/Off Control via GPREG | Enable CLB |
In1 | On/Off Control via GPREG | QEPA via EPWM4A |
In2 | Edge Detect | QEPA via EPWM4A |
In3 | Not used | Not used |
In4 | On/Off Control via GPREG | QEPB via EPWM5A |
In5 | Edge Detect | QEPB via EPWM5A |
In6 | Not used | Not used |
In7 | Edge Detect | QEPI via EPWM4B |
Outputs | ||
Out0 | Not used | Not used |
Out1 | Not used | Not used |
Out2 | Not used | Not used |
Out3 | Not used | Not used |
Out4 | Transmit Enable | PTO Direction Via OUTPUT XBar; Input for CLB 2 |
Out5 | Transmit Enable | QEPI output via OUTPUTXBAR3 |
Out6 | Not used | Not used |
Out7 | Not used | Not used |
Logic Resources | ||
LUT0 | Not used | Not used |
LUT1 | Determines QCLK direction in combo with FSM0 and FSM1 | Provides input to FSM1 for external input 0 |
LUT2 | Not used | Not used |
FSM0 | Alternate inputs between QEPA and QEPB | This state machine checks the QEP signals and alternates between the different signals |
FSM1 | Set QCLK direction | Uses output of LUT1 and FSM0 to set up the QCLK, which in turn sets the direction. The output will be routed to CLB2 as the input direction |
FSM2 | Index pulse generation | Takes the QEPI input and uses CNT2 Match2 value to set the QEPI output period and duty cycle. |
CNT0 | Set index pulse width value | Load indexWidth-1 value set via CLB_writeInterface function |
CNT1 | Set divider value | Load divider*4 value set via CLB_writeInterface function |
CNT2 | Set divide value | Load divider*2 value set via CLB_writeInterface function |
High Level Controller | ||
HLC | Not used | Not used |
Resource | Function | Notes |
---|---|---|
Inputs | ||
In0 | On/Off Control via GPREG | Enable CLB |
In1 | On/Off Control via GPREG | QEPA via EPWM4A |
In2 | Edge Detect | QEPA via EPWM4A |
In3 | Not used | Not used |
In4 | Edge Detect | QEPB via EPWM5A |
In5 | Not used | Not used |
In6 | Not used | Not used |
In7 | On/Off Control via GPREG | PTO direction routed from CLB1 out4 |
Outputs | ||
Out0 | Transmit Enable | QEPA Output via EPWM2A |
Out1 | Not used | Not used |
Out2 | Transmit Enable | QEPB Output via EPWM2B |
Out3 | Not used | Not used |
Out4 | Transmit Enable | Bypass Logic |
Out5 | Not used | Not used |
Out6 | Not used | Not used |
Out7 | Not used | Not used |
Logic Resources | ||
LUT0 | QEPA/QEPB signal input | When the tile is on, send the selected QEP signal to CNT0 as mode0 input |
LUT1 | Generate high and low values for | Alternate between high and low |
LUT2 | Not used | Not used |
FSM0 | QEP Pulse width generation | This state machine together with CNT0 will generate a number of hi and low pulse widths for LUT1 and LUT2. |
FSM1 | QEPA signal generation | Generates QEPA output using CNT0 and LUT1. |
FSM2 | QEPB signal generation | Generates QEPB output using CNT0 and LUT2. |
CNT0 | Counter for output QEP signal generation | Counter Match1 value is the external input for FSM0. Match2 value is the reset value for the counter. The match2 value is passed to LUT1 and LUT2 . |
CNT1 | Not used | Not used |
CNT2 | Not used | Not used |
High Level Controller | ||
HLC | Not used | Not used |