|
msp430g2553中ADC10 DTC怎么搞啊
[复制链接]
#include "msp430g2553.h" int data1[32]={0}; void main(void) { WDTCTL = WDTPW + WDTHOLD; //关看门狗 BCSCTL1 = CALBC1_1MHZ; //设定DCO为1MHZ DCOCTL = CALBC1_1MHZ; P1DIR=0XFF; P1OUT=0X00; P1SEL |= BIT2;//1.2为模拟输入 ADC10CTL1|=INCH_2+SHS_0+ADC10DIV_7+ADC10SSEL_2+CONSEQ_2; //10通道,ADC10SC触发,8分频,时钟为MCLK,单通道多次 ADC10CTL0|=SREF_1+ADC10SHT_3+MSC+REF2_5V+REFON+ADC10IE+ADC10ON; //内部参考源,采样保持时间64个ADC10CLKs,置MSC位,开内部参考源,2.5V,中断允许,启动ad10; ADC10DTC1=0X20;//20次采样 ADC10SA=*data1;//DTC首地址 ADC10CTL0|=ENC+ADC10SC;//使能ad,触发采样 _EINT(); while(1); } #pragma vector=ADC10_VECTOR __interrupt void ADC10_ISR(void) { ADC10CTL0&=~ENC; P1OUT=0XFF; } 求解啊 为什么我这么设置不可以进入中断啊 怎样设置才能进行单通道多次转换啊 ,还有DTC到底怎么用啊
|
|