MSP430 ADC12 AD采样寄存器中文定义

/************************************************************
* ADC12   A/D采样寄存器定义
************************************************************/
/*ADC12转换控制类寄存器*/
#define ADC12CTL0_          0x0;‘ /* ADC12 Control 0 */
sfrw    ADC12CTL0         = ADC12CTL0_;
#define ADC12CTL1_          0x01A2  /* ADC12 Control 1 */
sfrw    ADC12CTL1         = ADC12CTL1_;
/*ADC12中断控制类寄存器*/
#define ADC12IFG_           0x01A4  /* ADC12 Interrupt Flag */
sfrw    ADC12IFG          = ADC12IFG_;
#define ADC12IE_            0x01A6  /* ADC12 Interrupt Enable */
sfrw    ADC12IE           = ADC12IE_;
#define ADC12IV_            0x01A8  /* ADC12 Interrupt Vector Word */
sfrw    ADC12IV           = ADC12IV_;
/*ADC12存贮器类寄存器*/
#define ADC12MEM_           0x0140  /* ADC12 Conversion Memory */
#ifndef __IAR_SYSTEMS_ICC
#define ADC12MEM            ADC12MEM_ /* ADC12 Conversion Memory (for assembler) */
#else
#define ADC12MEM            ((int*) ADC12MEM_) /* ADC12 Conversion Memory (for C) */
#endif
#define ADC12MEM0_          ADC12MEM_ /* ADC12 Conversion Memory 0 */
sfrw    ADC12MEM0         = ADC12MEM0_;
#define ADC12MEM1_          0x0142  /* ADC12 Conversion Memory 1 */
sfrw    ADC12MEM1         = ADC12MEM1_;
#define ADC12MEM2_          0x0144  /* ADC12 Conversion Memory 2 */
sfrw    ADC12MEM2         = ADC12MEM2_;
#define ADC12MEM3_          0x0146  /* ADC12 Conversion Memory 3 */
sfrw    ADC12MEM3         = ADC12MEM3_;
#define ADC12MEM4_          0x0148  /* ADC12 Conversion Memory 4 */
sfrw    ADC12MEM4         = ADC12MEM4_;
#define ADC12MEM5_          0x014A  /* ADC12 Conversion Memory 5 */
sfrw    ADC12MEM5         = ADC12MEM5_;
#define ADC12MEM6_          0x014C  /* ADC12 Conversion Memory 6 */
sfrw    ADC12MEM6         = ADC12MEM6_;
#define ADC12MEM7_          0x014E  /* ADC12 Conversion Memory 7 */
sfrw    ADC12MEM7         = ADC12MEM7_;
#define ADC12MEM8_          0x0150  /* ADC12 Conversion Memory 8 */
sfrw    ADC12MEM8         = ADC12MEM8_;
#define ADC12MEM9_          0x0152  /* ADC12 Conversion Memory 9 */
sfrw    ADC12MEM9         = ADC12MEM9_;
#define ADC12MEM10_         0x0154  /* ADC12 Conversion Memory 10 */
sfrw    ADC12MEM10        = ADC12MEM10_;
#define ADC12MEM11_         0x0156  /* ADC12 Conversion Memory 11 */
sfrw    ADC12MEM11        = ADC12MEM11_;
#define ADC12MEM12_         0x0158  /* ADC12 Conversion Memory 12 */
sfrw    ADC12MEM12        = ADC12MEM12_;
#define ADC12MEM13_         0x015A  /* ADC12 Conversion Memory 13 */
sfrw    ADC12MEM13        = ADC12MEM13_;
#define ADC12MEM14_         0x015C  /* ADC12 Conversion Memory 14 */
sfrw    ADC12MEM14        = ADC12MEM14_;
#define ADC12MEM15_         0x015E  /* ADC12 Conversion Memory 15 */
sfrw    ADC12MEM15        = ADC12MEM15_;
/*ADC12存贮控制类寄存器*/
#define ADC12MCTL_          0x0080  /* ADC12 Memory Control */
#ifndef __IAR_SYSTEMS_ICC
#define ADC12MCTL           ADC12MCTL_ /* ADC12 Memory Control (for assembler) */
#else
#define ADC12MCTL           ((char*) ADC12MCTL_) /* ADC12 Memory Control (for C) */
#endif
#define ADC12MCTL0_         ADC12MCTL_ /* ADC12 Memory Control 0 */
sfrb    ADC12MCTL0        = ADC12MCTL0_;
#define ADC12MCTL1_         0x0081  /* ADC12 Memory Control 1 */
sfrb    ADC12MCTL1        = ADC12MCTL1_;
#define ADC12MCTL2_         0x0082  /* ADC12 Memory Control 2 */
sfrb    ADC12MCTL2        = ADC12MCTL2_;
#define ADC12MCTL3_         0x0083  /* ADC12 Memory Control 3 */
sfrb    ADC12MCTL3        = ADC12MCTL3_;
#define ADC12MCTL4_         0x0084  /* ADC12 Memory Control 4 */
sfrb    ADC12MCTL4        = ADC12MCTL4_;
#define ADC12MCTL5_         0x0085  /* ADC12 Memory Control 5 */
sfrb    ADC12MCTL5        = ADC12MCTL5_;
#define ADC12MCTL6_         0x0086  /* ADC12 Memory Control 6 */
sfrb    ADC12MCTL6        = ADC12MCTL6_;
#define ADC12MCTL7_         0x0087  /* ADC12 Memory Control 7 */
sfrb    ADC12MCTL7        = ADC12MCTL7_;
#define ADC12MCTL8_         0x0088  /* ADC12 Memory Control 8 */
sfrb    ADC12MCTL8        = ADC12MCTL8_;
#define ADC12MCTL9_         0x0089  /* ADC12 Memory Control 9 */
sfrb    ADC12MCTL9        = ADC12MCTL9_;
#define ADC12MCTL10_        0x008A  /* ADC12 Memory Control 10 */
sfrb    ADC12MCTL10       = ADC12MCTL10_;
#define ADC12MCTL11_        0x008B  /* ADC12 Memory Control 11 */
sfrb    ADC12MCTL11       = ADC12MCTL11_;
#define ADC12MCTL12_        0x008C  /* ADC12 Memory Control 12 */
sfrb    ADC12MCTL12       = ADC12MCTL12_;
#define ADC12MCTL13_        0x008D  /* ADC12 Memory Control 13 */
sfrb    ADC12MCTL13       = ADC12MCTL13_;
#define ADC12MCTL14_        0x008E  /* ADC12 Memory Control 14 */
sfrb    ADC12MCTL14       = ADC12MCTL14_;
#define ADC12MCTL15_        0x008F  /* ADC12 Memory Control 15 */
sfrb    ADC12MCTL15       = ADC12MCTL15_;
/* ADC12CTL0 内8位控制寄存器位*/
#define ADC12SC             0x001         /*采样/转换控制位*/   
#define ENC                 0x002         /* 转换允许位*/
#define ADC12TOVIE          0x004         /*转换时间溢出中断允许位*/
#define ADC12OVIE           0x008         /*溢出中断允许位*/ 
#define ADC12ON             0x010         /*ADC12内核控制位*/
#define REFON               0x020         /*参考电压控制位*/
#define REF2_5V             0x040         /*内部参考电压的电压值选择位 ‘0‘为1.5V; ‘1‘为2.5V*/
#define MSC                 0x080         /*多次采样/转换位*/
/*SHT0 采样保持定时器0 控制ADC12的结果存贮器MEM0~MEM7的采样周期*/
#define SHT0_0               0*0x100       /*采样周期=TADC12CLK*4 */
#define SHT0_1               1*0x100       /*采样周期=TADC12CLK*8 */
#define SHT0_2               2*0x100       /*采样周期=TADC12CLK*16 */
#define SHT0_3               3*0x100       /*采样周期=TADC12CLK*32 */
#define SHT0_4               4*0x100       /*采样周期=TADC12CLK*64 */
#define SHT0_5               5*0x100       /*采样周期=TADC12CLK*96 */
#define SHT0_6               6*0x100       /*采样周期=TADC12CLK*128 */
#define SHT0_7               7*0x100       /*采样周期=TADC12CLK*192 */
#define SHT0_8               8*0x100       /*采样周期=TADC12CLK*256 */
#define SHT0_9               9*0x100       /*采样周期=TADC12CLK*384 */
#define SHT0_10             10*0x100       /*采样周期=TADC12CLK*512 */  
#define SHT0_11             11*0x100       /*采样周期=TADC12CLK*768 */
#define SHT0_12             12*0x100       /*采样周期=TADC12CLK*1024 */
#define SHT0_13             13*0x100       /*采样周期=TADC12CLK*1024 */ 
#define SHT0_14             14*0x100       /*采样周期=TADC12CLK*1024 */ 
#define SHT0_15             15*0x100       /*采样周期=TADC12CLK*1024 */
/*SHT1 采样保持定时器1 控制ADC12的结果存贮器MEM8~MEM15的采样周期*/
#define SHT1_0               0*0x100       /*采样周期=TADC12CLK*4 */
#define SHT1_1               1*0x100       /*采样周期=TADC12CLK*8 */
#define SHT1_2               2*0x100       /*采样周期=TADC12CLK*16 */
#define SHT1_3               3*0x100       /*采样周期=TADC12CLK*32 */
#define SHT1_4               4*0x100       /*采样周期=TADC12CLK*64 */
#define SHT1_5               5*0x100       /*采样周期=TADC12CLK*96 */
#define SHT1_6               6*0x100       /*采样周期=TADC12CLK*128 */
#define SHT1_7               7*0x100       /*采样周期=TADC12CLK*192 */
#define SHT1_8               8*0x100       /*采样周期=TADC12CLK*256 */
#define SHT1_9               9*0x100       /*采样周期=TADC12CLK*384 */
#define SHT1_10             10*0x100       /*采样周期=TADC12CLK*512 */  
#define SHT1_11             11*0x100       /*采样周期=TADC12CLK*768 */
#define SHT1_12             12*0x100       /*采样周期=TADC12CLK*1024 */
#define SHT1_13             13*0x100       /*采样周期=TADC12CLK*1024 */ 
#define SHT1_14             14*0x100       /*采样周期=TADC12CLK*1024 */ 
#define SHT1_15             15*0x100       /*采样周期=TADC12CLK*1024 */

