TI中文支持网
TI专业的中文技术问题搜集分享网站

TMS320F280049: TIDM-02000例程中EPWM设置问题

Part Number:TMS320F280049Other Parts Discussed in Thread:POWERSUITE, C2000WARE

1.在EPWM设置函数的闭环部分中,首先对于EPWM2模块的AQ动作进行了设置,将DCEVTFILT连接到T1,并设置了T1U和T1D动作事件。但随后又在TZ模块中将DCEVTFILT事件进行了设置,也同样设置了在事件到来时分别处于上升沿以及下降沿两种情况下EPWM的动作,为什么要这样做?

2.关于280049的TZ子模块,我找到的资料里并没有说明TZA或TZB可以结合TBCTR处于上升沿还是下降沿对EPWM的输出进行修正,为什么程序中结合了上升或下降沿?

3.最后又设置了TZA与TZB不动作,那之前设置的Advanced Trip Zone Action指的是其他什么吗,这个Advanced怎么理解。

? ?:

// CTR = PRD , set to 1//EPWM_setActionQualifierAction(base2, EPWM_AQ_OUTPUT_A ,EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_PERIOD);//// CTR = ZERO , set to 0//EPWM_setActionQualifierAction(base2, EPWM_AQ_OUTPUT_A ,EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);//// CTR = T1U , set to 1//EPWM_setActionQualifierAction(base2, EPWM_AQ_OUTPUT_A ,EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_T1_COUNT_UP);//// CTR = T1D , set to 0//EPWM_setActionQualifierAction(base2, EPWM_AQ_OUTPUT_A ,EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_T1_COUNT_DOWN);//设置EPWMB// CTR = PRD , set to 1//EPWM_setActionQualifierAction(base2, EPWM_AQ_OUTPUT_B ,EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_PERIOD);//// CTR = ZERO , set to 0//EPWM_setActionQualifierAction(base2, EPWM_AQ_OUTPUT_B ,EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);//// CTR = T1U , set to 1//EPWM_setActionQualifierAction(base2, EPWM_AQ_OUTPUT_B ,EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_T1_COUNT_UP);//// CTR = T1D , set to 0//EPWM_setActionQualifierAction(base2, EPWM_AQ_OUTPUT_B ,EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_T1_COUNT_DOWN);//// Set DCEVTFILT as the trigger source for Channel A设置DCEVT经过滤波后的事件作为触发源//EPWM_setActionQualifierT1TriggerSource(base2,EPWM_AQ_TRIGGER_EVENT_TRIG_DC_EVTFILT);//// Digital Compare and Comparator-X-Bar Configuration// Disable all the muxes first首先禁用trip5连接到MUX0上//XBAR_enableEPWMMux(XBAR_TRIP5, 0x00);////// Setup PWM TRIP 5 as the destination for CMPSS1H output (PCMC)// Trip5 will be active if CMPSSH is active//XBAR_setEPWMMuxConfig(XBAR_TRIP5, XBAR_EPWM_MUX00_CMPSS1_CTRIPH);//设置复用器输入为CMPSS1HXBAR_enableEPWMMux(XBAR_TRIP5, XBAR_MUX00);//启用复用器//// DCAH = TRIP5 = Comparator 1H output//EPWM_selectDigitalCompareTripInput(base2, EPWM_DC_TRIP_TRIPIN5,EPWM_DC_TYPE_DCAH);//将trip5连接到DCAH上//// DCAH = high//EPWM_setTripZoneDigitalCompareEventCondition(base2, EPWM_TZ_DC_OUTPUT_A2,EPWM_TZ_EVENT_DCXH_HIGH);//当输入为高时DCAH有效//// Set the source for digital compare filter as DCAEVT2设置DCAH连接到DCAECT2并经过滤波输出//EPWM_setDigitalCompareEventSource(base2, EPWM_DC_MODULE_A, EPWM_DC_EVENT_2,EPWM_DC_EVENT_SOURCE_FILT_SIGNAL);//// Allow ASYNC DCAEVT2 for trip zone actions设置DCAEVT2是否为同步信号//EPWM_setDigitalCompareEventSyncMode(base2, EPWM_DC_MODULE_A,EPWM_DC_EVENT_2,EPWM_DC_EVENT_INPUT_NOT_SYNCED);//设置为不同步//// Select DCAEVT2 cycle by cycle trip设置DCAEVT2为周期脱开信号//EPWM_enableTripZoneSignals(base2, EPWM_TZ_SIGNAL_DCAEVT2);//// Event Filtering Configuration (inside digital compare)事件滤波设置// Enable DC filter blanking window//EPWM_enableDigitalCompareBlankingWindow(base2);//使能消隐窗口//// Set the signal source that will be filtered.//EPWM_setDigitalCompareFilterInput(base2, EPWM_DC_WINDOW_SOURCE_DCAEVT2);//使能滤波//// Set the Digital Compare filter blanking pulse.//EPWM_setDigitalCompareBlankingEvent(base2,EPWM_DC_WINDOW_START_TBCTR_ZERO_PERIOD);//当计数为0或者PRD时进行消隐//// Set the blanking window offset in TBCLK counts//EPWM_setDigitalCompareWindowOffset(base2, pwm_period_ticks - 5);//设置消隐窗口延时//// Set the blanking window length in TBCLK counts//EPWM_setDigitalCompareWindowLength(base2, 10);//设置消隐窗口长度//// Trip-zone event actions// What do we want the CBC events to do?// TZAx events can force EPWMxA// TZBx events can force EPWMxB//EPWM_setTripZoneAdvAction(base2, EPWM_TZ_ADV_ACTION_EVENT_TZA_D,EPWM_TZ_ADV_ACTION_LOW);EPWM_setTripZoneAdvAction(base2, EPWM_TZ_ADV_ACTION_EVENT_TZA_U,EPWM_TZ_ADV_ACTION_DISABLE);EPWM_setTripZoneAdvAction(base2, EPWM_TZ_ADV_ACTION_EVENT_TZB_U,EPWM_TZ_ADV_ACTION_LOW);EPWM_setTripZoneAdvAction(base2, EPWM_TZ_ADV_ACTION_EVENT_TZB_D,EPWM_TZ_ADV_ACTION_DISABLE);EPWM_setTripZoneAction(base2, EPWM_TZ_ACTION_EVENT_TZA,EPWM_TZ_ACTION_DISABLE);EPWM_setTripZoneAction(base2, EPWM_TZ_ACTION_EVENT_TZB,EPWM_TZ_ACTION_DISABLE);//// Select CBC clear event设置周期脱开事件标志位清除//EPWM_selectCycleByCycleTripZoneClearEvent(base2,EPWM_TZ_CBC_PULSE_CLR_CNTR_ZERO_PERIOD);//计数为0以及PRD时清除//// Clear any spurious trip清除脱开标志位//EPWM_clearTripZoneFlag(base1, (EPWM_TZ_INTERRUPT_OST |EPWM_TZ_INTERRUPT_DCAEVT2 | EPWM_TZ_SIGNAL_DCBEVT1));EPWM_clearTripZoneFlag(base2, (EPWM_TZ_INTERRUPT_OST |EPWM_TZ_INTERRUPT_DCAEVT2 | EPWM_TZ_SIGNAL_DCBEVT1));

