4410|5

69

帖子

0

TA的资源

一粒金砂(初级)

楼主
 

【求助】各位老大,430F13X里面到底有没有内置温度传感器阿! [复制链接]

【求助】各位老大,430F13X里面到底有没有内置温度传感器阿!

我看介绍说有,读手册没看见阿。
到底有没有阿?
有用过的吗?
如果有,能不能读出当前温度阿?怎么用哈?
谢谢啦!

最新回复

非常感谢!翻译成汇编好了!  详情 回复 发表于 2005-5-15 14:22
 
点赞 关注

回复
举报

83

帖子

0

TA的资源

一粒金砂(初级)

沙发
 
有的,IAR  FET_examples程序里有
 
 

回复

60

帖子

0

TA的资源

一粒金砂(初级)

板凳
 
能不能说详细些,怎么找这个例子

另外手册里面有说吗?
 
 
 

回复

63

帖子

0

TA的资源

一粒金砂(初级)

4
 
13X系列的带,13X1系列的不带,给你个14X的例子程序供参考,自己去改。

//******************************************************************************
// MSP-FET430P140 Demo - ADC12 Sample A10 Temp and Convert to oC and oF
//
// Description; A single sample is made on A10 with refernce to internal
// 1.5V Vref. Software sets ADC12SC to start sample and conversion - ADC12SC
// automatically cleared at EOC. ADC12 internal oscillator times sample
// and conversion. In Mainloop MSP430 waits in LPM0 to s××e power until
// ADC10 conversion complete, ADC12_ISR will force exit from any LPMx in
// Mainloop on reti.
// ACLK = n/a, MCLK = SMCLK = default DCO ~ 800kHz, ADC12CLK = ADC12OSC
//
// Uncalibrated temperature measured from device to devive will vary do to
// slope and offset variance from device to device - please see datasheet.
//
// MSP430Fx49
// -----------------
// /|\| XIN|-
// | | |
// --|RST XOUT|-
// | |
// |A10 |
//
// M.Buccini
// Texas Instruments, Inc
// January 2004
// Updated for IAR Embedded Workbench Version: 2.21B
//******************************************************************************

#include <msp430x14x.h>
int long temp;
int long IntDegF;
int long IntDegC;

void main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
ADC12CTL0 = SHT0_8 + REFON + ADC12ON;
ADC12CTL1 = SHP; // ena××e sample timer
ADC12MCTL0 = 0x01A;
ADC12IE = 0x001;

while(1)
{
ADC12CTL0 |= ENC + ADC12SC; // Sampling and conversion start
_BIS_SR(CPUOFF + GIE); // LPM0 with interrupts ena××ed

// oF = ((x/4096)*1500mV)-923mV)*1/1.97mV = x*761/4096 - 468
// IntDegF = (ADC12MEM0 - 2519)* 761/4096
IntDegF = (temp - 2519) * 761;
IntDegF = IntDegF / 4096;

// oC = ((x/4096)*1500mV)-986mV)*1/3.55mV = x*423/4096 - 278
// IntDegC = (ADC12MEM0 - 2692)* 423/4096
IntDegC = (temp - 2692) * 423;
IntDegC = IntDegC / 4096;

_NOP(); // << SET BREAKPOINT HERE
}
}

#pragma vector=ADC_VECTOR
__interrupt void ADC12ISR (void)
{
temp = ADC12MEM0; // Move results, IFG is cleared
_BIC_SR_IRQ(CPUOFF); // Clear CPUOFF bit from 0(SR)
}
 
 
 

回复

80

帖子

0

TA的资源

一粒金砂(初级)

5
 
//******************************************************************************
// MSP-FET430P140 Demo - ADC12, Converison of the Temperature Diode
//
//
// This example shows how to use the intergrated temperature diode to measure
// temperature. When the temperature diode channel (A10) is selected for
// conversion, the internal reference is automatically turned on as the source
// for the diode. Note however, that it is NOT automatically selected for the
// conversion. Any ××aila××e reference can be used for the conversion. In
// this example, a single conversion is performed of the temperature diode.
// The temperature is then calculated in degrees C and F, based on the A/D
// conversion value. Test by setting and running to a break point at "_NOP()"
// To view the temperature open a watch window in C-Spy and view DegC and
// DegF.
//
// Note: This example does not perform a calibration on the temperature diode
// A calibration of the temperature diode may be necessary in an application.
// see the device datasheet for the temperature diode specification.
//
// M.Mitchell
// Texas Instruments, Inc
// January, 2002
//******************************************************************************

#include "msp430x14x.h" // Standard Equations

static unsigned int ADCresult;
static unsigned long int DegC, DegF;

void main(void)
{
unsigned int i;
WDTCTL = WDTPW+WDTHOLD; // Stop watchdog timer
ADC12CTL0 = ADC12ON+REFON+REF2_5V+SHT0_6; // Setup ADC12, ref., sampling time
ADC12CTL1 = SHP; // Use sampling timer
ADC12MCTL0 = INCH_10+SREF_1; // Select channel A10, Vref+
ADC12IE = 0x01; // Ena××e ADC12IFG.0

for (i=0; i<0x3600; i++) // Delay for reference start-up
{
}

ADC12CTL0 |= ENC; // Ena××e conversions
_EINT(); // Ena××e interrupts

while(1)
{
ADC12CTL0 |= ADC12SC; // Start conversion
_BIS_SR(LPM0_bits); // Enter LPM0

// DegC = (Vsensor - 986mV)/3.55mV
// Vsensor = (Vref)(ADCresult)/4095)
// DegC -> ((ADCresult - 1615)*704)/4095
DegC = ((((long)ADCresult-1615)*704)/4095);
DegF = ((DegC * 9/5)+32); // Calculate DegF
_NOP(); // SET BREAKPOINT HERE
}
}

#pragma vector=ADC_VECTOR
__interrupt void ADC12ISR (void)
{
ADCresult = ADC12MEM0; // Move results, IFG is cleared
_BIC_SR_IRQ(LPM0_bits); // Clear LPM0
}
 
 
 

回复

69

帖子

0

TA的资源

一粒金砂(初级)

6
 
非常感谢!翻译成汇编好了!
 
 
 

回复
您需要登录后才可以回帖 登录 | 注册

随便看看
查找数据手册?

EEWorld Datasheet 技术支持

相关文章 更多>>
关闭
站长推荐上一条 1/6 下一条

 
EEWorld订阅号

 
EEWorld服务号

 
汽车开发圈

About Us 关于我们 客户服务 联系方式 器件索引 网站地图 最新更新 手机版

站点相关: 国产芯 安防电子 汽车电子 手机便携 工业控制 家用电子 医疗电子 测试测量 网络通信 物联网

北京市海淀区中关村大街18号B座15层1530室 电话:(010)82350740 邮编:100190

电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2025 EEWORLD.com.cn, Inc. All rights reserved
快速回复 返回顶部 返回列表