/* ADC12CTL1 内8位控制寄存器位*/
#define ADC12BUSY           0x0001         /*ADC12忙标志位*/
#define CONSEQ_0             0*2           /*单通道单次转换*/ 
#define CONSEQ_1             1*2           /*序列通道单次转换*/
#define CONSEQ_2             2*2           /*单通道多次转换*/
#define CONSEQ_3             3*2           /*序列通道多次转换*/
#define ADC12SSEL_0          0*8           /*ADC12内部时钟源*/
#define ADC12SSEL_1          1*8           /*ACLK*/
#define ADC12SSEL_2          2*8           /*MCLK*/
#define ADC12SSEL_3          3*8           /*SCLK*/
#define ADC12DIV_0           0*0x20        /*1分频*/
#define ADC12DIV_1           1*0x20        /*2分频*/
#define ADC12DIV_2           2*0x20        /*3分频*/
#define ADC12DIV_3           3*0x20        /*4分频*/ 
#define ADC12DIV_4           4*0x20        /*5分频*/ 
#define ADC12DIV_5           5*0x20        /*6分频*/
#define ADC12DIV_6           6*0x20        /*7分频*/
#define ADC12DIV_7           7*0x20        /*8分频*/
#define ISSH                 0x0100        /*采样输入信号反向与否控制位*/
#define SHP                  0x0200        /*采样信号(SAMPCON)选择控制位*/
#define SHS_0                0*0x400       /*采样信号输入源选择控制位 ADC12SC*/ 
#define SHS_1                1*0x400       /*采样信号输入源选择控制位 TIMER_A.OUT1*/
#define SHS_2                2*0x400       /*采样信号输入源选择控制位 TIMER_B.OUT0*/
#define SHS_3                3*0x400       /*采样信号输入源选择控制位 TIMER_B.OUT1*/
/*转换存贮器地址定义位*/
#define CSTARTADD_0          0*0x1000      /*选择MEM0首地址*/
#define CSTARTADD_1          1*0x1000      /*选择MEM1首地址*/ 
#define CSTARTADD_2          2*0x1000      /*选择MEM2首地址*/
#define CSTARTADD_3          3*0x1000      /*选择MEM3首地址*/
#define CSTARTADD_4          4*0x1000      /*选择MEM4首地址*/
#define CSTARTADD_5          5*0x1000      /*选择MEM5首地址*/
#define CSTARTADD_6          6*0x1000      /*选择MEM6首地址*/
#define CSTARTADD_7          7*0x1000      /*选择MEM7首地址*/ 
#define CSTARTADD_8          8*0x1000      /*选择MEM8首地址*/
#define CSTARTADD_9          9*0x1000      /*选择MEM9首地址*/
#define CSTARTADD_10        10*0x1000      /*选择MEM10首地址*/
#define CSTARTADD_11        11*0x1000      /*选择MEM11首地址*/
#define CSTARTADD_12        12*0x1000      /*选择MEM12首地址*/
#define CSTARTADD_13        13*0x1000      /*选择MEM13首地址*/      
#define CSTARTADD_14        14*0x1000      /*选择MEM14首地址*/    
#define CSTARTADD_15        15*0x1000      /*选择MEM15首地址*/
  
