资源简介
基于DSP28335产生4路PWM移相程序,每路以A为准,B与之互补,带死区。移相以第一路信号(EPWM1A)为基准。假设第一路与第二路之间的移相角为D1 若D1=x,则D1对应0.24*x度,例如x=50时,D1对应12度。
代码片段和文件信息
//###############################################################################################
// Description:
// program for 4路PWM信号,每路以A为准,B与之互补,带死区。移相以第一路信号(EPWM1A)为基准
// $TI Release: F2833x/F2823x Header Files and Peripheral Examples V142 $
// $Release Date: July 30 2017 $
// $Copyright: Copyright 孙川(Sun Chuan) $
//###############################################################################################
#include “DSP28x_Project.h“
void InitExInt(void);
void InitEPwm1Example(void);
void InitEPwm2Example(void);
void InitEPwm3Example(void);
void InitEPwm4Example(void);
//interrupt void epwm1_isr(void);
//interrupt void epwm2_isr(void);
//interrupt void epwm3_isr(void);
//interrupt void epwm4_isr(void);
// Configure the period for each timer
//第一路
volatile Uint16 EPWM1_TIMER_TBPRD = 1500; // Period=1501 TBCLK counts
volatile Uint16 EPWM1_CMPA = 750; // Set 50% 占空比 for EPWM1A -> S1
//第二路
volatile Uint16 EPWM2_TIMER_TBPRD = 1500;
volatile Uint16 EPWM2_CMPA = 750;
//第三路
volatile Uint16 EPWM3_TIMER_TBPRD = 1500;
volatile Uint16 EPWM3_CMPA = 750;
//第四路
volatile Uint16 EPWM4_TIMER_TBPRD = 1500;
volatile Uint16 EPWM4_CMPA = 750;
volatile Uint16 D1 = 50; //第一路与第二路之间的移相角 若D1=x,则D1对应0.24*x度,例如x=50时,D1对应12度
volatile Uint16 D2 = 100; //第一路与第三路之间的移相角
volatile Uint16 D3 = 72; //第一路与第四路之间的移相角
#define DBTIME_FED 28 死区设置
#define DBTIME_RED 28
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. Initialize 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(); // Disenable pull-up on GPIO0 ~ GPIO11
// For this case just init GPIO pins for ePWM1 ePWM2 ePWM3 ePWM4
// These functions are in the DSP2833x_EPwm.c file
InitEPwm1Gpio();
InitEPwm2Gpio();
InitEPwm3Gpio();
InitEPwm4Gpio();
// 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();
MemCopy(&RamfuncsLoadStart &RamfuncsLoadEnd &RamfuncsRunStart); //烧录进Flash中运行
InitFlash();
InitExInt();
EALLOW;
PieVect
相关资源
- 51单片机PWM程序,占空比、周期可调整
- DSP28335程序片内FLASH搬运至RAM运行的
- SG3525频率PWM控制均可调模块
- 基于ARM7 PWM定时器的图像传感器时序信
- 电力电子技术(第4版)_王兆安_带目
- 基于FAN6754A的PWM反激式开关电源的设计
- 采用双闭环控制提高PWM的电源纹波抑
- FPGA实现单极性SPWM调制
- LCL滤波器在三相PWM整流器中的应用
- CPS―SPWM调制方法在H桥多电平变流器中
- 基于FPGA的多电平载波移相SPWM方法实现
- 正弦波逆变器正弦波逆变器的工作原
- 基于DSP的SVPWM变频调速系统
- 采用单片机SPWM的控制应急电源逆变电
- PWM脉宽调制的原理
- 说说PWM脉宽调制原理
- 以单片机AT89S52、光电脉宽调制器芯片
- STM32F103系列PWM输出应用之纸短情长音
- 基于FPGA的SVPWM实现方法
- pwm控制驱动直流电机 可调速 可调转的
- 可控硅调光,PWM调光,0-10V调光哪个更
- 一种基于SG3525A的PWM型开关稳压电源设
- 基于PIC单片机产生SPWM信号控制逆变桥
- 三相PWM整流器电压环H_∞鲁棒控制
- SVPWM的原理及法则推导和控制算法详解
- 132kW双PWM变频器电力电缆选型设计
- 32F103 8路PWM输出实验
- Keil5下的STM32F407程序
- PWM控制电机
- 基于STM32-Mini的多路PWM
评论
共有 条评论