> My PWM is at 5kHz. I discovered that the current readings were not > averages, because the A/D acquisition time is much faster that the PWM > frequency, so the current sense readings were sometimes coming back as > maximum, and sometimes as zero ! It is obviously catching either the > low or high state of the PWM output. Only occasionally were they > coming back somewhere in between - obviously when the A/D acquisition > happened to catch the PWM on a rising or falling edge. If the PWM and A/D are done in the same chip, then synch the A/D sample to the PWM on cycle. Even so, low pass filter plus software averaging are almost mandatory. -- Brent Brown, Electronic Design Solutions 16 English Street, Hamilton, New Zealand Ph/fax: +64 7 849 0069 Mobile/txt: 025 334 069 eMail: brent.brown@clear.net.nz -- 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