This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

msp430f5529 adc 采集采集不到数据

Other Parts Discussed in Thread: MSP430F5529, DAC7512

我就想写一个最简单的adc采集程序 单通道的SC触发的

#include <msp430.h>
#include <msp430f5529.h>
/*
* main.c
*/
int main(void)
{
WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer
P1DIR |= BIT0;
P6SEL |= BIT0;
ADC12CTL0 = ADC12SHT0_2 + ADC12ON;
ADC12CTL1 = ADC12SHP;
ADC12IE = 0x01;//ADC12MEM0
ADC12MCTL0 = 0x0000;
ADC12CTL0 |= ADC12ENC;//enable ADC
_enable_interrupt();
while(1)
{
ADC12CTL0 |= ADC12SC;
}
}

#pragma vector = ADC12_VECTOR
__interrupt void ADC12()
{
if(ADC12MEM0>0x7ff)
P1OUT = BIT1;
else
P1OUT = 0x00;
}

调试后 ADC12MEM0 一直在 0xFFe和0xFF3之间跳动,无论把P6^0和P3^0相连还是P6^0和GND相连。