Stable ADC readings


Results 1 to 40 of 91

Threaded View

  1. #11
    Join Date
    Jul 2010
    Posts
    19


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Acetronics View Post
    Hi,

    What about reinitialise your Wsum value to 0 @ each 50 samples batch ??? don't you run this loop in another continuous loop ... ???

    Alain
    Oh I do. I left that part out of the code I pasted, but it is indeed running in an outside continuous loop.

    Code:
    PinProbe VAR PORTA.2
    ...
    myLoop:
    
    WSum = 0
    Pause 100
    
    For i = 0 to 49
    ADCIn PinProbe, W0
    Pause 10
    WSum = WSum + W0
    Next i
    
    W0 = WSum / 50
    ...
    LCDout $fe, 1 'Clear Screen
    Lcdout $fe, $80
    Lcdout "Reading: ", DEC W0
    
    Goto myLoop
    The readings I get with the ADCIN method are in the ballpark but move around too much. With the "manual" ADC method I get a stable value.
    Last edited by dream-; - 22nd January 2011 at 18:15.

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