Menu

A/d conversion

Help
2008-10-07
2013-05-30
  • Nobody/Anonymous

    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?

     
    • Nobody/Anonymous

      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.

       
    • Nobody/Anonymous

      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.

       
    • kent_twt4

      kent_twt4 - 2008-10-10

      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

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.