資源簡介
基于DSP2812的無刷直流電機有hall傳感器控制程序,程序很全面。

代碼片段和文件信息
//============================================================================
//============================================================================
//
//?FILE: BLDC_Sensored-DevInit_F2803x.c
//
//?title: Device?initialization?for?F2803x?series
//?
//?Version:?1.0?
//
//?Date:? 09?Feb?2011
//
//============================================================================
//============================================================================
/***************************
Note?that?the?CLA?is?not?used?nor?initialized?in?this?project.?Please?download?
the?Peripheral?Files?and?Example?Projects?collection?(SPRC832)?and?look?at?the?
cla_adc?project?for?information?on?how?to?use?and?configure?the?CLA.
***************************/
#include?“PeripheralHeaderIncludes.h“
//?Functions?that?will?be?run?from?RAM?need?to?be?assigned?to
//?a?different?section.??This?section?will?then?be?mapped?to?a?load?and
//?run?address?using?the?linker?cmd?file.
#pragma?CODE_SECTION(InitFlash?“ramfuncs“);
#define?Device_cal?(void???(*)(void))0x3D7C80
void?DeviceInit(void);
void?PieCntlInit(void);
void?PieVectTableInit(void);
void?WDogDisable(void);
void?PLLset(Uint16);
void?ISR_ILLEGAL(void);
//--------------------------------------------------------------------
//??Configure?Device?for?target?Application?Here
//--------------------------------------------------------------------
void?DeviceInit(void)
{
WDogDisable();? //?Disable?the?watchdog?initially
DINT; //?Global?Disable?all?Interrupts
IER?=?0x0000; //?Disable?CPU?interrupts
IFR?=?0x0000; //?Clear?all?CPU?interrupt?flags
//?Switch?to?Internal?Oscillator?1?and?turn?off?all?other?clock
//?sources?to?minimize?power?consumption
EALLOW;
SysCtrlRegs.CLKCTL.bit.INTOSC1OFF?=?0;
????SysCtrlRegs.CLKCTL.bit.OSCCLKSRCSEL=0;??//?Clk?Src?=?INTOSC1
SysCtrlRegs.CLKCTL.bit.XCLKINOFF=1;?????//?Turn?off?XCLKIN
SysCtrlRegs.CLKCTL.bit.XTALOSCOFF=1;????//?Turn?off?XTALOSC
SysCtrlRegs.CLKCTL.bit.INTOSC2OFF=1;????//?Turn?off?INTOSC2
????EDIS;
//?SYSTEM?CLOCK?speed?based?on?internal?oscillator?=?10?MHz
//?0xC?=??60 MHz (12)
//?0xB?=??55 MHz (11)
//?0xA?=??50 MHz (10)
//?0x9?=??45 MHz (9)
//?0x8?=??40 MHz (8)
//?0x7?=??35 MHz (7)
//?0x6?=??30 MHz (6)
//?0x5?=??25 MHz (5)
//?0x4?=??20 MHz (4)
//?0x3?=??15 MHz (3)
//?0x2?=??10 MHz (2)
PLLset(0xC); //?choose?from?options?above
//?Initialise?interrupt?controller?and?Vector?Table
//?to?defaults?for?now.?Application?ISR?mapping?done?later.
PieCntlInit();
PieVectTableInit();
???EALLOW;?//?below?registers?are?“protected“?allow?access.
//?LOW?SPEED?CLOCKS?prescale?register?settings
???SysCtrlRegs.LOSPCP.all?=?0x0002; //?Sysclk?/?4?(15?MHz)
???SysCtrlRegs.XCLK.bit.XCLKOUTDIV=2;
??????
??????
//?ADC?CALIBRATION?
//---------------------------------------------------
//?The?Device_cal?function?which?copies?the?ADC?&?oscillator?calibration?values
//?from?TI?reserv
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????350??2018-11-23?17:01??BLDC_Sensored\.ccsproject
?????文件??????25106??2013-08-15?13:50??BLDC_Sensored\.cdtbuild
?????文件??????25106??2018-11-23?17:01??BLDC_Sensored\.cdtbuild_initial
?????文件????????677??2013-08-15?13:50??BLDC_Sensored\.cdtproject
?????文件??????38847??2018-11-23?17:01??BLDC_Sensored\.cproject
?????文件???????2966??2018-11-23?17:01??BLDC_Sensored\.project
?????文件???????2562??2018-11-23?17:01??BLDC_Sensored\.project_initial
?????文件?????????62??2018-11-23?17:01??BLDC_Sensored\.settings\org.eclipse.cdt.codan.core.prefs
?????文件????????123??2018-11-23?17:01??BLDC_Sensored\.settings\org.eclipse.cdt.debug.core.prefs
?????文件????????233??2018-11-23?17:02??BLDC_Sensored\.settings\org.eclipse.core.resources.prefs
?????文件????????664??2013-08-15?13:50??BLDC_Sensored\AddWatchWindowVars_F2803x.js
?????文件????????646??2013-08-15?13:50??BLDC_Sensored\AddWatchWindowVars_F2806x.js
?????文件??????31224??2013-08-15?13:50??BLDC_Sensored\BLDC_Sensored-DevInit_F2803x.c
?????文件??????35695??2013-08-15?13:50??BLDC_Sensored\BLDC_Sensored-DevInit_F2806x.c
?????文件???????3354??2013-08-15?13:50??BLDC_Sensored\BLDC_Sensored-Settings.h
?????文件??????43013??2013-08-15?13:50??BLDC_Sensored\BLDC_Sensored.c
?????文件???????2524??2013-08-15?13:50??BLDC_Sensored\BLDC_Sensored.h
?????文件???????3015??2013-08-15?13:50??BLDC_Sensored\dlog4ch-BLDC_Sensored.h
?????文件???????6668??2013-08-15?13:50??BLDC_Sensored\DLOG4CHC.asm
?????文件???????2648??2013-08-15?13:50??BLDC_Sensored\DSP2803x_usDelay.asm
?????文件???????5510??2013-08-15?13:50??BLDC_Sensored\F28035_RAM_BLDC_Sensored.CMD
?????文件??????18190??2013-08-15?13:50??BLDC_Sensored\f2803xbldcpwm_BLDC.h
?????文件??????12557??2013-08-15?13:50??BLDC_Sensored\f2803xhall_gpio_BLDC.h
?????文件???????4902??2013-08-15?13:50??BLDC_Sensored\f2803xileg_vdc_BLDC.h
?????文件???????9291??2013-08-15?13:50??BLDC_Sensored\f2803xpwmdac_BLDC.h
?????文件????????119??2018-11-23?17:03??BLDC_Sensored\F2803x_RAM\BLDC_Sensored-DevInit_F2803x.pp
?????文件?????????74??2018-11-23?17:03??BLDC_Sensored\F2803x_RAM\BLDC_Sensored.pp
?????文件????????365??2018-11-30?10:14??BLDC_Sensored\F2803x_RAM\ccsObjs.opt
?????文件???????3985??2018-11-30?10:14??BLDC_Sensored\F2803x_RAM\makefile
?????文件????????250??2018-11-30?10:14??BLDC_Sensored\F2803x_RAM\ob
............此處省略19個文件信息
評論
共有 條評論