In message PICLIST@MITVMA.MIT.EDU writes: > I need to operate a 1 milliamp panel meter using a 16C54. > The meter will be used to display measured periods, which > I have set up the timer to determine. The problem I am > having concerns driving the analog meter from 0 to 1 ma. > My first approach was to build a R-2R ladder using port_b > pins (yes, all 8 of them). The problem with this is that > the meter was loading down the ladder (the meter in series > with 5 Kohm), so I addded a unity-gain op-amp. But now I need > a rail-to-rail op-amp to drive the meter to its full > range (from 0 to 5 volts). There is no need to go to 5 volts, just reduce the value of the series resistor to change the FSD of the meter. > I started looking at other ways to accomplish the above meter > drive. I looked at commercial DAC chips, but all that I have found > need split supplies or 10 volts or more (I am driving the PIC > with 5 volts - no other supply is available). Is there a DAC > chip on the market which operates on single 5-volt supply? I don't have the information to hand, but don't some of the ZN series DAC's work off 5 volts only?. > I have also looked at using a PWM approach. The internal > timer is running at a frequency of 125 Khz, so I could set up > a PWM output on one of the pins. My questions are: > > 1) What filtering do I need on the output? I only need around > 10 Hz response on the meter, so I guess a simple RC would > work (right???) Just feeding an analogue meter requires very little filtering, you could even try it with none - the movement should average out the pulses. With 125KHz pulses the needle shouldn't 'wobble'. > 2) Is this approach to generating analog outputs very accurate? It's more accurate than an analogue meter, it's commonly used to provide the tuning voltage in TV receivers. The varicap tuner requires a steady voltage between 0 and 33 volts to select the channel, this is often done via PWM with a micro output feeding an NPN transistor with the collector connected via a resistor to the 33 volt very stable supply (generated with an IC). The output is then fed a low-pass filter consisting of two or three resistors and capacitors. In this setup 10mV change on the tuner will produce a visible effect on the picture!. > 3) How do I work out the required components? Sorry, my maths isn't very strong :-). I would be inclined to try feeding the meter directly from an output pin via a 5K (less the internal resistance of the meter) resistor. Obviously when the pin is permanent high it will read full scale, and when low will read zero. Then try 50/50, and you should read 2.5, and anywhere in between for respective ratio's. It may be avantageous to use a smaller resistor to feed the meter, then you could get full scale while still feeding pulses. > Thanks for any help - Bruce > -- > ----------------------------------------------------- > <<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> > ----------------------------------------------------- > Bruce A. Bowling > Staff Scientist > Thomas Jefferson National Accelerator Facility > 12000 Jefferson Ave - Newport News, VA 23602 > (804) 249-7240 > bowling@cebaf.gov http://devserve.cebaf.gov/~bowling > ----------------------------------------------------- > <<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> > ----------------------------------------------------- > /--------------------------------------------------------------\ | Nigel Goodwin | Internet : nigelg@lpilsley.demon.co.uk | | Lower Pilsley | Web Page : http://www.lpilsley.demon.co.uk | | Chesterfield | | | England | | \--------------------------------------------------------------/