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.

郁闷的MSP430 SD16

Other Parts Discussed in Thread: MSP430FE4252
void SD16_Test(void) //ADC �����ݵĸ�ʽ�Ƕ�ά����
{
 int i;
 SD16CTL |= SD16SSEL0 + SD16DIV_1; // 1.2V ref, SMCLK
 SD16CTL &=~ (SD16REFON + SD16VMIDON);//ʹ���ⲿ�IJο���ѹ
 for (i = 0; i < 500; i++); // Delay for 1.2V ref startup
 SD16INCTL0 |= SD16INCH_0 ;//+ SD16GAIN_32; // ����Ŵ�32�� ��˹ͨ���� ѹ������� ��IJ���Ϊ2MV/V 
 SD16CCTL0 |= SD16OSR_256 + SD16DF ;//+ SD16LSBACC ; // Enable interrupt DF���ģʽΪ
 SD16CCTL0 |= SD16GRP;//ADC0 ��ADC1 Ϊһ��
 SD16INCTL1 |= SD16INCH_0; // ��Դ��ѹ
 SD16CCTL1 |= SD16DF ;//SD16DF ; // Enable interrupt SD16OSR_32
 SD16CCTL1 |= SD16SC;
 ADC_Sum_1[0]=0;ADC_Sum_1[1]=0;
 for (i = 0; i < 128; i++)
 {
 while((SD16CCTL1&SD16IFG)==0);//�ȴ����ADCת��
 ADC_Sum_1[0] +=(int)SD16MEM0;
 ADC_Sum_1[1] +=(int)SD16MEM1;
 }
 SD16CCTL1 &=~SD16SC;
 ADC_Result_1[0] =ADC_Sum_1[0]>>7;
 ADC_Result_1[1] =ADC_Sum_1[1]>>7;
// if(ADC_Result_1[0]<0)
// ADC_Result_1[0]=0-ADC_Result_1[0];
 // printf("ADC0 %ld\n\r",ADC_Result_1[0]);
 // printf("ADC1 %ld\n\r",ADC_Result_1[1]);

}
之前问过很久这个问题了,没有好的解决,现在又要拿出来  哎  烦啊
现在的程序是按照书本上面的程序弄的 测量的时候就看着测量的值要么一直减少  要么就是一直增加,没有稳定过