I'm playing about with a PIC16F876, reading an analogue voltage and displaying the result on a bar of 16 LED's - rather like an LM3914. As the A2D has 10 bit resolution I'm lighting an LED for every 64 (0x40) of the A2D reading. Also, like the 3914, I'm planning having it switchable for either bar or dot display.
I'd also like to add the option of using it as a VU meter with a log scale, like the LM3915 - to that end (rather than simply repeatedly subtracting 64) I've implemented a 16 bit lookup table for the subtractions for each LED - which currently is 0x0040 for all values. I'm going to add a second 16 bit table to give log readings, switchable from one of the PIC pins.
What I want to know (at last!), is how to calculate the log values to put in the table?.
I'd also like to add the option of using it as a VU meter with a log scale, like the LM3915 - to that end (rather than simply repeatedly subtracting 64) I've implemented a 16 bit lookup table for the subtractions for each LED - which currently is 0x0040 for all values. I'm going to add a second 16 bit table to give log readings, switchable from one of the PIC pins.
What I want to know (at last!), is how to calculate the log values to put in the table?.