为什么我在IDE 7.62 模拟仿真时总是出现下面的警告,是什么意思?怎样解决? ADC-W0008: No stimulus file attached to ADRESL for A/D. int ADConvt(unsigned char channel) // ADC sample sub-routine {
unsigned char i; // counter union{ unsigned int temp; unsigned char dt[2]; }ad;
static int adc_result; for(i=1, adc_result=0x0000; i<=16; i++) { __disable_interrupt(); ADCON0=0; ADCON0 = 0x81; ADCON0 |= (channel<<2); // select ADC channel asm("NOP"); asm("NOP"); asm("NOP"); asm("NOP"); asm("NOP"); asm("NOP"); GO=1; // start ADC while(GO) continue; // wait ADC sample complete ad.dt[0]=ADRESL; ad.dt[1]=ADRESH; // store ADC result adc_result +=(int)ad.temp; } ADON =0; // Stop ADC return (adc_result/16); }
|