Hello. I have to read an analog signal and to convert it to a digital signal, but I just canīt get to do it. I know the adc has a 10-bit resolution right? Ok, so What bits are in adresh and wich ones are in adresl, and how cad a put that info in a port, say, portb. What is justified right and justified left? What does this mean? The analog signal goes from GND to Vdd (0V - 5V). So, in the Vref+ and Vref- should I have GND and Vdd?? I made a program but it does not work... hereīs the code. Please somebody help me yeah?

osccon = $50

ADCON1 = $0E
ADCON0 = $02
ADCON2 = $03
high adcon0.0

inicio:

if (portc.1 = 1 and portc.2 = 0) then
portb.0 = adresl.4 ; is this line right? I mean, is it valid to manage
portb.1 = adresl.5 ; the data this way? If so, how can I know
portb.2 = adresl.6 ; wich adres? to use?
portb.3 = adresl.7
else
if (portc.1 = 0 and portc.2 = 1) then
portb.0 = adresl.0
portb.1 = adresl.1
portb.2 = adresl.2
portb.3 = adresl.3
endif
endif

if adcon0.1 = 0 then
high adcon0.1
endif

goto inicio

uummm so... guess thatīs it. I will apreciate a lot any comment.

Best Regards.

Armando H.