/* ADC12MCTLx */
#define INCH_0               0                 /*选择模拟量通道0 A0 */
#define INCH_1               1                 /*选择模拟量通道0 A1*/
#define INCH_2               2                 /*选择模拟量通道0 A2*/
#define INCH_3               3                 /*选择模拟量通道0 A3*/
#define INCH_4               4                 /*选择模拟量通道0 A4*/
#define INCH_5               5                 /*选择模拟量通道0 A5*/
#define INCH_6               6                 /*选择模拟量通道0 A6*/
#define INCH_7               7                 /*选择模拟量通道0 A7*/
#define INCH_8               8                 /*VEREF+*/
#define INCH_9               9                 /*VEREF-*/
#define INCH_10             10                 /*片内温度传感器的输出*/
#define INCH_11             11                 /*(AVCC-AVSS)/2*/
#define INCH_12             12                 /*(AVCC-AVSS)/2*/
#define INCH_13             13                 /*(AVCC-AVSS)/2*/
#define INCH_14             14                 /*(AVCC-AVSS)/2*/
#define INCH_15             15                 /*(AVCC-AVSS)/2*/
/*参考电压源选择位*/
#define SREF_0               0*0x10            /*VR+ = AVCC; VR- = AVSS*/
#define SREF_1               1*0x10            /*VR+ = VREF+; VR- = AVSS*/
#define SREF_2               2*0x10            /*VR+ = VEREF+; VR- = AVSS*/
#define SREF_3               3*0x10            /*VR+ = VEREF+; VR- = AVSS*/
#define SREF_4               4*0x10            /*VR+ = AVCC; VR- = VREF-*/
#define SREF_5               5*0x10            /*VR+ = VREF+; VR- = VREF-*/
#define SREF_6               6*0x10            /*VR+ = VEREF+; VR- = VREF-*/
#define SREF_7               7*0x10            /*VR+ = VEREF+; VR- = VREF-*/
#define EOS                 0x80               /*序列结束选择位*/

