10Bit ADCIN into 8-Bit WORD?


Closed Thread
Results 1 to 4 of 4

Hybrid View

  1. #1
    Join Date
    Jul 2008
    Posts
    5

    Default 10Bit ADCIN into 8-Bit WORD?

    Clarify for me, please: I use: "DEFINE ADC_BITS 10" to indicate I'm going to read an analogue value with 10 bits, then later use "ADCIN 2, J_MidPnt", when the value is put into a variable "J_MidPnt" which had been declared a VAR of type WORD. I thought WORDs were 8-bits... What happens to the other two bits? I'm a confused NewBe (Obviously) Thanks!!!!

  2. #2
    sinoteq's Avatar
    sinoteq Guest


    Did you find this post helpful? Yes | No

    Default

    How about if a BYTE is 8 bits and a WORD is 16 bits. Would that make things easier? Now you are so lucky because a WORD is actually 16 bits and you are now less confused.

  3. #3
    Join Date
    Jul 2008
    Posts
    5


    Did you find this post helpful? Yes | No

    Default Thanks!

    Immediate accurate information. You gotta love it. Thanks!

  4. #4
    sinoteq's Avatar
    sinoteq Guest


    Did you find this post helpful? Yes | No

    Default

    Just make sure you use the LOW 10 bits of the Word variable, or you will get really funny results. There is a function in the PIC that makes the ADC result left or right justified but maybe you have found this already?

Similar Threads

  1. Bits, Bytes Words and Arrays
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 24
    Last Post: - 14th June 2016, 07:55
  2. Read/Write Problem
    By Tobias in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 10th February 2010, 01:51
  3. Minimizing code space
    By Tobias in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 30th May 2009, 07:25
  4. DS2760 Thermocouple Kit from Parallax in PicBasicPro
    By seanharmon in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 8th July 2008, 23:19
  5. calculation problem
    By nicolelawsc in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 31st March 2006, 15:23

Members who have read this thread : 1

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