You missed the following from that post...
Code:
Sensor = (Sensor & $FFF) * 5000
The AND with $FFF masks out the unused bits. The multiply by 5000 is to scale it to 5V, so you can skip that part.
Look at the diagram in post #4 of that thread and you'll see that the first few bits of data are invalid. To be honest it looks to me like even that code from Darrel isn't quite right since it also shows getting a duplicate B1 bit into the LSB. I would think the result should be shifted right by 1 before doing the AND.
I don't think your original problem with the pic ADC had anything to do with the internal adc being inaccurate so none of this may help much. You say it worked fine until you put it into the vehicle. That should be a clue.
Bookmarks