|
![](static/image/common/ico_lz.png)
楼主 |
发表于 2024-1-12 08:34:45
|
显示全部楼层
EPWM_selectDigitalCompareTripInput(base, EPWM_DC_TRIP_TRIPIN4,EPWM_DC_TYPE_DCAH);
EPWM_selectDigitalCompareTripInput(base, EPWM_DC_TRIP_TRIPIN8,EPWM_DC_TYPE_DCBH);
EPWM_setTripZoneAction(base,EPWM_TZ_ACTION_EVENT_DCAEVT1,EPWM_TZ_ACTION_LOW);
EPWM_setTripZoneAction(base,EPWM_TZ_ACTION_EVENT_DCBEVT1,EPWM_TZ_ACTION_LOW);
//
// DCAEVT1 is generated when DCAH is high. DCBEVT2 is generated when DCBH
// is high
//
EPWM_setTripZoneDigitalCompareEventCondition(base, EPWM_TZ_DC_OUTPUT_A1,EPWM_TZ_EVENT_DCXH_HIGH);
EPWM_setTripZoneDigitalCompareEventCondition(base, EPWM_TZ_DC_OUTPUT_B1,EPWM_TZ_EVENT_DCXH_HIGH);
//
// DCAEVT1/DCBEVT2 uses the unfiltered version of DCAEVT1/DCBEVT2
//
EPWM_setDigitalCompareEventSource(base, EPWM_DC_MODULE_A,
EPWM_DC_EVENT_1, EPWM_DC_EVENT_SOURCE_ORIG_SIGNAL);
EPWM_setDigitalCompareEventSource(base, EPWM_DC_MODULE_B,
EPWM_DC_EVENT_1, EPWM_DC_EVENT_SOURCE_ORIG_SIGNAL);
//
// DCAEVT1/ DCBEVT2 is asynchronous
//
EPWM_setDigitalCompareEventSyncMode(base, EPWM_DC_MODULE_A,
EPWM_DC_EVENT_1, EPWM_DC_EVENT_INPUT_NOT_SYNCED);
EPWM_setDigitalCompareEventSyncMode(base, EPWM_DC_MODULE_B,
EPWM_DC_EVENT_1, EPWM_DC_EVENT_INPUT_NOT_SYNCED);
这样就可以单独关闭EPWMA或EPWMB了 |
|