1.RC复位电路选择的是10K和0.1uF,系统Vcc=3.3V,系统工作频率为20MHz,AD的fadc12=2.5MHz
2.系统上电之后,系统初始化AD部分失败,可能整个系统无法正常启动,系统按下复位按钮之后,又都可以正常启动了。
3.所有的调试用的程控电源,精度和速度都没有什么问题。
Susan Yang:
请问您是自己设计的板子?是否有尝试烧录TI的ADC例程?若是您自己程序的话,能否上传下相关程序?
user5775225:
回复 Susan Yang:
P6SEL |= BIT0+BIT1;// Enable A/D channel A4REFCTL0 |= REFMSTR+REFVSEL_2+REFON+REFTCOFF;ADC12CTL0 = ADC12ON// 打开ADC内核+ADC12MSC// 连续采样+ADC12SHT0_3;// 保持时间为16个cycles
ADC12CTL1 = ADC12SSEL_2// 时钟选择为:MCLK+ADC12DIV_7// 时钟分频为:7+1=8,即20M/8=2.5MHz+ADC12SHP// 采样信号源自采样定时器+ADC12CONSEQ_3;// 序列通道多次采样
ADC12MCTL0 = ADC12SREF_1+ADC12INCH_0;// Vr+=Vref+ and Vr-=AVssADC12MCTL1 = ADC12SREF_1+ADC12INCH_1+ADC12EOS;// Vr+=Vref+ and Vr-=AVssADC12CTL0 |= ADC12ENC;// Enable conversionsADC12CTL0 |= ADC12SC;// Start conversion – software trigge
user5775225:
回复 Susan Yang:
电路板确实是自己设计的 使用的内部基准源,但是Verf+和Verf-定义为输出功能,刚刚实验,把Verf+用10uF和0.1uF的电容到GND,情况有改善。
Susan Yang:
回复 user5775225:
使用内部基准电压的话,可以参考
/* --COPYRIGHT--,BSD_EX* Copyright (c) 2012, Texas Instruments Incorporated* All rights reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:** *Redistributions of source code must retain the above copyright*notice, this list of conditions and the following disclaimer.** *Redistributions in binary form must reproduce the above copyright*notice, this list of conditions and the following disclaimer in the*documentation and/or other materials provided with the distribution.** *Neither the name of Texas Instruments Incorporated nor the names of*its contributors may be used to endorse or promote products derived*from this software without specific prior written permission.** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.**********************************************************************************MSP430 CODE EXAMPLE DISCLAIMER** MSP430 code examples are self-contained low-level programs that typically* demonstrate a single peripheral function or device feature in a highly* concise manner. For this the code may rely on the device's power-on default* register values and settings such as the clock configuration and care must* be taken when combining code from several examples to avoid potential side* effects. Also see www.ti.com/grace for a GUI- and www.ti.com/msp430ware* for an API functional library-approach to peripheral configuration.** --/COPYRIGHT--*/ //****************************************************************************** //MSP430F543xA Demo - ADC12_A, Sample A10 Temp and Convert to oC and oF // //Description: A single sample is made on A10 with reference 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 LPM4 to save power until //ADC10 conversion complete, ADC12_ISR will force exit from any LPMx in //Mainloop on reti. //ACLK = n/a, MCLK = SMCLK = default DCO ~ 1.045MHz, ADC12CLK = ADC12OSC // //Uncalibrated temperature measured from device to devive will vary due to //slope and offset variance from device to device - please see datasheet. //Note:Use the TLV calibrated temperature to measure temperature// (the TLV CALIBRATED DATA IS STORED IN THE INFORMATION SEGMENT, SEE DEVICE DATASHEET) // //MSP430F5438A //----------------- ///|\|XIN|- //| || //--|RSTXOUT|- //|| //|A10| // //F. Chen //Texas Instruments Inc. //Dec. 2012 //Built with IAR Embedded Workbench Version: 5.51.1 & Code Composer Studio V5.2.1 //****************************************************************************** #include <msp430.h>#define CALADC12_15V_30C*((unsigned int *)0x1A1A)// Temperature Sensor Calibration-30 C//See device datasheet for TLV table memory mapping #define CALADC12_15V_85C*((unsigned int *)0x1A1C)// Temperature Sensor Calibration-85 Cunsigned int temp; volatile float temperatureDegC; volatile float temperatureDegF;int main(void) {WDTCTL = WDTPW + WDTHOLD;// Stop WDT/* Initialize the shared reference module */REFCTL0 |= REFMSTR + REFVSEL_0 + REFON;// Enable internal 1.5V reference/* Initialize ADC12_A */ADC12CTL0 = ADC12SHT0_8 + ADC12ON;// Set sample timeADC12CTL1 = ADC12SHP;// Enable sample timerADC12MCTL0 = ADC12SREF_1 + ADC12INCH_10;// ADC input ch A10 => temp senseADC12IE = 0x001;// ADC_IFG upon conv result-ADCMEMO__delay_cycles(75);// delay to allow Ref to settle// based on default DCO frequency.// See Datasheet for typical settle// time.ADC12CTL0 |= ADC12ENC;while(1){ADC12CTL0 &= ~ADC12SC;ADC12CTL0 |= ADC12SC;// Sampling and conversion start__bis_SR_register(LPM4_bits + GIE);// LPM4 with interrupts enabled__no_operation();// Temperature in Celsius. See the Device Descriptor Table section in the// System Resets, Interrupts, and Operating Modes, System Control Module// chapter in the device user's guide for background information on the// used formula.temperatureDegC = (float)(((long)temp - CALADC12_15V_30C) * (85 - 30)) /(CALADC12_15V_85C - CALADC12_15V_30C) + 30.0f;// Temperature in Fahrenheit Tf = (9/5)*Tc + 32temperatureDegF = temperatureDegC * 9.0f / 5.0f + 32.0f;__no_operation();// SET BREAKPOINT HERE} }#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__) #pragma vector=ADC12_VECTOR __interrupt void ADC12ISR (void) #elif defined(__GNUC__) void __attribute__ ((interrupt(ADC12_VECTOR))) ADC12ISR (void) #else #error Compiler not supported! #endif {switch(__even_in_range(ADC12IV,34)){case0: break;// Vector0:No interruptcase2: break;// Vector2:ADC overflowcase4: break;// Vector4:ADC timing overflowcase6:// Vector6:ADC12IFG0temp = ADC12MEM0;// Move results, IFG is cleared__bic_SR_register_on_exit(LPM4_bits);// Exit active CPUbreak;case8: break;// Vector8:ADC12IFG1case 10: break;// Vector 10:ADC12IFG2case 12: break;// Vector 12:ADC12IFG3case 14: break;// Vector 14:ADC12IFG4case 16: break;// Vector 16:ADC12IFG5case 18: break;// Vector 18:ADC12IFG6case 20: break;// Vector 20:ADC12IFG7case 22: break;// Vector 22:ADC12IFG8case 24: break;// Vector 24:ADC12IFG9case 26: break;// Vector 26:ADC12IFG10case 28: break;// Vector 28:ADC12IFG11case 30: break;// Vector 30:ADC12IFG12case 32: break;// Vector 32:ADC12IFG13case 34: break;// Vector 34:ADC12IFG14default: break;} }
Susan Yang:
回复 user5775225:
相关电路建议您参考
www.ti.com.cn/…/msp-exp430f5438
user5775225:
回复 Susan Yang:
我不觉得我的程序有什么问题啊 按下复位按钮 程序就会运行的很正常的啊 如果是程序问题 麻烦指出 拜托