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.

TMS320F28377D: When initializing CAN, the ePWM voltage rises.

Part Number: TMS320F28377D

Hello

During the ePWM duty test, we have observed an abnormal behavior and would like to inquire about it.

ePWM Configuration:
-Frequency: 15 kHz
-Duty: Variable
-Initial State: All channels of ePWM are set to LOW output.


The problematic symptom is as follows: after inserting the software (SW) and executing it, channels A and B of ePWM 2 to 10 correctly output the initial settings, remaining LOW (0V). However, only channel A of ePWM 1 is outputting 2.5 V.

Furthermore, when setting the duty, the minimum value of 2.5 V is applied, resulting in the output of channel A of ePWM 1. Additionally, it is observed that all ePWM channels from 1 to 10 have their configured frequency (15 kHz) and duty applied in real-time.

During debugging, we placed breakpoints and executed the source code step by step. It was discovered that when executing the line sTXCANMessage[canab].ui32Flags = CAN_MSG_OBJ_NO_FLAGS;, the A channel of ePWM 1 rises to 2.5V.

CAN Initializecode
// Initialize the transmit message object used for sending CAN messages.
// Message Object Parameters:
sTXCANMessage[canab].ui32MsgID = 0U;
sTXCANMessage[canab].ui32MsgIDMask = 0U;
sTXCANMessage[canab].ui32Flags = CAN_MSG_OBJ_NO_FLAGS;
// CAN_MSG_OBJ_NO_FLAGS = 0
sTXCANMessage[canab].ui32MsgLen = 8U;
sTXCANMessage[canab].pucMsgData = txCanMsgData;

As we are not using the CAN functionality, we have commented out all CAN-related functions and verified the output of ePWM 1 channel A. The result showed that the measured period was larger than the initial setting, and it was not possible to change the duty in real-time.

To change the duty value in this state, we needed to reload the source code and change the duty value or execute the trip zone to set the ePWM signal to LOW before changing the duty value.

EPwm1Regs.TZFRC.bit.OST=1U;

However, even with these methods, ePWM channels 1, the period (15 kHz) did not remain constant and slightly increased according to the duty.

Based on these symptoms, it appears that there might be a correlation between CAN and ePWM. However, we couldn't confirm any direct association between ePWM 1, which is being used as an interrupt source in the source code, and CAN.

We are curious to know if there is any relationship between the CAN sTXCANMessage[canab].ui32Flags and ePWM 1. All other ePWM channels function correctly, allowing period and duty settings under any situation.

Thank you for your understanding, and we would greatly appreciate your response.
I apologize for any awkwardness in the sentences.

  • Hi Lee,

    Could you send over a project that only includes the CAN / ePWM initalization where you're able to see the problem? I am unaware of any correlation between CAN initialization and PWMs being affected.

    Thank you,

    Ryan Ma

  • Today, I resolved this issue. The cause of the problem was resolved by changing the 'EPwm1Regs.TBCTL.bit.PHSEN' setting to DISABLE in the code below. After changing it to DISABLE, I confirmed that the duty settings are changing correctly. However, I am still investigating why only EPwm1 had an issue while the others (EPwm 3 to 10) are all set to ENABLE and are functioning correctly.

    • ePWM settings:

    • EPwm1Regs.TBCTL.bit.SYNCOSEL = (Uint16)TB_SYNC_IN;

    • EPwm1Regs.TBCTL.bit.PHSEN = (Uint16)TB_DISABLE; // Changed to DISABLE

    • EPwm1Regs.TBPHS.bit.TBPHS = 2U;

    • EPwm1Regs.TBCTL.bit.PHSDIR = (Uint16)TB_UP;

    • EPwm3Regs.TBCTL.bit.SYNCOSEL = (Uint16)TB_SYNC_IN;

    • EPwm3Regs.TBCTL.bit.PHSEN = (Uint16)TB_ENABLE;

    • EPwm3Regs.TBPHS.bit.TBPHS = 2U;

    • EPwm3Regs.TBCTL.bit.PHSDIR = (Uint16)TB_UP;

                 ~ 10 

    Thank you for your response.

  • Hi Lee,

    If ePWM1 is your primary sync module, then setting the PHSEN bit to disable is the correct action to take for the configuration of the ePWM module.

    Best,

    Ryan Ma