This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F280025C: Input XBAR TRIP GPIO configuration

Part Number: TMS320F280025C
Other Parts Discussed in Thread: C2000WARE, LAUNCHXL-F280025C

Hi,

I'm using the motorcontrol SDK example univeral motorcontrol lab and there is nFault GPIO34 configured, to trip the ePWM modul and to shut down the controller.

I would like now to add another GPIO trip input, but I'm unable to make that working.

What I have done:

in hal.h - configured GPIO 25 as an additional trip pin:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//! \brief Defines the gpio for the nFAULT of Power Module
#define MTR1_PM_nFAULT_GPIO 34
//! \brief Defines the gpio for the nFAULT of Power Module
#define MTR1_PM_nFAULT_2_GPIO 25
...
//------------------------------------------------------------------------------
// XBAR-EPWM
#define MTR1_XBAR_TRIP_ADDRL XBAR_O_TRIP7MUX0TO15CFG
#define MTR1_XBAR_TRIP_ADDRH XBAR_O_TRIP7MUX16TO31CFG
#define MTR1_IDC_XBAR_EPWM_MUX XBAR_EPWM_MUX05_CMPSS3_CTRIPL // CMPSS3-LP
#define MTR1_IDC_XBAR_MUX XBAR_MUX05 // CMPSS3-LP
#define MTR1_IU_XBAR_EPWM_MUX XBAR_EPWM_MUX00_CMPSS1_CTRIPH // CMPSS1-HP
#define MTR1_IV_XBAR_EPWM_MUX XBAR_EPWM_MUX04_CMPSS3_CTRIPH_OR_L // CMPSS3-HP&LP
#define MTR1_IW_XBAR_EPWM_MUX XBAR_EPWM_MUX01_CMPSS1_CTRIPL // CMPSS1-LP
#define MTR1_IU_XBAR_MUX XBAR_MUX00 // CMPSS1-HP
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

In hal.c - configure the GPIO25 pin as input (I use an external pull up):

Fullscreen
1
2
3
GPIO_setPinConfig(GPIO_25_GPIO25);
GPIO_setDirectionMode(25, GPIO_DIR_MODE_IN);
GPIO_setPadConfig(25, GPIO_PIN_TYPE_STD);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

In hal.c - set the trip zone:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
XBAR_setEPWMMuxConfig(MTR1_XBAR_TRIP, MTR1_IU_XBAR_EPWM_MUX);
// Configure TRIP7 to be CTRIP1H and CTRIP1L using the ePWM X-BAR
XBAR_setEPWMMuxConfig(MTR1_XBAR_TRIP, MTR1_IV_XBAR_EPWM_MUX);
// Configure TRIP7 to be CTRIP3H and CTRIP3L using the ePWM X-BAR
XBAR_setEPWMMuxConfig(MTR1_XBAR_TRIP, MTR1_IW_XBAR_EPWM_MUX);
// Disable all the mux first
XBAR_disableEPWMMux(MTR1_XBAR_TRIP, 0xFFFF);
// Enable Mux 0 OR Mux 4 to generate TRIP
XBAR_enableEPWMMux(MTR1_XBAR_TRIP, MTR1_IU_XBAR_MUX |
MTR1_IV_XBAR_MUX | MTR1_IW_XBAR_MUX);
#endif // !(MOTOR1_ISBLDC || MOTOR1_DCLINKSS)
// configure the input x bar for TZ2 to GPIO, where Over Current is connected --> //ToDo: Trigger another GPIO error
XBAR_setInputPin(INPUTXBAR_BASE, MTR1_XBAR_INPUT1, MTR1_PM_nFAULT_GPIO);
XBAR_lockInput(INPUTXBAR_BASE, MTR1_XBAR_INPUT1);
XBAR_setInputPin(INPUTXBAR_BASE, MTR1_XBAR_INPUT2, MTR1_PM_nFAULT_2_GPIO);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

So, I cannot see, what I'm missing. It seems to be configured exactly like the GPIO34 pin and should trigger TZ2. Is there something missing with the comparator?

Edit: What I added to hal.c:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
...
XBAR_setInputPin(INPUTXBAR_BASE, MTR1_XBAR_INPUT2, MTR1_PM_nFAULT_2_GPIO);
XBAR_lockInput(INPUTXBAR_BASE, MTR1_XBAR_INPUT2);
for(cnt=0; cnt<3; cnt++)
{
...
EPWM_enableTripZoneSignals(obj->pwmHandle[cnt], MTR1_TZ_OSHT2);
...
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Edit 2: I also tried the example epwm_ex1_trip_zone from here: C:\ti\c2000\C2000Ware_4_00_00_00\driverlib\f28002x\examples\epwm

The thing is, when I for example use GPIO13 like the following, I can trip:

Fullscreen
1
2
3
4
5
6
uint32_t gp = 13;
GPIO_setPinConfig(GPIO_13_GPIO13);
GPIO_setDirectionMode(gp, GPIO_DIR_MODE_IN);
GPIO_setPadConfig(gp, GPIO_PIN_TYPE_PULLUP);
GPIO_setQualificationMode(gp, GPIO_QUAL_ASYNC);
XBAR_setInputPin(INPUTXBAR_BASE, XBAR_INPUT2, gp);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

But when I use for example GPIO14, it does not work. Also when I just use the PULLUP config for the GPIO14, it never pulls it up.

So, do not all GPIO have a pullup and work as a input for the XBAR?