On Wed, 25 Jan 2006 15:21:25 +0100, you wrote: >Hi! > >I am looking at controlling the frequency of a wienbridge oscillator using a >digital potmeter. My problem being that digital logarithmic potmeters don't >come in anything > 256 steps. Because of that I have decided that I want to >add a "pad-resistor" that is connected to one end of the potentiometer and >the wiper, to *simulate* a log taper. [ See >http://www.edn.com/article/CA46509.html ]. All I need to do is implement a >correction-table to *correct* any possible deviations from a logarithmic >scale, or that's my plan anyway! > >Are there any better ways to make a correctional table other than using a >lookup table that *jumps*? I would like to be able to calculate the >correction on the fly and return the corrected value. Is that a good idea? >Any tips? You have to balance the space/time of the code used to calculate the answer against the space needed for a lookup table. For some functions, table size can be hugely reduced by simple linear interpolation between entries - this works very well for things like PT100 and thermocouple linearisation which only require small corrections, and the code is simple if you used fixed-point maths with the point at a multiple of 8 bits. Excel is a useful tool to evaluate the errors from various table sizes, to determine the optimum step size for the accuracy required. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist