请问选择单次采样,采样完成后怎么再次启动采样,channel选的是on-chip temperature sensor。
还有就是单次采样与连续采样比较有什么优缺点吗?谢谢指导。。。
还有就是每次读取的值都是上一次的转换结果吗?
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.
请参考
unsigned int adc_result; APCFG=0x80;///adc=p0.7 ADCCON1=0x33; ADCCON3=0xbe;///参考电压为电源 温度通道 12位 实际效果为11位!!!!!!!!!!! ADCCON1 |= 0x40;///start adc while( !(ADCCON1 & ADCCON1_EOC));///等待转换完成 adc_result = (ADCL >> 4); adc_result |= (ADCH << 4);
unsigned int adc_result;
/// APCFG=0x80;///adc=p0.7
ADCCON1=0x33;
ADCCON3=0xbe;///参考电压为电源 温度通道 12位 实际效果为11位!!!!!!!!!!!
ADCCON1 |= 0x40;///start adc
while( !(ADCCON1 & ADCCON1_EOC));///等待转换完成
adc_result = (ADCL >> 4);
adc_result |= (ADCH << 4);
有补充
unsigned int adc_result;
/// APCFG=0x80;///adc=p0.7
ADCCON1=0x33;
ADCCON3=0xbe;///参考电压为电源 温度通道 12位 实际效果为11位!!!!!!!!!!!
TR0=1;///测量内部温度需要打开的
ATEST=1;///测量内部温度需要打开的
ADCCON1 |= 0x40;///start adc
while( !(ADCCON1 & ADCCON1_EOC));///等待转换完成
adc_result = (ADCL >> 4);
adc_result |= (ADCH << 4);