I see that I used dim a/d reading as WORD so i guess that converts it to 16bit?
but i see when my ascii number in hyperterminal gets over 254 it makes a jump, and when it gats under 100 it jumps also, I seen that in the bin2ascii there is different equations for the number based on the value? are one of these wrong?
I need a number to hyperterminal that is linear and is 0v=0 and 5v= x and 2.5v=x/2 so that i can use one calculation on it to find the voltage.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Using the readad function generates an 8 bit result. You only need a byte variable with that function. If you want 10 bits, there is a recently added function (I believe readad10), that will return the full 10 bits using a word variable. Search the forums for this, or look at the code in the lowlevel directory (a-d.h) to see how it works.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The READAD10 function was patched shortly after above example, for the low pin count devices like the 12f675, in the update zip file here: http://gcbasic.sourceforge.net/update.html
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Is the a/d reading form the pic in 10bit mode then useing Bin2Ascii a linear number ex. 0v=0, 2.5v= 512, 5.0v= 1024?
I see that I used dim a/d reading as WORD so i guess that converts it to 16bit?
but i see when my ascii number in hyperterminal gets over 254 it makes a jump, and when it gats under 100 it jumps also, I seen that in the bin2ascii there is different equations for the number based on the value? are one of these wrong?
I need a number to hyperterminal that is linear and is 0v=0 and 5v= x and 2.5v=x/2 so that i can use one calculation on it to find the voltage.
Using the readad function generates an 8 bit result. You only need a byte variable with that function. If you want 10 bits, there is a recently added function (I believe readad10), that will return the full 10 bits using a word variable. Search the forums for this, or look at the code in the lowlevel directory (a-d.h) to see how it works.
Full working example found here:
https://sourceforge.net/forum/message.php?msg_id=5151113
The READAD10 function was patched shortly after above example, for the low pin count devices like the 12f675, in the update zip file here:
http://gcbasic.sourceforge.net/update.html