资源简介
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设置行间距插件包
相关资源
- 51单片机的步进电机控制,lcd1602显示
- MAXON电机CANOPEN对象字典
- 基于28335的有刷电机控制
- 整车控制器和电机控制器通讯协议
- 基于AT89C52单片机的步进电机控制系统
- 基于LabVIEW的步进电机控制系统设计
- 直流无刷电机控制算法
- 树莓派无刷电机控制器调速和 PID 控制
- 基于STM32的无位置传感器无刷直流电机
- 死区补偿原理与实现20180428
- 基于单片机的步进电机控制 毕业设计
- 步进初级3--6路步进电机速度控制函数
- STM32直流电机控制程序
- DSP TMS320F2812产生PWM波程序
- 用Labview控制伺服电机控制电机的程序
- 永磁无刷直流电机控制系统
- 自适应PID控制算法
- 基于Verilog的FPGA步进电机控制
- 步进电机S升降速曲线编程思路
- DSPF2812双闭环控制电机程序
- 步进电机控制程序设计流程图
- 步进电机控制程序基于三菱plc
- 伺服电机控制代码
- 直流电机控制.zip
- TI的电机控制基本程序
- Labview-伺服电机控制
- 步进电机控制正反转加速减速程序
- 步进电机控制仿真步进电机控制仿真
- 基于LabVIEW的电机控制系统
- 基于TMS320F28069的电机控制器bootloader设
评论
共有 条评论