资源简介
F2812 开发板 的电机控制源程序,PWM波控制直流电机,能够实现调速和正反转调节
代码片段和文件信息
#include “DSP281x_Device.h“ // DSP281x Headerfile Include File
#include “DSP281x_Examples.h“ // DSP281x Examples Include File
// Prototype statements for functions found within this file.
interrupt void cpu_timer0_isr(void);
void Delay(unsigned int nDelay);
void Gpio_select(void);
void error(int);
void program_stop();
void Gpio_PortA(void);
void Gpio_PortB(void);
void Gpio_PortF(void);
void Gpio_PortDEG(void);
char ConvertScanToChar(unsigned char cScanCode);
void RefreshLEDArray(); // 刷新显示
void SetLEDArray(int nNumber); // 修改显示内容
#define T46uS 0x0d40
#define SCANCODE_0 0x70
#define SCANCODE_1 0x69
#define SCANCODE_2 0x72
#define SCANCODE_3 0x7A
#define SCANCODE_4 0x6B
#define SCANCODE_5 0x73
#define SCANCODE_6 0x74
#define SCANCODE_7 0x6C
#define SCANCODE_8 0x75
#define SCANCODE_9 0x7D
#define SCANCODE_Del 0x49
#define SCANCODE_Enter 0x5A
#define SCANCODE_Plus 0x79
#define SCANCODE_Minus 0x7B
#define SCANCODE_Mult 0x7C
#define SCANCODE_Divid 0x4A
#define SCANCODE_Num 0x77
#define CTRGR *(int *)0x108000
#define CTRLCDCMDR *(int *)0x108001
#define CTRKEY *(int *)0x108001
#define CTRLCDCR *(int *)0x108002
#define CTRCLKEY *(int *)0x108002
#define CTRLCDLCR *(int *)0x108003
#define CTRLCDRCR *(int *)0x108004
#define CTRLA *(int *)0x108005
#define CTRLR *(int *)0x108007
Uint16 var1 = 0;
Uint16 var2 = 0;
Uint16 var3 = 0;
Uint16 test_count = 0;
Uint16 Test_flag = 0;
Uint16 Test_var = 0;
Uint16 Test_status[32];
Uint16 PASS_flag = 0;
unsigned int uWork;
int jishu=0;
unsigned int uWorknCount=0uNuN1nCount1nDir;
unsigned int uPort8000;
unsigned int nScreenBuffer[1024];
unsigned char ledbuf[8]ledx[8];
unsigned char ledkey[10][8]=
{
{0x000x000x7C0x820x820x820x7C0x00}
{0x000x000x000x840xFE0x800x000x00} //1
{0x000x000x840xC20xA20x920x8C0x00} //2
{0x000x000x440x920x920x920x6C0x00}
{0x000x000x300x280x240xFE0x200x00}
{0x000x000x4E0x920x920x920x620x00}
{0x000x000x7C0x920x920x920x640x00}
{0x000x000x020xC20x320x0A0x060x00}
{0x000x000x6C0x920x920x920x6C0x00}
{0x000x000x4C0x920x920x920x7C0x00}
};
void main(void)
{
//int nCount=0;
char cKeycOldKey;
unsigned int nScanCodenKeyCode;
unsigned int nSpeed;
// Step 1. Initialize System Control:
// PLL WatchDog enable Peripheral Clocks
// This example function is found in the DSP281x_SysCtrl.c file.
InitSysCtrl();
// Step 2. Initalize GPIO:
// This example function is found in the DSP281x_Gpio.c file and
// illustrates how to set the GPIO to it‘s default state.
// InitGpio(); // Skipped for this example
// 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 DSP281x_PieCtr
- 上一篇:资源工具
- 下一篇:ckeditor设置行间距插件包
相关资源
- 6相12拍步进电机控制器
- LabVIEW步进电机控制.vi
- 无刷电机控制源程序
- STM32伺服电机控制器
- 步进电机控制文件 s型、梯形加减速算
- 工业相机原理图CY7C68013A+电机控制芯片
- 非常详细步进电机控制原理图,和完
- 基于FPGA的伺服电机控制器
- 无刷直流电机控制程序
- 基于STM32PID电机控制
- STM32F407. 基于PID速度环的步进电机速度
- 永磁同步电机控制方面-预测控制设计
- 基于STM32和ET1100的无刷直流电机控制器
- fpga伺服电机控制资料和源代码中期报
- PID电机控制与调速
- 基于DSP的无刷直流电机控制程序包括
- 现代电机控制技术王成元2009
- 步进电机控制机械臂源码 代码
- PAC5220中文参考手册
- FOC电机控制技术介绍(中文)
- 电机无传感器控制
- PAC5210中文参考手册
- CLA实现无刷电机控制可以运行的CODE
- 步进电机控制系统毕业论文(设计)
- 现代电机控制技术_王成元.rar
- 基于FPGA的直流电机控制
- 无感FOC电机控制代码
- dsp28035,can通信和电机控制程序,源码
- -AC Electric Motors Control_ Advanced Design T
- 第14 章 电机控制PWM.pdf
评论
共有 条评论