I'm using the PIC16F877 and was using a 0-5VDC power supply to input a known value into the A/D. At 2.5 volts it returned from 295-305, not too bad of variance, but at 5 volts it returned values that ranged from 590s- 790s. That's way too much bouncing.
First question, how do I get the higher values to be more stable?
Second question, if it's a 10 bit A/D, shouldn't a 0V input return a 0 reading, and a 5V input return a 1024 reading? If 10 bit means 2^10 = 1024.
As far as hardware hooked up I was using a 1k resistor between the power supply and the chip to limit the current.
I tried using the A/D in polling on a couple of tries as well as the interrupt mode a couple times after that. What's the proper order of steps in getting the A/D to work properly, maybe I have a step out of order.
It mentions something about an acquisition time before it translates the input value. I inserted a delay between the ADC Wait statement and the ADC store statement is this a needed or a bad thing?
I've seen some people mention that to return a stable value in all ranges that an external ADC chip is far better than the one on the PIC. Is this true, does the PIC one normally wander like this? The A/D is the only real reason why I'm using the 877, that and for the memory. But, if I'm going to have to use an external ADC then I'm sure I could probably get a smaller PIC.
Any help would be very much appreciated.
First question, how do I get the higher values to be more stable?
Second question, if it's a 10 bit A/D, shouldn't a 0V input return a 0 reading, and a 5V input return a 1024 reading? If 10 bit means 2^10 = 1024.
As far as hardware hooked up I was using a 1k resistor between the power supply and the chip to limit the current.
I tried using the A/D in polling on a couple of tries as well as the interrupt mode a couple times after that. What's the proper order of steps in getting the A/D to work properly, maybe I have a step out of order.
It mentions something about an acquisition time before it translates the input value. I inserted a delay between the ADC Wait statement and the ADC store statement is this a needed or a bad thing?
I've seen some people mention that to return a stable value in all ranges that an external ADC chip is far better than the one on the PIC. Is this true, does the PIC one normally wander like this? The A/D is the only real reason why I'm using the 877, that and for the memory. But, if I'm going to have to use an external ADC then I'm sure I could probably get a smaller PIC.
Any help would be very much appreciated.