I have a piece of code I am having issues with and suspect it may have to do with the ADC and WPUs I am using. I am using a phototransistor to ground and attempting to read a relative value with an ADC input by using the WPU. Aside from one comment in the datasheet for the 12F615 about having a bunch of things cleared including the WPUs when a pin is setup for analog input I cannot find where it says it cannot be done. I configured the pin as an analog input and then right before I am doing the ADC measurement I put the wpu.4 = 1 in place which seems to bring the pin up but I am thinking it is skewing my ADC results. I don't have a display to display the output on the board it is so it is hard to tell. I will probably end up bringing the circuit to a breadboard to test but I am wondering if I have done a "no-no" and need to scrap the boards and order ones with external pull ups before doing anything else. Also, I have included OPTION_REG.7 = 0. Thanks in advance.
Bookmarks