A/D on 16F877. How fast can I go?


Closed Thread
Results 1 to 3 of 3
  1. #1
    atomski's Avatar
    atomski Guest

    Question A/D on 16F877. How fast can I go?

    Hello,

    Just a quick question. I need to run all
    8 channels in A/D mode pretty fast.
    Also, I need to compare all returned
    values and choose the one with the
    highest result. But there's a catch. I
    need to be able to define the offset
    (hysteresis) between the values I'm
    comparing. For example if ch1 is
    giving the reading 20% higher than
    ch3 PIC should choose ch1 value for
    further processing. Now with all this
    I'm concerned with timing. I need to
    read 8 ch, do at least 5 measurements,
    average them and compare, choose
    the highest value, and make a certain
    pin high. All that within 50mS or less
    (preferable). While reading the posts
    in the archives I bumped into one of
    Melanie's posts about ADC that
    caught my attention. She said that she
    prefers using direct addressing for
    ADC to ADCIN, especially when
    using interrupts. My question is is
    this method any faster and how fast
    can I really go with ADC without
    getting garbage from it? Anyone?

    --
    Sincerest regards,

    YZ7REA Vladimir M Skrbic
    4N7ATV Repeater Administrator
    YU7GHZ Radio Club President

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    You should easily be able to read an ADC in well under 100uS (subject to input capacitances). After reading eight inputs, that leaves you 49mS to do your calculations. Enough time for at least a full Continental Breakfast and a couple of Coffee's as well!

    It's so simple to read ADC's directly and have total and complete control, that I find ADCIN quite unnescessary and if anything a hinderance. I think it's really included for the convenience of those who are afraid of accessing a PIC's internals directly.

    Melanie

  3. #3
    atomski's Avatar
    atomski Guest


    Did you find this post helpful? Yes | No

    Post

    Mel,

    Thanks for the reply. I will certainly give
    it a try with direct ADC control. I 'll have
    to give it a good shake before I figure
    out how to do all the averaging and
    comparing of the values within the
    variables in order to process the one
    with the highest value, though. The
    hysteresis between the values has to
    be a variable too, so I can change it for
    fine tuning and for eliminating all the
    transients on analog channels that will
    most certainly occur.

    --
    Sincerest regards,

    YZ7REA Vladimir M Skrbic
    4N7ATV Repeater Administrator
    YU7GHZ Radio Club President

Similar Threads

  1. PIC 16f877 A/D conversion Allegro ACS712
    By DavyJones in forum General
    Replies: 32
    Last Post: - 4th June 2011, 04:54
  2. Fast / low resolution A/D conversion
    By AndrewC in forum General
    Replies: 7
    Last Post: - 7th April 2009, 12:18
  3. 12F675 A/D and GPIO sleep interrupt
    By macinug in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 8th September 2008, 14:39
  4. 16f877 A/D help
    By 3adam in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 25th January 2008, 04:06
  5. A/D converter fails?
    By egberttheone in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 13th February 2006, 18:57

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