z. VU meter

VU meter operation may also be configured via USB interface. Operation mode is passed in as a single byte value and defines the active ports as well as assigns analog inputs AN0 and AN1 to specific ports.

VU meter example (x64) relies on K8055-1 (with PIC18F2xJ50 adapter) or K8055N-2 functionality, so not all VU meter functionality is used.

VU meter is reconfigurable, so each output voltage threshold (0..1023) my be set individualy via the enclosed HEX file Editor v3.0 and the appropriate FWI file. Instructions for using HEX file editor are also included in the PIC18F26J50 frimware v2.7.8.zip. The threshold determines a minimum ADC value at witch ouput is turned on. If LEDs are conmnected to PIC18F26J50 outputs, different LED patterns may be programmed in the microcontroller.

VU meter is usualy not a microcontroller, but a simple voltage comparator with multiple outputs for different voltages. But one can also implement a VU meter with a microcontroller. PIC18F26J50 micrcontroller has 23 pins available for user applications. PIC18F26J50 firmware v2.7.8 or later is reconfigurable and can use any pins on all three ports (A,B and C) as digital outputs, except for AN0 or AN1 that are used for analog inputs. Two analog channels may be sampled at the same time and each port may be assigned to a different ANx analog input. This means that a single PIC18F26J50 may operate as a stereo VU-meter with at least 2 x 8 digital outputs.

[850E] = RA7 threshold (16-bit), value range = 0..1023

[850C] = RA6 threshold (16-bit), value range = 0..1023

[850A] = RA5 threshold (16-bit), value range = 0..1023

[8506] = RA3 threshold (16-bit), value range = 0..1023

[8508] = RA4 threshold (16-bit), value range = 0..1023

[8504] = RA2 threshold (16-bit), value range = 0..1023

PORT A:

[8500] = RA0 threshold (16-bit), value range = 0..1023

[8502] = RA1 threshold (16-bit), value range = 0..1023

USER CONFIGURABLE VU METER PARAMETERS IN FIRMWARE (address 0x8500):

*Each patrameter is a 16-bit word

[853C] = VU meter configuration bits (configuration is applied at microcontroller startup, but my be altered via USB):

0 - PORT A enable/disable

1 - PORT B enable/disable

2 - PORT C enable/disable

3 - PORT A ADC input selection (0 = AN0, 1 = AN1)

4 - PORT B ADC input selection (0 = AN0, 1 = AN1)

5 - PORT C ADC input selection (0 = AN0, 1 = AN1)

Function VUMeterSetup(Byte OpMode) as Integer

OpMode parameter contains VU meter configuration bits, which are explained in the right hand column (default values are specified on EEPROM address 0x853C).

Examples for PORT B:

PIC18F26J50 firmware v2.7.8 (or later) and LIB_PCUSBProjects v6.2.NET4x64 (or later) also support dymanic VU meter setup through USB port with the following VB.NET function:

[851E] = RB7 threshold (16-bit), value range = 0..1023

[851C] = RB6 threshold (16-bit), value range = 0..1023

[851A] = RB5 threshold (16-bit), value range = 0..1023

[8516] = RB3 threshold (16-bit), value range = 0..1023

[8518] = RB4 threshold (16-bit), value range = 0..1023

[8514] = RB2 threshold (16-bit), value range = 0..1023

PORT B:

[8510] = RB0 threshold (16-bit), value range = 0..1023

[8512] = RB1 threshold (16-bit), value range = 0..1023

PIC.VUMeterSetup(0) ' Disables VU meter display on all ports

PIC.VUMeterSetup(2) ' Enables VU meter display on port B from analog input AN0

[852E] = RC7 threshold (16-bit), value range = 0..1023

[852C] = RC6 threshold (16-bit), value range = 0..1023

[852A] = RC5 threshold (16-bit), value range = 0..1023

[8526] = RC3 threshold (16-bit), value range = 0..1023

[8528] = RC4 threshold (16-bit), value range = 0..1023

[8524] = RC2 threshold (16-bit), value range = 0..1023

PORT C:

[8520] = RC0 threshold (16-bit), value range = 0..1023

[8522] = RC1 threshold (16-bit), value range = 0..1023