ASM lo,my sampling rate more than 8Khz....what u mean for resulution?? bro,maybe for u is easy ,but i am newbie,so i donno anything, and how to start to write a program. My project is using a music as input to control water pump on off, and led oso,i had dono the low pass for the music input,cut-off at 4khz.
Search through the Microchip app notes for A/D information. They will include source code. Also the PICkit2 debug express with 16F877A will include some A/D tutorials in it's manual. All free to download.