I never did like ADCIN. Take a look at this thread. It may help.
http://www.picbasic.co.uk/forum/show...9694#post79694
I never did like ADCIN. Take a look at this thread. It may help.
http://www.picbasic.co.uk/forum/show...9694#post79694
Dave
Always wear safety glasses while programming.
Thanks Dave, its working now with your method.
still wandering why the button command do not work.
Hi,
I added a 1uF capacitor to the analog pin, hoping it would stabilize the voltage. I am measuring a 12v battery, using a 80Mohm and a 16Mohm divider. I am reading about 2.2v on the pin, but the output oscillates between 425, 429, 433. which seems to be a lot. any other things I can do to stabilize the output ? (hardware) I am also thinking of taking an average of the last three inputs..
K
Hi , I added these lines: but it still fluctuates a lot:
then I output the ChAN_AVG
Code:GOSUB READ_AD CHAN4_2 = CHAN4_1 CHAN4_1 = CHAN4 CHAN4.HighByte = ADRESH 'PLACES THE HIGH AND LOW BYTE CHAN4.LowByte = ADRESL 'INTO VAR CHAN0 CHAN_AVG = (CHAN4_2 + CHAN4_1 + CHAN4 ) /3 RETURN
On similar apps I use a 22uF cap from the ADC pin to VSS.
How stable is VDD?
Dave
Always wear safety glasses while programming.
I use a 7805 with a 1uF cap and a 47uF cap on the adc pin
K
I believe your problem is this "80Mohm and a 16Mohm divider".
See section 21.1 in 18F4550 spec sheet.
It says the maximum recommended impedance for analog
sources is 2.5 kΩ.
Bookmarks