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.

CCS/DRV8312-C2-KIT: C2000-DIGITAL-CONTROL-LIBRARY

Part Number: DRV8312-C2-KIT


Tool/software: Code Composer Studio

When I go through the BLDC sensorless code of DRV8312-C2-KIT, I am confused with one thing.

/* Setup Sync*/ \
EPwm1Regs.TBCTL.bit.SYNCOSEL = 0; \
EPwm2Regs.TBCTL.bit.SYNCOSEL = 0; \
EPwm3Regs.TBCTL.bit.SYNCOSEL = 0; \
EPwm4Regs.TBCTL.bit.SYNCOSEL = 0; \
EPwm5Regs.TBCTL.bit.SYNCOSEL = 0; \
EPwm6Regs.TBCTL.bit.SYNCOSEL = 0; \
\
/* Allow each timer to be sync'ed*/ \
EPwm1Regs.TBCTL.bit.PHSEN = 1; \
EPwm2Regs.TBCTL.bit.PHSEN = 1; \
EPwm3Regs.TBCTL.bit.PHSEN = 1; \
EPwm4Regs.TBCTL.bit.PHSEN = 1; \
EPwm5Regs.TBCTL.bit.PHSEN = 1; \
EPwm6Regs.TBCTL.bit.PHSEN = 1; \
\
/* Init Timer-Base Period Register for EPWM1-EPWM3*/ \
EPwm1Regs.TBPRD = v.PeriodMax; \
EPwm2Regs.TBPRD = v.PeriodMax; \
EPwm3Regs.TBPRD = v.PeriodMax; \
\
/* Init Timer-Base Phase Register for EPWM1-EPWM3*/ \
EPwm1Regs.TBPHS.half.TBPHS = 0; \
EPwm2Regs.TBPHS.half.TBPHS = 0; \
EPwm3Regs.TBPHS.half.TBPHS = 0; \
\
/* Init Timer-Base Control Register for EPWM1-EPWM3*/ \
EPwm1Regs.TBCTL.all = BLDCPWM_INIT_STATE; \
EPwm2Regs.TBCTL.all = BLDCPWM_INIT_STATE; \
EPwm3Regs.TBCTL.all = BLDCPWM_INIT_STATE; \

I am not sure, but I think the code in /* Setup Sync*/ and /* Allow each timer to be sync'ed*/ will be covered by the code in /* Init Timer-Base Control Register for EPWM1-EPWM3*/ . I want to know what is the meaning in the first two parts.

Thanks

  • Chen Li7 said:
    /* Setup Sync*/

    This code enables SYNCO to pass through the signal that appears on SYNCI. This is a configuration of the synchronization chain and is described in the ePWMs User's Guide.

    Chen Li7 said:
     /* Allow each timer to be sync'ed*/

    This code configures the phase loading for each of the PWMs. This will cause the PWMs to be synchronized and phase shifted by the value found in TBPHS when a synchronization pulse is received by the unit.

    Regards,
    Cody 

  • I got your point, but I don't find code that can produce a synchronization pulse. And according to the schematics of DRV8312EVM, the ePWM1's external pins that could produce a synchronization pulse are not used. Could you help me find where the synchronization pulse is produced? 

    Thanks

  • Chen,

    Instaspin requires that the PWMs are synchronized. This is done using TBCLKSYNC =1, you can find this code in the "BLDC_Sensorless-DevInit*.c" file.

    Since a complex phase shifting relationship is not used the configuration you asked about above is likely not needed. I suspect that this was added just to be complete and fully configure the ePWM modules.

    Regards,
    Cody