|
器件:G2452
程序:
unsigned int array[64];
ADC10CTL1 = INCH_3 + CONSEQ_2; // input A3, Repeat single channel
ADC10CTL0 = ADC10SHT_2 + MSC + ADC10ON + ADC10IE; // ADC10ON, interrupt enabled
ADC10AE0 |= 0x08; // PA.4 ADC option select
P1DIR |= 0x01; // Set P1.0 to output direction
P2DIR |= 0x01;
ADC10DTC0 = 0;
ADC10DTC1 = 64; //array size
ADC10SA = (unsigned int)&array;
ADC10CTL0 |= ENC + ADC10SC; // Sampling and conversion start
以上程序,在使用单次转换时,可以正常进入中断,改为连续转换时就无法进入中断。
程序可以对数组array更新,此时的寄存器状态为:
当将数组填充到64个时,期望进入中断(但没有),此时的寄存器为:
[ 本帖最后由 dontium 于 2013-7-24 16:26 编辑 ]
|
|