主要是这一段代码

,

Ben Qin:

你好,你使用的例程具体是哪一个?能否说明一下文件路径?

? ? said:.在EPWM设置函数的闭环部分中,首先对于EPWM2模块的AQ动作进行了设置,将DCEVTFILT连接到T1,并设置了T1U和T1D动作事件。但随后又在TZ模块中将DCEVTFILT事件进行了设置,也同样设置了在事件到来时分别处于上升沿以及下降沿两种情况下EPWM的动作,为什么要这样做?

参考下TRM第18.11.4.2章节:

,

? ?:

你好,此项目路径为C:\ti\c2000\C2000Ware_DigitalPower_SDK_4_04_00_00\powerSUITE\source\devkits\.meta\TIDM_02000。

我参考了这一章节的内容,似乎和我的问题关系不大,我的疑惑是此程序中既设置了TZ子模块响应事件,又同时在AQ子模块中也设置了相同的响应事件,我不清楚为何要这么做。

,

Ben Qin:

你好,

? ? said:此项目路径为C:\ti\c2000\C2000Ware_DigitalPower_SDK_4_04_00_00\powerSUITE\source\devkits\.meta\TIDM_02000

该路径下我不到该项目

? ? said:,我的疑惑是此程序中既设置了TZ子模块响应事件,又同时在AQ子模块中也设置了相同的响应事件,

能否指出具体在第几行?

? ? said:将DCEVTFILT连接到T1,并设置了T1U和T1D动作事件。但随后又在TZ模块中将DCEVTFILT事件进行了设置

你给的代码中我只看到了AQ模块有相关配置。

赞(0)
未经允许不得转载:TI中文支持网 » TMS320F280049: TIDM-02000例程中EPWM设置问题
分享到: 更多 (0)

© 2024 TI中文支持网   网站地图 鲁ICP备2022002796号-1