Hi, I did this with an AVR a year and a half ago. There are some niggles. Depending on how accurate you'd like to be, how fast you can sample, and the voltage range of the incoming signal, how accurate you need to be for 100Hz vs. 1Khz vs. 10Khz frequencies, you may or may not need to: 1. amplify or cut incoming signal to scale to the A/D range 2. use a peak detector. I used the precision half-wave rectifier sample circuit from the National Semi LM3916 datasheet. 3. calibrate for unit-to-unit variation in peak detector output for a given input signal level 4. do some tweaking of averaging of samples to get a reasonably-responsive VU display The device this was for had small size and power consumption as critical parameters, and I decided to do it in firmware. The original plan was to sample the internal digital audio stream (it is a mic pre with A/D, a specialty portable pro audio thing) but the AVR couldn't do it for 96Khz or 192Khz audio sample rates, a mistake I made from not reading the AVR datasheet closely enough and no space/time for a CPLD or other external helper digital logic. So this was all something of a (successful) hack, unfortunately. I am able to get -30db (relative to about 2.5Vpp fullscale input) reliably. But each unit requires calibration, a hassle. Cheers, J David Duffy (AVD) wrote: > Has anyone here coded a VU meter on a PIC ? I'm designing a product that > has three (for 2.1 output) 10 segment LED bars. > > I could go done the old LM3915 route, but thought a micro with > multiplexed output would be better in terms of ease of scale / response > customisation. > David... > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist