bjweatherford
New Member
I'm am attempting to use a PIC16F88 to read an analog voltage from a 5K POT and display it on an LPC screen. Input voltage is 5V so 0V - 5V would read 0000 - 1023 on the LCD. I have it mostly working. The A2C conversation seems to working properly and the writing to LCD looks good but when I vary the pot resistance, the reading is not linear at all.
When the output of the pot is ~0V, my LCD reads 0000 and when the output of my pot reads ~5V my LCD reads 1023. However... If I start from 0V and begin to open the pot, the reading on the LCD begins to creep up just to ~0050, then just before the pot is wide open the number quickly count up to 1023.
When I unplugged the pot output to the PIC, it operates as expected and I verified it with a voltmeter....and I've tried 2 pots and get the same result.
As an experiment, I adjusted the pot so that its half way (2.5K output to GND, and 2.5K output to VDD). If i disconnect the wire connected from the wire pot to the PIC16F688, I measure ~2.5V on a volt meter. As soon as I connect the wire to the PIC16F688, my voltage measures almost 0V. It's almost as if something internal to the PIC16F688 is pulling the voltage down.
Is this behavior expected or could there be something hanging on this when its enabled as an analog input.
Any thoughts?
Thanks,
Bryan
When the output of the pot is ~0V, my LCD reads 0000 and when the output of my pot reads ~5V my LCD reads 1023. However... If I start from 0V and begin to open the pot, the reading on the LCD begins to creep up just to ~0050, then just before the pot is wide open the number quickly count up to 1023.
When I unplugged the pot output to the PIC, it operates as expected and I verified it with a voltmeter....and I've tried 2 pots and get the same result.
As an experiment, I adjusted the pot so that its half way (2.5K output to GND, and 2.5K output to VDD). If i disconnect the wire connected from the wire pot to the PIC16F688, I measure ~2.5V on a volt meter. As soon as I connect the wire to the PIC16F688, my voltage measures almost 0V. It's almost as if something internal to the PIC16F688 is pulling the voltage down.
Is this behavior expected or could there be something hanging on this when its enabled as an analog input.
Any thoughts?
Thanks,
Bryan