资源简介
程序经过本人的验证,可以正常运行,能够通过PWM波控制步进电机的正反转,还可以实现调速。

代码片段和文件信息
//###########################################################################
//
// FILE: DSP2833x_CpuTimers.c
//
// title: CPU 32-bit Timers Initialization & Support Functions.
//
// NOTES: CpuTimer2 is reserved for use with DSP BIOS and
// other realtime operating systems.
//
// Do not use these this timer in your application if you ever plan
// on integrating DSP-BIOS or another realtime OS.
//
//###########################################################################
// $TI Release: 2833x/2823x Header Files and Peripheral Examples V133 $
// $Release Date: June 8 2012 $
//###########################################################################
#include “DSP2833x_Device.h“ // Headerfile Include File
#include “DSP2833x_Examples.h“ // Examples Include File
struct CPUTIMER_VARS CpuTimer0;
// When using DSP BIOS & other RTOS comment out CPU Timer 2 code.
struct CPUTIMER_VARS CpuTimer1;
struct CPUTIMER_VARS CpuTimer2;
//---------------------------------------------------------------------------
// InitCpuTimers:
//---------------------------------------------------------------------------
// This function initializes all three CPU timers to a known state.
//
void InitCpuTimers(void)
{
// CPU Timer 0
// Initialize address pointers to respective timer registers:
CpuTimer0.RegsAddr = &CpuTimer0Regs;
// Initialize timer period to maximum:
CpuTimer0Regs.PRD.all = 0xFFFFFFFF;
// Initialize pre-scale counter to divide by 1 (SYSCLKOUT):
CpuTimer0Regs.TPR.all = 0;
CpuTimer0Regs.TPRH.all = 0;
// Make sure timer is stopped:
CpuTimer0Regs.TCR.bit.TSS = 1;
// Reload all counter register with period value:
CpuTimer0Regs.TCR.bit.TRB = 1;
// Reset interrupt counters:
CpuTimer0.InterruptCount = 0;
// CpuTimer2 is reserved for DSP BIOS & other RTOS
// Do not use this timer if you ever plan on integrating
// DSP-BIOS or another realtime OS.
// Initialize address pointers to respective timer registers:
CpuTimer1.RegsAddr = &CpuTimer1Regs;
CpuTimer2.RegsAddr = &CpuTimer2Regs;
// Initialize timer period to maximum:
CpuTimer1Regs.PRD.all = 0xFFFFFFFF;
CpuTimer2Regs.PRD.all = 0xFFFFFFFF;
// Make sure timers are stopped:
CpuTimer1Regs.TCR.bit.TSS = 1;
CpuTimer2Regs.TCR.bit.TSS = 1;
// Reload all counter register with period value:
CpuTimer1Regs.TCR.bit.TRB = 1;
CpuTimer2Regs.TCR.bit.TRB = 1;
// Reset interrupt counters:
CpuTimer1.InterruptCount = 0;
CpuTimer2.InterruptCount = 0;
}
//---------------------------------------------------------------------------
// ConfigCpuTimer:
//---------------------------------------------------------------------------
// This function initializes the selected timer to the period specified
// by the “Freq“ and “Period“ parameters. The “Freq“ is entered as “MHz“
// and the period in “uSeconds“
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 168 2017-10-31 15:46 Step_Motor\.ccsproject
文件 8818 2013-08-15 12:53 Step_Motor\.cdtbuild
文件 8818 2014-03-11 10:04 Step_Motor\.cdtbuild_initial
文件 553 2013-08-15 12:53 Step_Motor\.cdtproject
文件 15466 2018-07-01 10:55 Step_Motor\.cproject
文件 4239 2014-03-25 22:50 Step_Motor\.launches\Example_2833x_fulltest.launch
文件 13477 2017-10-30 17:29 Step_Motor\.launches\Example_2833x_Step_Motor.launch
文件 1489 2017-10-31 08:20 Step_Motor\.project
文件 3001 2014-03-11 10:04 Step_Motor\.project_initial
文件 62 2015-09-26 22:09 Step_Motor\.settings\org.eclipse.cdt.codan.core.prefs
文件 123 2014-03-23 21:56 Step_Motor\.settings\org.eclipse.cdt.debug.core.prefs
文件 293 2015-02-26 17:51 Step_Motor\.settings\org.eclipse.core.resources.prefs
文件 7254 2014-03-11 14:47 Step_Motor\28335_RAM_lnk.cmd
文件 601 2018-07-01 10:50 Step_Motor\Debug\ccsObjs.opt
文件 1527 2018-07-01 10:50 Step_Motor\Debug\DSP2833x_ADC_cal.obj
文件 1831 2018-07-01 10:50 Step_Motor\Debug\DSP2833x_CodeStartBranch.obj
文件 3915 2018-07-01 10:50 Step_Motor\Debug\DSP2833x_CpuTimers.d
文件 6226 2018-07-01 10:50 Step_Motor\Debug\DSP2833x_CpuTimers.obj
文件 6015 2016-04-17 10:14 Step_Motor\Debug\DSP2833x_CpuTimers.pp
文件 3943 2018-07-01 10:50 Step_Motor\Debug\DSP2833x_DefaultIsr.d
文件 31836 2018-07-01 10:50 Step_Motor\Debug\DSP2833x_DefaultIsr.obj
文件 6043 2016-04-17 10:14 Step_Motor\Debug\DSP2833x_DefaultIsr.pp
文件 3775 2018-07-01 10:50 Step_Motor\Debug\DSP2833x_EPwm.d
文件 16723 2018-07-01 10:50 Step_Motor\Debug\DSP2833x_EPwm.obj
文件 5875 2016-04-17 10:14 Step_Motor\Debug\DSP2833x_EPwm.pp
文件 3137 2018-07-01 10:50 Step_Motor\Debug\DSP2833x_GlobalVariableDefs.d
文件 128324 2018-07-01 10:50 Step_Motor\Debug\DSP2833x_GlobalVariableDefs.obj
文件 4733 2016-04-17 10:14 Step_Motor\Debug\DSP2833x_GlobalVariableDefs.pp
文件 3775 2018-07-01 10:50 Step_Motor\Debug\DSP2833x_Gpio.d
文件 12198 2018-07-01 10:50 Step_Motor\Debug\DSP2833x_Gpio.obj
............此处省略113个文件信息
- 上一篇:直流无刷电机控制算法
- 下一篇:U8采购业务流程图
相关资源
- CCS5.05.1可使用的license
- dsp2812上128点FFTc程序以及其CMD文件
- DSP28335程序片内FLASH搬运至RAM运行的
- 基于DSP2812的以太网调试程序
- DSP与PC通讯的几种方法
- DSP 语音识别程序 DTW MFCC
- 创龙C66x平台GigE工业相机图像采集案例
- VC工程转Qt工程文件的工具
- 基于DSP的大功率开关电源的设计方案
- 基于DSP 56F801的正弦波输出DC/AC电源
- 基于DSP的大功率开关电源设计
- 基于ARM7和DSP的逆变电源设计电路
- 基于运动控制器MCK2407的无刷直流电机
- es(elasticsearch)整合SpringCloudSpringBo
- tms320c6748 DSP原理图 SCH PCB
- TMS320F280049最小系统原理图
- F280049C_CMPSS_01.zip
- 基于DSP的矿用静止无功发生器的研制
- 基于DSP的矿井提升机永磁同步电机D
- 基于DSP的SVPWM变频调速系统
- 基于DSP的下一代车载娱乐系统
- DSP控制器原理及其在运动控制系统中
- 北京交通大学-数字图像处理试卷+ 答
- 十字路口交通灯.pdsprj
- 用DSP Builder实现FIR滤波器
- TMS320C54X DSP结构、原理及应用(第二版
- DSP 28035 源码
- PCI总线接口与DSP的HPI接口
- 基于DSP交流伺服系统与CAN总线的通信
- 单片机与DSP中的基于DSP的FFT算法在无
评论
共有 条评论