Searching \ for '[PIC]: Averaging 10 16bit values? !' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/microchip/devices.htm?key=pic
Search entire site for: 'Averaging 10 16bit values? !'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: Averaging 10 16bit values? !'
2001\04\28@100709 by Graham North

picon face
Hi,

Now that I have got my interupts working I have quite a task infront of me.

I am taking 10 readings with a 16bit A/D, and then have to average this
reading.

Has anyone ever done this?

What would people suggest as the fastest/most efficient way to do this?

The 16 bit results are currently in straight binary, but could be in 2scomp
if that would make the maths easier.

Any thoughts?

Thanks

Graham North
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\04\28@105814 by Roman Black

flavicon
face
Graham North wrote:
>
> Hi,
>
> Now that I have got my interupts working I have quite a task infront of me.
>
> I am taking 10 readings with a 16bit A/D, and then have to average this
> reading.
>
> Has anyone ever done this?
>
> What would people suggest as the fastest/most efficient way to do this?


My thoughts would be to take either 8 or 16 readings,
not 10. Then you could just add each new 16bit reading
to a running total in a 24bit variable, that only takes
a few instructions. Then at the end just left shift the
24bit variable 3 or 4 bits (ie divide by 8 or 16) and
then you have averaged the result. :o)
-Roman

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\04\28@111128 by michael brown

flavicon
face
From: "Roman Black" <spam_OUTfastvidTakeThisOuTspamEZY.NET.AU>
To: <.....PICLISTKILLspamspam@spam@MITVMA.MIT.EDU>
Sent: Saturday, April 28, 2001 9:54 AM
Subject: Re: [PIC]: Averaging 10 16bit values? !


> Graham North wrote:
> >
> > Hi,
> >
> > Now that I have got my interupts working I have quite a task infront of
me.
{Quote hidden}

Tis' early, but I think he means "right" shift
> 24bit variable 3 or 4 bits (ie divide by 8 or 16) and
> then you have averaged the result. :o)
> -Roman
>
> --
> http://www.piclist.com hint: The list server can filter out subtopics
> (like ads or off topics) for you. See http://www.piclist.com/#topics
>
>

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\04\28@145935 by Bob Ammerman

picon face
Let's make a FAQ out of this one, huh?

I've seen this thread at least 5 times in the last year.

Bob Ammerman
RAm Systems
(contract development of high performance, high function, low-level
software)

{Original Message removed}

2001\04\30@233539 by Tom Handley

picon face
  Roman, I'm sure that was a typo but it's a Right Shift for Divide. Or,
as my drill instructor use to bark; "Your other left #@&!!*!" ;-)

  - Tom

At 12:54 AM 4/29/01 +1000, Roman Black wrote:
{Quote hidden}

                                         ^^^^
>24bit variable 3 or 4 bits (ie divide by 8 or 16) and
>then you have averaged the result. :o)
>-Roman


------------------------------------------------------------------------
Tom Handley
New Age Communications
Since '75 before "New Age" and no one around here is waiting for UFOs ;-)

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservspamKILLspammitvma.mit.edu with SET PICList DIGEST in the body


More... (looser matching)
- Last day of these posts
- In 2001 , 2002 only
- Today
- New search...