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.
我想实现EPWM1和EPWM2同步、EPWM3和EPWM4同步、EPWM5和EPWM6同步、EPWM7和ECAP的APWM同步、像“2”和“3”不同步(如果也要他们同步的话是怎么配置)
这两个寄存器参照数据手册设置就可以。例如EPWM2要和1同步:将EPWM1的同步源输出-EPWMSYNOUTEN的对应事件(例如CTR = 0)使能,你图中的设置是失能所有;将EPWM2的同步源输入EPWMSYNCINSEL参照数据手册使能,TMS320F28002x Real-Time Microcontrollers Technical Reference Manual (Rev. A) 1720页。
因为我配置7个所以设置了
#define ePWM1 1
#define ePWM2 2
#define ePWM3 3
#define ePWM4 4
#define ePWM5 5
#define ePWM6 6
#define ePWM7 7
在配置EPWM1时是 ---这个时候ePWMx =1;
(*ePWM).EPWMSYNCINSEL.all = SYNC_IN_SRC_DISABLE_ALL;
(*ePWM).EPWMSYNCOUTEN.bit.ZEROEN= 1;
配置EPWM2时是 -----这个时候ePWMx =2;
(*ePWM).EPWMSYNCINSEL.bit.SEL = ePWMx -1; //配置上一个PWM信号同步。
(*ePWM).EPWMSYNCOUTEN.all= SYNC_OUT_SRC_DISABLE_ALL; //EPWMxSYNCOUT源使能 禁用