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.

关于CC2530ADC采样的问题

Other Parts Discussed in Thread: CC2530

使用CC2530AD采样外部电压折腾了一天都没有结果,不知道哪里有问题,求高人指点

具体程序:

void main(void)
{

uint value;
CLKCONCMD = 0x80;
while(CLKCONSTA&0x40);
P0SEL|=0x01;
P0DIR=0xfe;
APCFG|=0x01;
ADCIF = 0;
ADCCON3=0x30;
ADCCON1|=0x30;
ADCCON1|=0x40;
while(!(ADCCON1 & 0x80));
value = ADCL >> 4;
value |= (((uint)ADCH) << 4);
Value =(float)(Value/(float)2048)*1.25;

}

刚开始接触CC2530没多久,还不是很明白,如果有例程就好了。