大家好,DRV8312-C2-kit的配套历程中有BLDC_Sensored 和PM_Sensorless两个。
下面是两个历程中对PWM的配置。
BLDC_Sensored:
/* Set up Event Trigger with CNT_zero enable for Time-base of EPWM1 */
EPwm1Regs.ETSEL.bit.SOCAEN = 1; /* Enable SOCA */
EPwm1Regs.ETSEL.bit.SOCASEL = 6; /* Enable CMPB event for SOCA */
EPwm1Regs.ETPS.bit.SOCAPRD = 1; /* Generate SOCA on the 1st event */
EPwm1Regs.ETCLR.bit.SOCA = 1; /* Clear SOCA flag */
PM_Sensorless:
/* Set up Event Trigger with CNT_zero enable for Time-base of EPWM1 */
EPwm1Regs.ETSEL.bit.SOCAEN = 1; /* Enable SOCA */
EPwm1Regs.ETSEL.bit.SOCASEL = 1; /* Enable CNT_zero event for SOCA */
EPwm1Regs.ETPS.bit.SOCAPRD = 1; /* Generate SOCA on the 1st event */
EPwm1Regs.ETCLR.bit.SOCA = 1; /* Clear SOCA flag */
能否详细介绍一下,上面两种中断方式的区别,和背后的配置原因吗?
谢谢。
Susan Yang:
关于两者的区别,您可以看一下
的Table 3-62. Event-Trigger Selection Register (ETSEL) Field Descriptions 以及 Figure 3-43. Event-Trigger SOCA Pulse Generator