ADC is not to bad once you get the feel for it. Bruce has good examples at his site www.rentron.com.
I do not have the data sheet for the chip you are using so I can not tell you how to set it up but it looks like your close.
Things I would change are to use binary for ADCON1 and TRISA. For example
In the data sheet there should be a table for ADCON1 telling how the bits are to be set.Code:ADCON1 = %00010111 TRISA = %11111111
Here is an example of the "old way" of doing it. Sometimes this works better than ADCIN. (more control I think).
Let us know how it goes.





Bookmarks