Hi
I have got the 8 bit value from the adc and need it to give me 10 readings over the 0 to 5 volt analog input. At the moment i am xoring it with known values but i need to read all the values upto each known value. I cant do this 255 times it would be to long surely.If anybody could point me in right direction
You can use subwf to compare two 8 bit numbers. Throw away the result, and check the C flag in the STATUS register to see if one is lower than the other. The Z flag in the STATUS register will tell you if they are equal.
Different example from Gayan's if his wasn't clear enough for you:
Code:
movlw .25 ;Number to compare ADRESH to.
subwf ADRESH, W
btfss STATUS, C
goto less ;ADRESH less than 25
;Skip to here if ADRESH greater than or equal to 25
Thanks a lot all you guys tried it tonight and it works very well reads all the values inbetween exactly what i wanted it was made simple thanks for your help.
Regards
bee