• 大小: 1.02MB
    文件类型: .rar
    金币: 2
    下载: 1 次
    发布日期: 2023-10-14
  • 语言: 其他
  • 标签: DSP  PMSM  无位置  程序  

资源简介

基于DSP28335的永磁同步电机无速度传感器程序

资源截图

代码片段和文件信息

//============================================================================
// FILE: HVPMSM_Sensorless-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 f

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        108  2017-08-14 22:19  PMSM_SENSERLESS2\PMSM\.ccsproject

     文件      28321  2017-08-14 22:19  PMSM_SENSERLESS2\PMSM\.cdtbuild

     文件        553  2017-08-14 22:19  PMSM_SENSERLESS2\PMSM\.cdtproject

     文件      41904  2017-08-14 22:19  PMSM_SENSERLESS2\PMSM\.F28335_xds100.ccxml.cache2

     文件       4887  2017-08-14 22:19  PMSM_SENSERLESS2\PMSM\.launches\HVPM_Sensorless_2833x.launch

     文件       2894  2017-08-14 22:19  PMSM_SENSERLESS2\PMSM\.project

     文件       3017  2017-08-14 22:19  PMSM_SENSERLESS2\PMSM\dlog4ch-HVPM_Sensorless.h

     文件       6668  2017-08-14 22:19  PMSM_SENSERLESS2\PMSM\DLOG4CHC.asm

     文件       2648  2017-08-14 22:19  PMSM_SENSERLESS2\PMSM\DSP2803x_usDelay.asm

     文件       2728  2017-08-14 22:19  PMSM_SENSERLESS2\PMSM\DSP2833x_usDelay.asm

     文件       7542  2017-08-14 22:19  PMSM_SENSERLESS2\PMSM\F28035_FLASH_HVPM_Sensorless.CMD

     文件       5532  2017-08-14 22:19  PMSM_SENSERLESS2\PMSM\F28035_RAM_HVPM_Sensorless.CMD

     文件       9278  2017-08-14 22:19  PMSM_SENSERLESS2\PMSM\F28335_FLASH_HVPM_Sensorless.cmd

     文件       8112  2017-08-14 22:19  PMSM_SENSERLESS2\PMSM\F28335_RAM_HVPM_Sensorless.CMD

     文件        814  2017-08-14 22:19  PMSM_SENSERLESS2\PMSM\Graph1.graphProp

     文件        814  2017-08-14 22:19  PMSM_SENSERLESS2\PMSM\Graph2.graphProp

     文件      30931  2017-08-14 22:19  PMSM_SENSERLESS2\PMSM\HVPM_Sensorless-DevInit_F2803x.c

     文件      34178  2017-08-14 22:20  PMSM_SENSERLESS2\PMSM\HVPM_Sensorless-DevInit_F2833x.c

     文件       2827  2017-08-14 22:20  PMSM_SENSERLESS2\PMSM\HVPM_Sensorless-Settings.h

     文件      57843  2017-08-14 22:20  PMSM_SENSERLESS2\PMSM\HVPM_Sensorless.c

     文件       2514  2017-08-14 22:20  PMSM_SENSERLESS2\PMSM\HVPM_Sensorless.h

     文件         41  2017-08-14 22:20  PMSM_SENSERLESS2\PMSM\macros.ini

     文件       1072  2017-08-14 22:20  PMSM_SENSERLESS2\PMSM\TargetF2803x.ccxml

     文件       1078  2017-08-14 22:20  PMSM_SENSERLESS2\PMSM\TargetF2833x.ccxml

     文件    1068707  2017-08-14 22:20  PMSM_SENSERLESS2\PMSM\~Docs\Sensorless FOC of PMSM_F2833x.pdf

     目录          0  2018-05-02 16:00  PMSM_SENSERLESS2\PMSM\.launches

     目录          0  2018-05-02 16:00  PMSM_SENSERLESS2\PMSM\~Docs

     目录          0  2018-05-02 16:00  PMSM_SENSERLESS2\PMSM

     目录          0  2018-05-02 16:00  PMSM_SENSERLESS2

----------- ---------  ---------- -----  ----

............此处省略2个文件信息

评论

共有 条评论