DT Average


Closed Thread
Results 1 to 4 of 4

Thread: DT Average

  1. #1
    Join Date
    Apr 2009
    Location
    Boise, Id
    Posts
    44

    Question DT Average

    I found a post about an average routine that Darrel Taylor built but the link to the code was broke so I checked his website but didn't find it there either. Is that still available? I searched using forum and code samples, but didn’t find any other reference to it.

    I’m doing an A/D conversion about 50 times per second, I need a way to get an hourly average of the samples. I’m not sure of the limits of DT’s routine so any other idea’s are welcome. I’ve been using DT interrupts and timer, those have worked great, so I have a feeling the averaging routing will be what I need.

    Thanks,
    Shane

  2. #2
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default Re: DT Average

    If every sample has equal weight, why not just add all the samples together and divide by 50*60*60 = 18000. The sum could be no larger than 1023 * 180000.

    You can use LONGs to handle that.

    Now don't tell me that you are one of those guys using 16Fs...
    Charles Linquist

  3. #3
    Join Date
    Apr 2009
    Location
    Boise, Id
    Posts
    44


    Did you find this post helpful? Yes | No

    Default Re: DT Average

    I'm using an 18LF2550, I should be able to use LONG's, seems like I had issues with LONG's at one time, that was many lines of code about two years ago...in a galaxy far away. I'll give it a try, see if I figure out why I was avoiding using longs.

    Thanks for the Idea.
    Shane

  4. #4
    Join Date
    Apr 2009
    Location
    Boise, Id
    Posts
    44


    Did you find this post helpful? Yes | No

    Default Re: DT Average

    I used LONG without any issue, I still need to refine my code.
    Thanks for the help.
    Shane

Members who have read this thread : 2

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