Hex to Decimal to Binary
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2011
    Location
    Los Angeles, California
    Posts
    322

    Default Hex to Decimal to Binary

    Hi All!
    Got a question about a pressure sensor I have been looking at. The spec sheet says the output range is 19A to E66 in hex. It also says that the resolution is 12 bit! If you take 19A hex and convert it to decimal you get 410. Take the same 19A and convert it to binary and you get 110011010, which is only 9 digits? If the resolution is 12 bit should there not be 3 more digits?


    Thanks, Ed
    Attached Images Attached Images

  2. #2
    Join Date
    May 2013
    Location
    australia
    Posts
    1,702

    Default Re: Hex to Decimal to Binary

    at last count it takes 12 binary digits to make $E66, i guess that if it can get a result of $e65 that's 1 digit different hence 12 bit resolution

  3. #3
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,258

    Default Re: Hex to Decimal to Binary

    Hi Ed,
    Your ordinary PIC ADC has a resolution of 10 bits. Yet, when it returns a result of 5 and you convert that to binary and you get 101, that's only three bits.....what's up with that?

    Max reading from your sensor is 0xE66, Min reading from your sensor is 0x19A. 0xE66-0x19A=0xCCC which in binary is 1100 1100 1100 - 12bits. Strictly speaking I'd say the resolution is somewhere between 11 and 12bits.

    /Henrik.

  4. #4
    Join Date
    Mar 2011
    Location
    Los Angeles, California
    Posts
    322

    Default Re: Hex to Decimal to Binary

    Thanks!
    I guess it makes sense now.

    Best, Ed

Similar Threads

  1. Binary Coded Decimal
    By -Dan- in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 25th May 2009, 09:23
  2. How to convert binary to decimal?
    By Cabomba in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 13th October 2007, 01:27
  3. Decimal to Binary Conversion
    By schlaray in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 23rd December 2006, 14:58
  4. Binary to Decimal from ADC
    By RYTECH in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 27th July 2005, 18:51
  5. Decimal to binary conversion
    By Demon in forum Code Examples
    Replies: 9
    Last Post: - 25th February 2005, 20:05

Members who have read this thread : 2

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts