I'm having some issues turning on more than a single ADC input, Ive been using the code below.
Now I know im missing some ansel, adcon or something to enable the extra inputs, right now the extra inputs are eratic/off, they dont take readings right.Code:DEFINE ADC_BITS 10 ' A/D number of bits DEFINE ADC_CLOCK 1 ' Use A/D internal RC clock DEFINE ADC_SAMPLEUS 50 ' Set sampling time in us RES1 Var Word ' A/D converter result RES2 Var Word ' A/D converter result RES3 Var Word ' A/D converter result AGAIN: ADCIN 0, Res1 ' Read Channel 0 data ADCIN 1, Res2 ' Read Channel 1 data ADCIN 2, Res3 ' Read Channel 2 data res1 = res1 /256 res2 = res2 /256 res3 = res3 /256 'Display all 3 ADC results on LCD Pause 100 goto again end
as long as i stay with ADCIN 0 thers no problem, but I need to take readings on more pins. and am confused on these extra settings, any ideas would be great. also i havent learned to do the fuse settins for freq, brounout, mclre ect, so if possible leave that stuff out of code for right now.
BTW using a 18F4550


 
			 
			 
			 
					
					 Help with multiple ADC inputs
 Help with multiple ADC inputs
		 
				
				
				
				
			

Bookmarks