资源简介
单相光伏逆变器主程序,包括ePWM,PLL,中断,ADC等子程序
代码片段和文件信息
// He Yuxuan Pang Qifeng
// Checkin $Date: March 6 2010 $
// Update: March 28 2010
//###########################################################################
#include “DSP28x_Project.h“ // Device Headerfile and Examples Include File
#include “SPWM.h“
#include “TFT.h“
#include “FFT.h“
#define ADC_CKPS 0x1 // ADC module clock = HSPCLK/2*ADC_CKPS = 25.0MHz/(1*2) = 12.5MHz
#define ADC_SHCLK 0xf // S/H width in ADC module periods = 16 ADC clocks
#define VoltProtect 25
#define CurrentProtect 1.5
#define VoltProtect_u16 1551
#define CurrentProtect_u16 687
extern Uint16 RamfuncsLoadStart;
extern Uint16 RamfuncsLoadEnd;
extern Uint16 RamfuncsRunStart;
// Prototype statements for functions found within this file.
void InitSPwm1(void);
void InitECapture(void);
void InitECapture2(void);
void ADCInit(void);
void SPWMDisable(void);
void Delay(Uint16 i);
void DoFullPID(void);
interrupt void epwm1_isr(void);
interrupt void ecap1_isr(void);
interrupt void ecap2_isr(void);
interrupt void adc_isr(void);
Uint32 CAP1CAP2Diff;
float32 FreqPhase;
Uint16 Freq_Flag1Freq_Flag2;
Uint16 cnt_AddPhasePolePhase_cnt;
Uint16 Id_REG[128] Ud_REG[128] Io_REG[128] Uo_REG[128] U_Wave[128];
float32 IdUdIoUoUs;
float32 SumMaxMin;
Uint16 ConversionCountConversionCountWave;
Uint16 ADC_Flagij;
Uint16 MPPT_Flag;
Uint16 Io_u16Ud_u16ProtectStatus=0;
Uint16 display[6]TFT_FlagFFT_Flag;
float32 Ki=0.001Kp=0.02Kd=0IntTerm=0PrevError=0Adjust;
void main(void)
{
// Step 1. Initialize System Control:
// PLL WatchDog enable Peripheral Clocks
// This example function is found in the DSP2833x_SysCtrl.c file.
InitSysCtrl();
// Step 2. Initalize GPIO:
// This example function is found in the DSP2833x_Gpio.c file and
// illustrates how to set the GPIO to it‘s default state.
// InitGpio();// Skipped for this example
// For this case just init GPIO pins for ePWM1 ePWM2 ePWM3
// These functions are in the DSP2833x_EPwm.c file
InitEPwm1Gpio();
InitECap1Gpio();
InitECap2Gpio();
// Step 3. Clear all interrupts and initialize PIE vector table:
// Disable CPU interrupts
DINT;
// Initialize the PIE control registers to their default state.
// The default state is all PIE interrupts disabled and flags
// are cleared.
// This function is found in the DSP2833x_PieCtrl.c file.
InitPieCtrl();
// Disable CPU interrupts and clear all CPU interrupt flags:
IER = 0x0000;
IFR = 0x0000;
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).
// This will populate the entire table even if the interrupt
// is not used in this example.This is useful for debug purposes.
// The shell ISR routines are found in DSP2833x_DefaultIsr.c.
// This function is found in DSP2833x_PieVect.c.
InitPieVectTable();
// Interrupts that are used in this example are re-mapped to
// ISR functions found within t
- 上一篇:电动助力转向系统建模
- 下一篇:基于VHDL语言的四层电梯控制程序 EDA实验
相关资源
- 直流偏磁对单相变压器励磁电流的影
- 基于PFC的单相AC-DC变换电路设计
- 555单相定量供电控制电路图
- 单相逆变器的saber仿真
- 论文研究 - 单相流旋风气化炉的湍流
- α单相区固溶处理时冷却速度对
- 单相正弦波逆变电源
- 2017年电子设计竞赛K题源代码单相用电
- HLW8032参考设计资料V10
- 基于stm32的单相逆变代码可调压调频
- 单相光伏并网逆变器设计
- 峰值电流控制单相BOOST_PFC变换器工作
- 电子-单相正弦波变频电源.rar
- 单相桥式和三相桥式全控整流电路仿
- 单相电压型PWM整流器研究
- 单相逆变电源毕业设计可以实现到2
- ADE7755单相电能表计量芯片中文手册
- 附件5 多芯模组化单相智能电能表技术
- 单相交直变频仿真
- 智能电表监控程序,包括单相电表和
- 单相用电器分析监测装置_2017年江苏省
- DSP单相逆变器光伏并网程序
- 单相用电器分析系统
- 单相电参数测量仪精确地测量电压、
- DSP28335控制单相逆变器双闭环控制程序
- 单相电监测分析装置
- 安卓基础相机1
- 单相逆变器重复控制和双环控制技术
- 单相变频电源
- ATT7053AU/BU 资料
评论
共有 条评论