"The ideal design has zero parts." Here's what I've done to get RMS on a PIC: With an interrupt, square the current 8 bit sample (16 bit result) and add into a 24 bit sum. Increment a counter. When you have 256 samples, divide by 256 (throw out 8 lsb), then take the square root. That's the RMS. Clear the sum and the sample counter. This techniques was used in a pic based voltage regulator in a curing light for dental composites. Harold > Why not use an RMS converter such as the AD736 > > Brian. > > -----Original Message----- > From: pic microcontroller discussion list > [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of Tan Chun Chiek > Sent: 21 November 2003 14:30 > To: PICLIST@MITVMA.MIT.EDU > Subject: Re: [EE:] Sine wave to DC conversion > > > RMS > ----- Original Message ----- > From: "Wouter van Ooijen" > To: > Sent: Friday, November 21, 2003 9:24 PM > Subject: Re: [EE:] Sine wave to DC conversion > > >> > Yes, I'm trying to get the average DC level, the RMS value of >> > the sine wave. >> >> Which of the two, or both? The average of a sine is zero, the RMS is >> sqrt(2)*((1/2)*[top-top])^2. >> >> Wouter van Ooijen >> >> -- ------------------------------------------- >> Van Ooijen Technische Informatica: www.voti.nl >> consultancy, development, PICmicro products >> >> -- >> http://www.piclist.com#nomail Going offline? Don't AutoReply us! >> email listserv@mitvma.mit.edu with SET PICList DIGEST in the body >> > > -- > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > email listserv@mitvma.mit.edu with SET PICList DIGEST in the body > > -- > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > email listserv@mitvma.mit.edu with SET PICList DIGEST in the body > -- FCC Rules Online at http://www.hallikainen.com/FccRules/ -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body