Stable Adc Reading Routine


Results 1 to 28 of 28

Threaded View

  1. #1
    Join Date
    Oct 2005
    Posts
    18

    Default Stable Adc Reading Routine

    Dear friends

    Recently I came across an AVR application note about an intelligent charger
    design based on their controller line.
    There was a so called STABLE ADC READING FUNCTION
    (not explained in detail ) which was used for getting valid ADC readings.
    The following is copy-paste from there.
    .................................................. ..................
    void stable_ADC(void)
    The stable_ADC function is used when measuring battery
    voltage or temperature. It makes sure the ADC values are
    stable inside a defined area. This is important for an accurate
    measurement. The function loops until it gets three
    ADC values where the highest is no more than one step
    higher than the lowest.
    .............................................
    There was a pseudo c flowchart but I was not able to follow it through.
    stable_ADC

    |----------------- V[0] > V[1]+1 No ----------------------------- > return
    | Yes
    | V[5] = V[4]
    | V[4] = V[3]
    | V[3] = V[2]
    | Start ADC
    | ADC done? No ------>-continue conversion
    | Yes
    | V[2] = ADC
    | V[1] = highest value of V[2] to V[5]
    | V[0] = lowest value of V[2] to V[5]
    | |
    | |
    -----------------------
    I wonder if someone can help in implementing this for picbasic as I would like to
    use it in order to improve ADC readings on a PIC12F675 .
    At the moment I am adding 64 consecutive values in order to approximate a 16
    bit result and by floating point math to end up to my final reading which is not
    very stable.

    Bill
    Last edited by gebillpap; - 4th February 2008 at 22:42.

Similar Threads

  1. Reading A Photo Resistor using ADC
    By jessey in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 25th January 2007, 09:28
  2. adc reading ac
    By Ruben Pena in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 20th December 2005, 21:57
  3. 12F675 ADC 'Issues'
    By harrisondp in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 31st March 2005, 01:55
  4. Problem reading multiple ADC ports
    By jswayze in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 4th November 2004, 16:46
  5. Reading multiple ADC channels FAST
    By lwindridge in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 21st April 2004, 22:37

Members who have read this thread : 4

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