[TriEmbed] PWM to Analog 0 to 5 VDC?

Rick nm3g at triad.rr.com
Tue Jun 30 14:19:04 CDT 2020

Regarding unstable ADCs with PWM signals ...

I'm sure you've already done this, but "just in case":

Take your first ADC reading and discard it.

Take an odd number of sequential ADC readings, adding them together. 
When done, divide by the ODD number you measured

         Read ADC and Discard

         Read 9 ADC values, and add them together (x=x+ADCValue)

         x/9 = 9-averaged ADC Value.

The purpose of discarding the first ADC value is the ADC will have some 
random value held by the input capacitor. When you read, this voltage 
gets pulled to zero, ready for the next ADC read.

I always have deleted the first ADC value, and run an odd-number average 
with ADCs. This worked very well in an industrial, very high current 
environment (measuring 1000 - 1600 Amps in under 100 mS).

If you've already implemented this, you will want to include a low pass 
filter with the 3dB point 1/t of your measurement period. There is no 
reason to have a higher frequency than this, and a lower frequency 
filtering will cause your ADC values to lag actual values.

Also, be careful of high crest values (sharp peaks and dips) ... NEVER 
assume your ADC input is a pretty sine wave or a SLOWLY changing DC 

This work was performed on an Isopod Microcontroller board (New Micros, 
no longer in business) using  a Motorola DSP56F800 series 16-bit Digital 
Signal Process (DSP) processor running at around 80 MHz.

Yea, that long ago!

Hope this helps.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.triembed.org/pipermail/triembed_triembed.org/attachments/20200630/cbb33620/attachment.html>

More information about the TriEmbed mailing list