⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 parameter.h

📁 430系列开发之MSP430FE42x开发代码实例
💻 H
字号:
// parameter.h
#include "device.h"

#define withUARTComm
#define withCalibration
#define withDisplay


#define shunt
#define ExtIntLevel

#ifndef __PI 
#define __PI            3.141592653589793238462643
#endif
#define defSystemFreq 1024*4
#define defFlashFreq  13       /*((unsigned char)(((defSystemFreq/350)+1.5) & 0x3f))*/

#ifdef shunt
#define defVRatio 1.1917716E+1
#define defIRatio 3.24823236
#define defEnergieRatio 3.87115097E+1 /*(defVRatio * defIRatio)*/
#else
#define defVRatio 1.19251308E+1
#define defIRatio 3.54233074
#define defEnergieRatio 3.79404411E+1 /*(defVRatio * defIRatio)*/
#endif


#define calVoltage 230
#define calCurrent 10
#define calPhi 60
#define calCosPhi 0.5
#define calFreq 50


#ifdef shunt
#define V_Gain  GAIN_1
#define I1_Gain GAIN_32
#define I2_Gain GAIN_1
#else
#define V_Gain  GAIN_1
#define I1_Gain GAIN_1
#define I2_Gain GAIN_1
#endif

// Set event message request flags: 

#define defSET_EVENT \
                0 * WFSRDYME +    /* Interrupt on "New WFS"*/\
                0 * I2GTI1ME +    /* Interrupt on "I2GTI1"*/\
                0 * ILREACHEDME + /* Interrupt on "Interrupt Level reached"*/\
                1 * ENRDYME +     /* Interrupt on "Energy samples ready (1sec)"*/\
                1 * ZXLDME +      /* Interrupt on "leading zero cross"*/\
                1 * ZXTRME +      /* Interrupt on "trailing zero cross"*/\
                0 * CALRDYME      /* Interrupt on "Calibration Data ready"*/



/**
  * \ OFFSET for U, I1, I2
  */
#ifdef shunt
#define   defSET_V1OFFSET (0) 
#define   defSET_I1OFFSET (0) 
#define   defSET_I2OFFSET (0) 
#else
#define   defSET_V1OFFSET (0) 
#define   defSET_I1OFFSET (-4) 
#define   defSET_I2OFFSET (0) 
#endif


/**
  * \example for Phase Error Correction:
  * Sets phase error for current 2 at nominal mains frequency for 
  * current transformer according to its specification
  * (e.g. T60404-E4623-X101 from VAC (http://www.vacuumschmelze.com)).
  * - Turn ratio: 2500
  * - Burden resistor: RB = 18.8Ohm
  * - Phase error at 50Hz: 4.15

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -