Setting Up Adc Ports


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default

    If I may put my 2 cents in here, I use A/D converters all the time. However, I don't "set up" anything except tell the device to turn all A/D ports to digital on boot. On 12F675 I use ANSEL = 0. On 16C72A, 16F72 and 16F818, I use ADCON1 = 7. Then, I simply use the ADCIN command and it works every time for a 0-255 reading. ADCIN 0, X will read ANA0 and put value into BYTE variable X. And if Anyone here knows why I shouldn't do it this way, please let me know. Thank you. - Peter

  2. #2
    GEEZER's Avatar
    GEEZER Guest


    Did you find this post helpful? Yes | No

    Default Thanks

    Thanks for the input guys. Peter, I am glad it is working out so easily for you.

    I have it running now. I just ignored ADCON0 and set ADCON1 and 2. I think I know what i did to turn on 4 of the ports i need right now. We'll see how smart i am when i need to turn on the next 4.

    Thanks again, I get a lot of help and good ideas from the forum.

    The Geezer

  3. #3
    Join Date
    Mar 2005
    Location
    Iowa, USA
    Posts
    216


    Did you find this post helpful? Yes | No

    Post

    Quote Originally Posted by peterdeco1
    if Anyone here knows why I shouldn't do it this way, please let me know. Thank you. - Peter
    More than one way to skin a cat. Sure the ADCIN command can be used and probably work just fine, and get him up and going quickly. I like using the ADC registers directly to understand what's all involved. Which from Geezer's post, I was under the impression he was after this as well. Other people also do this for speed and efficiency. Instead of telling someone to RTFM... I try to point them in the direction of examples and where to look in the manual to learn what they are after. Just a personal preference. Glad you got your project going Geezer... and hopefully you have a better understanding of the ADC module.

Similar Threads

  1. PICKit2 - warning about configuration words
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 26
    Last Post: - 4th August 2009, 14:01
  2. Setting I/O ports on 16f629
    By Optech in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 24th January 2008, 21:51
  3. Setting Address via ADC
    By breesy in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 14th October 2007, 14:33
  4. Setting up ADC....
    By robertmark68 in forum General
    Replies: 1
    Last Post: - 11th August 2006, 18:08
  5. Problem reading multiple ADC ports
    By jswayze in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 4th November 2004, 16:46

Members who have read this thread : 0

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