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.

[参考译文] MSP430F169:ADC 无法正常工作

Guru**** 2521930 points
Other Parts Discussed in Thread: MSP430F169

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/843111/msp430f169-adc-was-not-working

器件型号:MSP430F169

您好!

我为访问 MSP430F169的内部 ADC 编写了一个 c 代码。

这是我的代码。

void main (void)

unsigned int adc_count;

WDTCTL = WDTPW | WDTHOLD;//停止看门狗计时器

DCOCTL = DCO0 + DCO1 + DCO2;

BCSCTL1 = XT2OFF + DIV_3 + RSEL0 + RSEL1 + RSEL2;

BCSCTL2 = SELM_0 + DIVM_1 + DIVS_1;

P2DIR |= 0x01;//将 P1.0配置为输出

P6SEL |= 0x01;

ADC12CTL0 = ADC12ON + REF2_5V + REFON;

ADC12CTL1 = ADC12SSEL_0 + ADC12DIV_3;

ADC12MCTL0 = 0x90;

ADC12CTL0 |= ENC;

while (1)

ADC12CTL0 |= ADC12SC;

while (!(ADC12IFG & 0x0001));

ADC12MEM0;

P2OUT ^= 0x01;

但我没有得到 ADC A0中断标志、因此在 while 循环处停止执行。

我的配置是否正确?

谢谢

此致