資源簡介
DSP帶速度傳感器的電機(jī)矢量控制程序,可用于學(xué)習(xí)如何使用C語言在DSP上實(shí)現(xiàn)矢量控制

代碼片段和文件信息
//============================================================================
//?FILE: HVACI_Sensored-DevInit_F2803x.c
//?title: Device?initialization?for?F2803x?series
//============================================================================
/***************************
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?reserved?OTP?into?the?appropriate?trim?registers?occurs?automatically
//?in?the?Boot?ROM.?If?the?boot?ROM?code?is?bypassed?during?the?debug?process?the
//?following?function?MUST?be?called?for?the?ADC?and?oscillators?to?func
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件????????108??2013-08-19?09:51??HVACI_Sensored\.ccsproject
?????文件??????15680??2013-08-19?09:51??HVACI_Sensored\.cdtbuild
?????文件????????553??2013-08-19?09:51??HVACI_Sensored\.cdtproject
?????文件???????5846??2013-08-19?09:51??HVACI_Sensored\.launches\HVACI_Sensored.launch
?????文件???????1229??2013-08-19?09:51??HVACI_Sensored\.project
?????文件???????3016??2013-08-19?09:51??HVACI_Sensored\dlog4ch-HVACI_Sensored.h
?????文件???????6668??2013-08-19?09:51??HVACI_Sensored\DLOG4CHC.asm
?????文件???????2648??2013-08-19?09:51??HVACI_Sensored\DSP2803x_usDelay.asm
?????文件???????7582??2013-08-19?09:51??HVACI_Sensored\F28035_FLASH_HVACI_Sensored.CMD
?????文件???????5534??2013-08-19?09:51??HVACI_Sensored\F28035_RAM_HVACI_Sensored.CMD
?????文件????????814??2013-08-19?09:51??HVACI_Sensored\Graph1.graphProp
?????文件????????814??2013-08-19?09:51??HVACI_Sensored\Graph2.graphProp
?????文件??????30928??2013-08-19?09:51??HVACI_Sensored\HVACI_Sensored-DevInit_F2803x.c
?????文件???????2555??2013-08-19?09:51??HVACI_Sensored\HVACI_Sensored-Settings.h
?????文件??????44930??2013-08-19?09:51??HVACI_Sensored\HVACI_Sensored.c
?????文件???????2083??2013-08-19?09:51??HVACI_Sensored\HVACI_Sensored.h
?????文件?????????41??2013-08-19?09:51??HVACI_Sensored\macros.ini
?????文件???????1094??2013-08-19?09:51??HVACI_Sensored\NewTargetConfiguration.ccxm
?????文件?????994636??2013-08-19?09:51??HVACI_Sensored\~Docs\Sensored?FOC?of?ACI.pdf
?????目錄??????????0??2018-08-11?14:39??HVACI_Sensored\.launches
?????目錄??????????0??2018-08-11?14:39??HVACI_Sensored\~Docs
?????目錄??????????0??2018-08-11?14:39??HVACI_Sensored
-----------?---------??----------?-----??----
??????????????1126759????????????????????22
評論
共有 條評論