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.
1.我用的是M430F149学习板
2.我用的是IAR编译环境,MSPFET烧录软件
我自己写了好久,就是写不成功,网上也找过例程了,实在是不会了,希望各位能出手帮帮我。
试试下面的code。再检查写Veref+的电路连接是不是正确
int main(void)
{
WDTCTL = WDTPW+WDTHOLD; // Stop watchdog timer
P6SEL |= 0x01; // Enable A/D channel A0
ADC12CTL0 = ADC12ON+SHT0_2; // Turn on ADC12, set sampling time
ADC12CTL1 = SHP; // Use sampling timer
ADC12MCTL0 = SREF_2; // Vr+ = VeREF+ (external)
ADC12CTL0 |= ENC; // Enable conversions
while (1)
{
ADC12CTL0 |= ADC12SC; // Start conversion
while ((ADC12IFG & BIT0)==0);
__no_operation(); // SET BREAKPOINT HERE
}
}