Hi everyone, got a little problem with the adc module on a pic 16f873A.
Basically I'm trying to use 2 channels of the adc module, 0 and 1. Channel 0 works fine, however all the other channels pull the analogue signal down. (i.e 0v, even if the sensor is putting out a voltage). If I remove the pic, the voltage level is what the sensor outputs, if i plug the pic in, it is then tied down.
Channel 0 works fine, channel 1 onwards pulls the signal down.
I beleive the problem is a misconfiguration of the chip, as the circuit is fine (when the pic isn't connected anyway) and I have absolutely no problems whatsoever in using the first adc channel (0).
I am using MikroC if this helps and this is my configuration:
TRISA = 1 (all port A as input)
ADCON0 = 11001001 (set adc on, set channel to '1')
ADCON1 - (last four bits set to 0) - all channels set to analog.
Now these two are the only registers that set up the adc module (ignore the adresult high and low registers), so I'm not sure what could be wrong.
Any ideas? It's a daft problem really.
cheers
Basically I'm trying to use 2 channels of the adc module, 0 and 1. Channel 0 works fine, however all the other channels pull the analogue signal down. (i.e 0v, even if the sensor is putting out a voltage). If I remove the pic, the voltage level is what the sensor outputs, if i plug the pic in, it is then tied down.
Channel 0 works fine, channel 1 onwards pulls the signal down.
I beleive the problem is a misconfiguration of the chip, as the circuit is fine (when the pic isn't connected anyway) and I have absolutely no problems whatsoever in using the first adc channel (0).
I am using MikroC if this helps and this is my configuration:
TRISA = 1 (all port A as input)
ADCON0 = 11001001 (set adc on, set channel to '1')
ADCON1 - (last four bits set to 0) - all channels set to analog.
Now these two are the only registers that set up the adc module (ignore the adresult high and low registers), so I'm not sure what could be wrong.
Any ideas? It's a daft problem really.
cheers