The microcontroller source program is as follows: //****************************************************/ //File name: SVPWM.c //Function: Call the 28335 internal PWM module to generate the SVPWM output test file //Description: The input information uses a structure. When using it, changing the structure pointer can change the input signal. // The InitSvpwm() function provides PWM module initialization and the configuration of the corresponding PIE interrupt. // The voltage signal in the stationary plane coordinate system is obtained through the park inverse transformation. // Update the comparator value in the PWM timer underflow interrupt, that is, update once every PWM cycle //********************************************************/ #include "DSP2833x_Device.h" // DSP2833x Headerfile Include File #include "DSP2833x_Examples.h" // DSP2833x Examples Include File #include "math.h" #include "float.h" extern Uint16 RamfuncsRunStart; extern Uint16 RamfuncsLoadStart; extern Uint16 RamfuncsLoadEnd; typedef struct { float ds; // Voltage signal in stationary plane coordinate system float qs; float ang; // Electrical angle Electrical angle = mechanical angle * number of pole pairs float de; // Voltage signal in rotating coordinate system float qe; }IPARK; IPARK ipark1={0,0,0,0.3,0.4}; // IPARK *v=&ipark1; // Change the structure pointer here to change the input void InitSvpwm(void); void InitEPwm1(void); void InitEPwm2(void); void InitEPwm3(void); interrupt void epwm1_isr(void); void ipark(IPARK *v); void svgen(IPARK *v); #define PRD 7500 // PWM周期寄存器 #define PI 3.1415926 float tmr1,tmr2,tmr3; void main(void) { InitSysCtrl(); DINT; InitPieCtrl(); IER = 0x0000; IFR = 0x0000; In itPieVectTable(); MemCopy(&RamfuncsLoadStart, &RamfuncsLoadEnd, &RamfuncsRunStart); //Flash operation