Hi folkeu;
First of all, thank you for opening a new thread.
I added my bargraph 10 leds in Proteus format
Nice and big work (from the years before the microcontrollers).
You will see that the rectifier part is already ready
Yes, I see. This is a very correct solution (built in twice), and in this case the VREF+ setting is also unnecessary. However, I would also like to try also the simple solution (as shown in the attached GIF), it also may be enough (and much cheaper). You can be 'play' with RC filter values, by the VREF+ setting ...
Meanwhile I modified the
16F88_LED project and its DSN to use 2x10 leds (it was a few hours of work). If I understand well, you want to try to write the program (and modify the DSN) yourself, so I'm not sending the new
16F88_2x10led project (yet). But I attach the circuit's GIF image, hopefully it will help a bit.
Is it possible to modify the MikroC library to integrate a step variable in dB for each interval between led? Everyone can choose their viewing scale.
Yes, it is possible (like almost everything in C), but I do not recommend this solution. It would greatly increase the code size and slow down the program (runtime float calculations, etc). Instead, I prefer the using of a (freely modifiable) constant array containing the AD output values for all LED positions. The values can be calculated using the wanted dB steps. The corresponding program segment of my new project:
// 10-stage log table, 3 dB/step, can be (must be?) modified :-)
const unsigned LogTable10[] =
{ 45, 64, 90, 127, 180, 255, 361, 510, 721, 1020};
// -21 -18 -15 -12 -9 -6 -3 0 +3 +6 dB
However, by running the simulation, I found (I think so) that the 27 dB dynamics range is too small (if we keep the 10 LEDs and the 3dB/step). It should be at least 35 but rather 45 dB. In my program this is also achieved with the appropriate array values.
Note using your analog comparator variant this range is also too small (26 dB).
Greets,
zuisti