先描述一下情况:我在做一个ADC12的使用,原先扫描的数据为32(行)*24(列)*50(帧),采用的ADC12配置为12位精度,采样256个时钟,序列单次扫描,代码如下:
P6SEL = 0x81; // Enable A/D channel A0/A7 ADC12CTL0 = ADC12ON+ADC12MSC+ADC12SHT0_8; ADC12CTL1 = ADC12SHP+ADC12CONSEQ_1+ADC12SSEL1 ; // Use sampling timer, single sequence // ADCCLK=MCLK,NO DIV ADC12MCTL0 = ADC12INCH_0; // ref+=AVcc, channel = A0 ADC12MCTL1 = ADC12INCH_7+ADC12EOS; // ref+=AVcc, channel = A1 ADC12IE = 0x02; // Enable ADC12IFG.1 ADC12CTL0 |= ADC12ENC; // Enable conversions;
以上代码未发现异常;
现在需要把他改成32(行)*24(列)*240(帧),因为以后实际用的是64(行)*32(列)*60(帧)的结构,以及预留;
于是我把ADC12精度改成8位,采样时钟设置成8个时钟;
配置代码如下:
P6SEL = 0x81; // Enable A/D channel A0/A7 ADC12CTL0 = ADC12ON+ADC12MSC+ADC12SHT0_1; ADC12CTL1 = ADC12SHP+ADC12CONSEQ_1+ADC12SSEL1 ; // Use sampling timer, single sequence // ADCCLK=MCLK,NO DIV ADC12CTL2 = ADC12RES_0; //选择AD分辨率,8位 ADC12MCTL0 = ADC12INCH_0; // ref+=AVcc, channel = A0 ADC12MCTL1 = ADC12INCH_7+ADC12EOS; // ref+=AVcc, channel = A1 ADC12IE = 0x02; // Enable ADC12IFG.1 ADC12CTL0 |= ADC12ENC; // Enable conversions
出现了以下现象:
当ADC12SHT0_x,即采样保持时钟,x<4时,明显观察到了干扰,即通道0的电平明显干扰到了通道1;
现在,想请教一下,是否有比较好的方法,能减少这种干扰呢?
谢谢
|