i solve my problem by observing the output of portC and portD (RD0 and RD1) where i connect a LED in all the pins and taking note of the output it produces with this program:
-----------------------
TRISA = 0xff
TRISC = 0x00
TRISD = 0X00
ADCON1 = 0x80 'Right Justified; All Ports are Analog Input or %10000000
ADCON0 = 0x41 'set Fosc/8; channel 0; ADON = 1 or %01000001
Dim output1 As Byte
Dim output2 As Byte
main:
ADCON0.2 = 1 'start A/D conversion
output1 = ADRESL
output2 = ADRESH
WaitMs 100
PORTC = output1
PORTD = output2
Goto main
-------------------------
after obtaining the output for every varied voltage level (e.g 0V = 00000000, 0.5V = 01100110... and etc) i then edit my program and insert some lines: (this is just part but it goes for 1.5V, 2V, 2.5V, 3V, and so on.)
main:
PORTC = 0x00 'setting all the led into logic 0
ADCON0.2 = 1 'start A/D conversion
output1 = ADRESL 'store the A/D result to output
output2 = ADRESH
'0.5V
If output1 = %01100110 And output2 = %00000000 Then (i use adresh output coz 0.5V and 3V has the same digital output in adresL)
PORTC = 0x01 'to get my desired output which is 001
Endif
If output1 = %11001101 Then '1V
PORTC = 0x02 ' 010
Endif
If output1 = %00110011 Then '1.5V
PORTC = 0x03
Endif
goto main
since i dont know how to set the resolution of the 877 i simple use this approach to attain my desired output.
btw, any comment from the expert about my codes.. i know it uses more lines but this is all i can do..