Need help with 16f819 10 bit ADC


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    Join Date
    Apr 2005
    Posts
    96


    Did you find this post helpful? Yes | No

    Default

    Don't you need to change your command to ADCIN 4, adval to get AN4?

    I personally have been using Melanies direct method reading analog values that can be seen in this thread

    http://www.picbasic.co.uk/forum/show...ghlight=adcon0

    Its pretty straight forward and I can understand what is going on.

  2. #2
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    237


    Did you find this post helpful? Yes | No

    Post

    Defines should be in uppercase.

    DEFINE ADC_BITS 10
    DEFINE ADC_CLOCK 3
    DEFINE ADC_SAMPLEUS 50

  3. #3
    bannrikae's Avatar
    bannrikae Guest


    Did you find this post helpful? Yes | No

    Default

    Thanks modifyit, I'll try this when I get back to work on Monday and let you know how I get on.

    Ingvar, I didn't think these were case sensitive, it worked OK lower case for 8 bit ADC but I will also try this on Monday.

    Thanks both.

  4. #4
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    237


    Did you find this post helpful? Yes | No

    Post

    Your defines didn't do anything atall since they were the default values.

  5. #5
    bannrikae's Avatar
    bannrikae Guest


    Did you find this post helpful? Yes | No

    Default

    So if they are default values Then shouldn't the prog work?
    The rest of the code works when set up for 8 Bits, can't see what else is wrong, confused!.

    BG

  6. #6
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    237


    Did you find this post helpful? Yes | No

    Post

    It worked before you changed it to 10 bits. 8 bits is default. That's why it worked even though you wrote the defines in lowercase.

  7. #7
    bannrikae's Avatar
    bannrikae Guest


    Did you find this post helpful? Yes | No

    Default

    OK ingvar, see what your saying, will try as soon as I get the time,
    (work gets in the way of projects)

    Thanks

    BG

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. 10 bit ADC display on LCD using 16f873
    By pr2don in forum mel PIC BASIC
    Replies: 3
    Last Post: - 6th March 2010, 18:29
  3. Sleep Mode
    By Pesticida in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 13th March 2008, 10:31
  4. PICBasic newbie problem
    By ELCouz in forum mel PIC BASIC Pro
    Replies: 32
    Last Post: - 12th February 2008, 00:55
  5. USART interrupt not interrupting right
    By Morpheus in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 6th March 2005, 01:07

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