Hello all,
I seem to be having a problem with a 28X2 (5 volt version, B.0 firmware) and analog inputs.
I have tried this with 2 different chips but don't seem to get what I think I should get.
I have a simple program that reads ADC0(leg2) of the 28X2 and display it on an LCD. I use:
INPUT A.0
ADCSETUP = 1
in the beginning of the code to set ADC0 to be an analog input. With nothing attached to the pin, I read 4.7 volts. With a 1k resistor attached to the leg and ground I still read 0.12 volts. When I use two 1k resistors as a voltage divider to give 2.58 volts on the pin, the bit count for READADC10 is 667. Chip voltage (Vref) is 5.03 so bit count should be 524.
Am I setting the ADC up correctly? The manual states that ADCSETUP is actually used to disconnect the digital workings so that "the internal digital input circuitry does not affect the analogue reading". So I am wondering if it is set right from the beginning.
I have searched the forum for past issues but have not found anything that sounds like this issue.
I have used 20X2s with ADCs without a problem. They use individual masking where the 5volt version of the 28X2 uses sequential masking. So maybe it is a set up issue.
Any input will be welcome.
Dave E
I seem to be having a problem with a 28X2 (5 volt version, B.0 firmware) and analog inputs.
I have tried this with 2 different chips but don't seem to get what I think I should get.
I have a simple program that reads ADC0(leg2) of the 28X2 and display it on an LCD. I use:
INPUT A.0
ADCSETUP = 1
in the beginning of the code to set ADC0 to be an analog input. With nothing attached to the pin, I read 4.7 volts. With a 1k resistor attached to the leg and ground I still read 0.12 volts. When I use two 1k resistors as a voltage divider to give 2.58 volts on the pin, the bit count for READADC10 is 667. Chip voltage (Vref) is 5.03 so bit count should be 524.
Am I setting the ADC up correctly? The manual states that ADCSETUP is actually used to disconnect the digital workings so that "the internal digital input circuitry does not affect the analogue reading". So I am wondering if it is set right from the beginning.
I have searched the forum for past issues but have not found anything that sounds like this issue.
I have used 20X2s with ADCs without a problem. They use individual masking where the 5volt version of the 28X2 uses sequential masking. So maybe it is a set up issue.
Any input will be welcome.
Dave E