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.

TMS320F28379D: I have a problem with the project

Genius 9880 points

Part Number: TMS320F28379D
Other Parts Discussed in Thread: DRV8305, CONTROLSUITE, LAUNCHXL-F28379D, DRV8301

Hi Team,

Good day.

Customer cannot generate PWM using the tms320f28379d and drv8305 combination. Below is the query.

"I have plate tms320f28379d and drv8305. I do everything according to the instructions, but PWM is not generated as I have the parameters changed accordingly.

dev.ti.com/.../node

I am following lab1 I change the parameters accordingly, debugs and nFault does not disappear on the driver

I change value on flag and nothing do. On board is red on nFAULT." 

Debug.zip

Thank you and looking forward for your kind response

Regards,

Maynard

  • Are you using IDDK or dual motor project? IDDK does not use DR8305, but dual motor launch pad based project does. If you refer to the launchpad project as starting point, it is better.

  • How i can "If you refer to the launchpad project as starting point, it is better."?

  • your source code seem to refer to IDDK project. IDDK project has different set of pin assignments and it does not use DRV8305. In launchpad project, it supports DRV8305 and functional assignments may be appropriate.

  • Can I change the pin set in my project to support DRV8305?

  • how i can change?

  • You can refer to this project for reference

    C:\ti\controlSUITE\development_kits\TIDM-SERVO-LAUNCHXS\MonoMtrServo_377s_v1_00_00_00

    Pls try to spend some time reviewing the user guides/ device datasheet of DRV8305 and the example project, so that you can appreciate the nuances better.

  • I tried but it didn't work

  • I have signal pwm 50% on nFAULT but diode is light on red

  • This project is based on LaunchXL-F28377S. You need to change the GPIO pins assignment, ADC, and PWM configuration codes in some files (config.c, config.h, and F2837xS_IO_assignment.h) for migrating the project to LaunchXL-F28379D.

  • what i must change in 

    void InitMotor1EPwmGpio(void)
    {
    // set up EPWM-A
    GPIO_SetupPinOptions(MOTOR1_EPWM_A_GPIO, GPIO_OUTPUT, GPIO_PULLUP);
    GPIO_SetupPinMux(MOTOR1_EPWM_A_GPIO, 0, MOTOR1_EPWM_A_MUX);

    // set up EPWM-B
    GPIO_SetupPinOptions(MOTOR1_EPWM_B_GPIO, GPIO_OUTPUT, GPIO_PULLUP);
    GPIO_SetupPinMux(MOTOR1_EPWM_B_GPIO, 0, MOTOR1_EPWM_B_MUX);

    // set up EPWM-C
    GPIO_SetupPinOptions(MOTOR1_EPWM_C_GPIO, GPIO_OUTPUT, GPIO_PULLUP);
    GPIO_SetupPinMux(MOTOR1_EPWM_C_GPIO, 0, MOTOR1_EPWM_C_MUX);

    return;
    }

    ////////////////////////////////////////////

    and 

    //==============================
    // ADC trigger selection table
    //==============================
    #define ADCTRIG0_SW_ONLY 0
    #define ADCTRIG1_CPU1_T0 1
    #define ADCTRIG2_CPU1_T1 2
    #define ADCTRIG3_CPU1_T2 3
    #define ADCTRIG4_GPIOEXTSOC 4

    #define ADCTRIG5_EPWM1SOCA 5
    #define ADCTRIG6_EPWM1SOCB 6

    #define ADCTRIG7_EPWM2SOCA 7
    #define ADCTRIG8_EPWM2SOCB 8

    #define ADCTRIG9_EPWM3SOCA 9
    #define ADCTRIG10_EPWM3SOCB 10

    #define ADCTRIG11_EPWM4SOCA 11
    #define ADCTRIG12_EPWM4SOCB 12

    #define ADCTRIG13_EPWM5SOCA 13
    #define ADCTRIG14_EPWM5SOCB 14

    #define ADCTRIG15_EPWM6SOCA 15
    #define ADCTRIG16_EPWM6SOCB 16

    #define ADCTRIG17_EPWM7SOCA 17
    #define ADCTRIG18_EPWM7SOCB 18

    #define ADCTRIG19_EPWM8SOCA 19
    #define ADCTRIG20_EPWM8SOCB 20

    #define ADCTRIG21_EPWM9SOCA 21
    #define ADCTRIG22_EPWM9SOCB 22

    #define ADCTRIG23_EPWM10SOCA 23
    #define ADCTRIG24_EPWM10SOCB 24

    #define ADCTRIG25_EPWM11SOCA 25
    #define ADCTRIG26_EPWM11SOCB 26

    #define ADCTRIG27_EPWM12SOCA 27
    #define ADCTRIG28_EPWM12SOCB 28

    #define M1_ADCTRIG ADCTRIG7_EPWM2SOCA
    #define M2_ADCTRIG ADCTRIG7_EPWM2SOCA

    //////////////////////////////

    and 

    // General purpose useage (used by QEP1-I)
    #define BLUE_LED_GPIO 13
    #define BLUE_LED_MUX 0

    #define TEMP_GPIO 78
    #define TEMP_MUX 0

    // MOTOR 1 EPWM selections
    // ========================
    #define MOTOR1_EPWM_A_GPIO 12
    #define MOTOR1_EPWM_A_MUX 1

    #define MOTOR1_EPWM_B_GPIO 14
    #define MOTOR1_EPWM_B_MUX 1

    #define MOTOR1_EPWM_C_GPIO 16
    #define MOTOR1_EPWM_C_MUX 5

    // ***************************************************************
    // MOTOR 1 EQEP selections
    // ========================
    #define MOTOR1_QEPA_GPIO 62
    #define MOTOR1_QEPA_MUX 5

    #define MOTOR1_QEPB_GPIO 63
    #define MOTOR1_QEPB_MUX 5

    #define MOTOR1_QEPI_GPIO 65
    #define MOTOR1_QEPI_MUX 5

    // ***************************************************************
    // MOTOR 1 - SPI selections
    // =========================
    #define MOTOR1_SDI_GPIO 58
    #define MOTOR1_SDI_MUX 15

    #define MOTOR1_SDO_GPIO 59
    #define MOTOR1_SDO_MUX 15

    #define MOTOR1_CLK_GPIO 60
    #define MOTOR1_CLK_MUX 15

    // ***************************************************************
    // MOTOR 1 DRVxx selections
    // ========================
    #define MOTOR1_SCS_GPIO 4
    #define MOTOR1_SCS_MUX 0

    #define MOTOR1_EN_GATE_GPIO 72
    #define MOTOR1_EN_GATE_MUX 0

    #define MOTOR1_FAULT_GPIO 90
    #define MOTOR1_FAULT_MUX 0

    #if (MOTOR1_DRV == DRV8301)
    #define MOTOR1_DC_CAL_GPIO 73
    #define MOTOR1_DC_CAL_MUX 0

    #define MOTOR1_OCTW_GPIO 89
    #define MOTOR1_OCTW_MUX 0
    #else
    #define MOTOR1_WAKE_GPIO 73
    #define MOTOR1_WAKE_MUX 0

    #define MOTOR1_PWRGD_GPIO // tied to RESET# input of MCU - no use in code
    #endif

    // *************************************************
    // ************ ADC pin assignments ***************
    // *************************************************

    //#define IFB_A1 AdcaResultRegs.ADCRESULT0
    //#define IFB_B1 AdcbResultRegs.ADCRESULT0
    //#define IFB_C1 AdcaResultRegs.ADCRESULT1
    //#define IFB_A1_PPB ((signed int)AdcaResultRegs.ADCPPB1RESULT.all)
    //#define IFB_B1_PPB ((signed int)AdcbResultRegs.ADCPPB1RESULT.all)
    //#define IFB_C1_PPB ((signed int)AdcaResultRegs.ADCPPB2RESULT.all)
    //
    //#define VFB_A1 AdcbResultRegs.ADCRESULT1
    //#define VFB_B1 AdcbResultRegs.ADCRESULT2
    //#define VFB_C1 AdcbResultRegs.ADCRESULT3
    //#define VFB_DC1 AdcbResultRegs.ADCRESULT4

    // MOTOR 1 Analog definitions
    // ============================
    #define IFB_A1 AdcaResultRegs.ADCRESULT0
    #define IFB_B1 AdcbResultRegs.ADCRESULT0
    #define IFB_C1 AdcaResultRegs.ADCRESULT2
    #define IFB_A1_PPB ((signed int)AdcaResultRegs.ADCPPB1RESULT.all)
    #define IFB_B1_PPB ((signed int)AdcbResultRegs.ADCPPB1RESULT.all)
    #define IFB_C1_PPB ((signed int)AdcaResultRegs.ADCPPB3RESULT.all)

    #if (MOTOR1_DRV == DRV8301)
    #define VFB_A1 AdcbResultRegs.ADCRESULT4
    #define VFB_B1 AdcbResultRegs.ADCRESULT3
    #define VFB_C1 AdcbResultRegs.ADCRESULT2
    #define VFB_DC1 AdcbResultRegs.ADCRESULT6
    #else
    #define VFB_B1 AdcbResultRegs.ADCRESULT4
    #define VFB_C1 AdcbResultRegs.ADCRESULT3
    #define VFB_DC1 AdcbResultRegs.ADCRESULT2
    #define VFB_A1 AdcbResultRegs.ADCRESULT6
    #endif

    #define ADC_PU_SCALE_FACTOR 0.000244140625 //1/2^12
    #define ADC_PU_PPB_SCALE_FACTOR 0.000488281250 //1/2^11

    ///////

     

    I can't find how to change?
    what to change

  • Use the schematics of launch pad and booster pack, look at the pin outs of their mating headers. See which pins of the launch pad will connect with which pins of booster pack. Then make assignments accordingly.  The above definitions are intuitive.

  • I changed the pin, but I don't know what to change in ADC, and PWM

  • You need to select the using ADC channels based on the schematic of launchxl-f28379d and boostxl-drv8305.

    You can find the following codes in MonoMtrServo.c, change the .CHSEL and .TRIGSEL according to the hardware.

    // Configure SOCx on ADCs A and B (C and D not used)

    // Motor 1: Ia @ A0
    // ********************************
    AdcaRegs.ADCSOC0CTL.bit.CHSEL = 0; // SOC0 will convert pin A0
    AdcaRegs.ADCSOC0CTL.bit.ACQPS = 30; // sample window in SYSCLK cycles
    AdcaRegs.ADCSOC0CTL.bit.TRIGSEL = ADCTRIG17_EPWM7SOCA; // trigger on ePWM7 SOCA/C
    // Configure the post processing block (PPB) to eliminate subtraction related calculation
    AdcaRegs.ADCPPB1CONFIG.bit.CONFIG = 0; // PPB is associated with SOC0
    AdcaRegs.ADCPPB1OFFCAL.bit.OFFCAL = 0; // Write zero to this for now till offset ISR is run

    // Motor 1: Ib @ B0
    // ********************************
    AdcbRegs.ADCSOC0CTL.bit.CHSEL = 0; // SOC0 will convert pin B0
    AdcbRegs.ADCSOC0CTL.bit.ACQPS = 30; // sample window in SYSCLK cycles
    AdcbRegs.ADCSOC0CTL.bit.TRIGSEL = ADCTRIG17_EPWM7SOCA; // trigger on ePWM2 SOCA/C
    // Configure the post processing block (PPB) to eliminate subtraction related calculation
    AdcbRegs.ADCPPB1CONFIG.bit.CONFIG = 0; // PPB is associated with SOC0
    AdcbRegs.ADCPPB1OFFCAL.bit.OFFCAL = 0; // Write zero to this for now till offset ISR is run

    // Motor 1: Ic @ A1
    // ********************************
    AdcaRegs.ADCSOC2CTL.bit.CHSEL = 1; // SOC2 will convert pin A1
    AdcaRegs.ADCSOC2CTL.bit.ACQPS = 30; // sample window in SYSCLK cycles
    AdcaRegs.ADCSOC2CTL.bit.TRIGSEL = ADCTRIG17_EPWM7SOCA; // trigger on ePWM2 SOCA/C
    // Configure the post processing block (PPB) to eliminate subtraction related calculation
    AdcaRegs.ADCPPB3CONFIG.bit.CONFIG = 2; // PPB is associated with SOC2
    AdcaRegs.ADCPPB3OFFCAL.bit.OFFCAL = 0; // Write zero to this for now till offset ISR is run