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.

TMS320F28388D: erad_ex8_pwm_protection例程修正

Part Number: TMS320F28388D

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//#############################################################################
//
// FILE: erad_ex8_pwm_protection.c
//
// TITLE: ERAD PWM PROTECTION.
//
//! \addtogroup driver_example_list
//! <h1>ERAD PWM PROTECTION</h1>
//!
//! This example uses a BUS COMPARATOR and the CLB to detect the event when
//! the delay between the interrupt and the ISR execution is longer than
//! expected. The PWM output is also tripped in this case.
//!
//! \b Watch \b Variables \n
//! - adcAResults stores the results of the conversions from the ADC
//!
//! \b External \b Connections \n
//! - Monitor the PWM output (GPIO0)
//
//#############################################################################
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

修改前:EPWM1A在GPIO0始终无输出;

主要改动:1. initEPWM中添加AQ配置;

                  2. initEPWM末段的EPWM_enableTripZoneSignals输入参数修正;

                  3. config_CLB末段的CLB_setOutputMask输入参数修正;

效果:1. 主函数的for循环前3轮中,EPWM Clock启停之间能看到EPWM1A输出波形(若GPIO0外接LED效果更明显);

           2. 跳出循环后TripZone触发关断动作,能看到EPWM1A输出降为0(外接LED熄灭);

声明:个人观点,友好交流,抱头勿喷,谢谢,抱拳Blush