Note that BASCOM-8051 was used and that it doesn't work with BASCOM LT without modifications , since arrays are used.
This program shows a bar display peak-hold VU meter on a LCD 16 * 2.
Resolution is 32 elements for a 32 dB range based on the internal 8 bit A/D converter.
The scale range is -26dB - +5dB for 0.125 to 5.00 Volt DC input.
The display will be updated every 50mS on Timer0 interrupt base.
Log conversion is done with a log table. At initialization a log table will be created and stored in the array Vu(256).
VU meter can be disabled by Vu_flag = 0.
Peak Hold can be disabled by Peak_hold_flag = 0.
Setup for 80C535 at 12 Mhz, VAREF = 5Volt, A/D input = P6.0 (channal # 0).
Note: Use a 47K resistor from the input to P6.0 for input protection.