时间: 2024-11-05 19:39:41

MSP430 ADC12 AD采样寄存器中文定义的相关文章

msp430单片机AD转换

msp430单片机AD转换 2010-08-01 20:14:05|  分类: msp430单片机|举报|字号 订阅 一.简单介绍: ADC12模块中是由以下部分组成:输入的16路模拟开关(外部8路,内部4路),ADC内部电压参考源,ADC12内核,ADC时钟源部分,采集与保持/触发源部分,ADC数据输出部分,ADC控制寄存器等组成. 四种采样模式: (1)单通道单次转换模式 (2)序列通道单词转换模式 (3)单通道多次转换模式 (4)序列通道多次转换模式 个人觉得(3)模式应该是使用较多的,

MSP430 ADC12模块(转)

下图是ADC12模块结构图 在还有没讲述ADC12模块中组成之前,我想着重讲述ADC12的采样与转换这部分.后面在再作其它部分讲述.[采样与转换]ADC12完成对一个模拟信号模数转换过程由两部分组成:采样保持和转换.完成采样转换周期时间= 采样保持时间 +转换时间完成采样转换周期时间:ADC12完成对一个模拟信号模数转换所需要时间,这部分由采样保持时间和转换时间组成.采样保持时间:由产生SAMPCON信号开始到结束所需时间,这期间ADC进行对模拟信号采样保持.在脉冲采样模式时(SHP=1),采样

