Thank you for all replies.

I rebuilt the VU meter on a different protoboard and with _WDT_OFF it runs properly.


This is interpretation of the original code:

Sections labelled "GRAFx" configure the user defined graphics characters of the LCD to give the different VU meter graphical appearance.

Section labelled "BARRA" reads the ADC input, only one for each loop.

Alternating between the 2 ADC inputs, and also between the 2 LCD lines, is controlled with variable "MARCA1".

The value from the ADC is divided by 5 to give a remainder ("RESTO") between 0 and 5 that represent the 5 pixel columns of one LCD character .

The display is printed with a proportional number of full graphical characters, and then a partial character with only the relevant pixel columns depending on the remainder of the ADC reading (RESTO).

After finishing drawing the VU line on the display 3 characters are cleared to erase the remaining of an eventual previous longer line.

Each press of the push-button changes the graphical representation in a sequential fashion controlled by "MARCA2". Depending on this sequence the main program loop is closed via the corresponding "GRAFx" section. Change on the graphical representation is obtained by reconfiguring the user defined characters of the LCD via section labelled "GRAFx".

"cgram" is an area of the LCD internal RAM that is used to store the 8x5 bitmaps (pixels) of user defined characters.


I wonder is it is possible to increase sensitivity of the VU meter (10 times) so it could measure per-amplified signals. Currently it takes 0.1 volt to activate a bar.

Thank you.