AD采样的平均值滤波

基本问题:单片机ad采样,连续采样十次,对这十次数据取平均值. 注意:最开始的一次就是用当次的数据,以后每更新一个数据就取当前数据加上前九个数据,取平均. 先看代码: static int _filter(int m) { static int flag_first = 0, _buff[10], sum; const int _buff_max = 10; int i; if(flag_first == 0) { flag_first = 1; for(i = 0, sum = 0; i <

关于Stm32定时器+ADC+DMA进行AD采样的实现

Stm32的ADC有DMA功能这都毋庸置疑,也是我们用的最多的!然而,如果我们要对一个信号(比如脉搏信号)进行定时采样(也就是隔一段时间,比如说2ms),有三种方法: 1.使用定时器中断每隔一定时间进行ADC转换,这样每次都必须读ADC的数据寄存器,非常浪费时间! 2.把ADC设置成连续转换模式,同时对应的DMA通道开启循环模式,这样ADC就一直在进行数据采集然后通过DMA把数据搬运至内存.但是这样做的话还得加一个定时中断,用来定时读取内存中的数据! 3.使用ADC的定时器触发ADC转换的功能,

RTSP协议-中文定义

转自:http://blog.csdn.net/arau_sh/article/details/2982914 E-mail:[email protected] 译者: Bryan.Wong(王晶,宁夏固原) 译文版本:alpha 0.80 译文发布时间:2007-7-25 版权:本中文翻译文档之版权归王晶所有.可于非商业用途前提下自由转载,但必须保留此翻译及版权信息. 网络工作组 H.Schulzrinne 请求注释:2326 哥伦比亚大学. 类别: 标准跟踪 A.Rao Netscape R

AD采样问题总结

说明:来源http://bbs.csdn.net/topics/390899032论坛讨论 一个100HZ的正弦波,我用300HZ的采样率去采样,那么根据香农定律是不是一秒钟就采集到300个点,因为这个波形是100HZ,所以这一秒钟内就有一百个波形经过,那么300个点平均到每个波形上就只有3个点了,也就是一个波形上采集3个点, 采样率一般是Sps为单位,而不是用Hz, 例如300Sps,即300 Samples Per  Second.100Hz的正弦,用300Sps的采样率,则平均每个正弦周期

ad采样后幅度的衰减

adc采集到的信号对低频有一定的衰减.因为要确定衰减的程度.通过da输出到示波器上观察. 数据如下: 输入 输出(enable) 输出(disable) 1v(20hz) 1v 0.88v 1v(10hz) 0.76v 0.76v 1v(8hz) 0.6v 0.68v 1v(5hz) 0.4v 0.5v 1v(3hz) 0.25v 0.35v 1v(2hz) 0.15v 0.25v 1v(1hz) 0.05v 0.12v 在8hz以下还是有比较到的衰减.这是使用示波器观察还是经过dac的于是想直

STM32 AD采样电压计算公式

在使用STM32的ADC进行检测电压时必须回涉及到电压值的计算,为了更高效率的获取电压,现在有以下三种方法: 你得到的结果是你当前AD引脚上的电压值相对于3.3V和4096转换成的数字.假如你得到的AD结果是ADC_DR这个变量,他们存在以下关系: ADC_DR/当前电压值 = 4096/3300毫伏如果你反过程想得到当前电压值,可以如下计算:unsigned long Voltage;Voltage = ADC_DR; //---假设你得到的AD结果存放到ADC_DR这个变量中;Voltage

MSP430学习笔记(4)ADC12

几个术语: a)        分辨率(LSB):表示输出数字量变化一个相邻数码所需要输入模拟电压的变化量,它定义为转换器的满刻度电压与2的n次幂,其中n为ADC的位数. b)        量化误差:由于有限数字对模拟值进行离散取值(量化)而引起的误差.因此,量化误差理论上为一个单位分辨率.即正负1\2LSB. c)        转换精度:反应实际的ADC模块在量化上与理想的ADC模块进行模数转换的差值. d)        转换时间:指ADC完成一次模/数转换所需要的时间. 2.