This is only a preview of the August 2008 issue of Silicon Chip. You can view 33 of the 104 pages in the full issue, including the advertisments. For full access, purchase the issue for $10.00 or subscribe for access to the latest issues. Items relevant to "Ultra-LD Mk.2 200W Power Amplifier Module":
Items relevant to "Planet Jupiter Receiver":
Items relevant to "LED Strobe & Contactless Tachometer":
Items relevant to "DSP Musicolour Light Show; Pt.3":
Purchase a printed copy of this issue for $10.00. |
DSP Musicolour:
calibrating and
operating
PT.3: By
MAURO GRASSI
In last month’s article, we detailed the construction of the DSP
Musicolour. In this month’s article, we guide you through the final
testing of the DSP Musicolour and give troubleshooting tips. We
also explain the operation of the firmware in more detail as well as
discussing possible accessories.
W
hile the circuit of the DSP Musicolour (published in
June) may at first seem complicated, it is relatively
simple when you consider all the features that we
have been able to pack into this powerhouse. Check out the
list opposite. We think you’ll agree!
We assume that you have read the first and second parts
of the article in the previous two issues of SILICON CHIP.
If you have followed the construction in last month’s issue,
you should have a fully assembled DSP Musicolour in its
case and you should have tested the supply rails at test
points TP0 and TP1. These should have measured close to
their correct values of +5V and +10V respectively.
If they do not measure close to these values, you should
refer to the troubleshooting section below for further hints,
although we mentioned some extra checks to perform in that
case in last month’s issue, to which you should refer first.
In last month’s article, we mentioned that LK4 is optional
78 Silicon Chip
and is normally omitted. When LK4 is omitted, the DSP
Musicolour has three independent audio inputs which can
be used to modulate the output channels. These are the
Microphone input, the Left Audio channel and the Right
Audio Channel.
The Left and Right Audio channels from the speaker
terminals on the back panel are attenuated by the LEFT and
RIGHT potentiometers on the front panel. The Microphone
line input is a mix of the on-board electret microphone signal and any external microphone connected to the 6.5mm
jack on the back panel.
When LK4 is installed, however, the Left and Right Audio
channels from the back panel are mixed in hardware before
being digitised by the microcontroller. In this case, either
the LEFT or RIGHT potentiometer can be used to attenuate
the input signal before it is digitised (and you should not
install both potentiometers).
siliconchip.com.au
POTENTIOMETERS
FFT
AMPLITUDES
&
EQUALISATION
OP
AMP
AUDIO
CHANNEL
INPUTS
OP
AMP
MIC
INPUT
DIGITISING
AND
SOFTWARE
MIXING
LOGICAL
OUTPUT
CHANNEL
LEVELS
SET
PHYSICAL
OUTPUT
CHANNEL
LEVELS
SET
OP
AMP
Fig.1: block diagram of the DSP Musicolour. Use
this in conjunction with the text to understand
operation, programming and calibration.
In other words, when LK4 is installed you lose one
independent audio channel but you need only one potentiometer on the front panel. LK4 therefore controls
whether the DSP Musicolour Left and Right audio channels are mixed in hardware or software (Dual mono or
joint stereo). The most common option is to omit LK4 and
to disable hardware mixing.
With regards to the jumper links LK5 and LK6, we mentioned in the first part of the article that the default is to
have LK5 installed and LK6 omitted. In fact, the firmware
will ignore the state of links LK5 and LK6 – it does not
matter if they are installed or not.
Power up
First, make sure that the plastic case has been screwed
shut. When you first apply power, you should see the start
up screen scroll past on the dot matrix LED display. The
DSP Musicolour will go through a number of tests and then
go to its default state. If you do not, you should switch off
mains power immediately and go to the Troubleshooting
section below.
Boot-Up sequence
When the DSP Musicolour first boots up, it goes through
a number of internal checks before commencing operation.
The following occurs on boot up (in chronological order):
1. The firmware displays the start up screen and its version
number (this can be disabled for a quicker boot by changing
the start up settings in the SYSTEM>Startup sub-menu).
2. The firmware measures the frequency of the mains supply. If the measured value is within tolerance, the firmware
accepts the measured value and assigns its internal settings
for either 50Hz or 60Hz operation (the firmware chooses
the value closest to the measured frequency).
If the measured value is not within tolerance, the firmware will display a warning indicating that no mains was
detected and will default to 60Hz operation. In normal
mains powered operation, this warning should never be
seen. If it is, it indicates a problem with the Musicolour’s
zero crossing detection system.
The fallback value of 60Hz was chosen because it is the
safer value for the purpose of controlling the Triacs in the
output stages.
siliconchip.com.au
TRIGGER
OUTPUT LEVELS
FROM FFT SYSTEM
CHASER
PROGRAM
VIRTUAL
MACHINE
OUTPUT LEVELS
FROM CHASER
PROGRAM
DSP MUSICOLOUR FEATURES
1. Selectable 8-band equaliser
2. Auto detection of mains frequenc
y (50Hz or 60Hz)
3. Selectable phase-controlled or zero
voltage-switched
output channels (8-bit resolution)
4. For each logical output channel:
(a) Selectable gain
(b) Selectable audio passband
: arbitrary minimum
and maximum frequencies
(c) Selectable acquisition mod
e: peak or average
(d) Selectable quiescent level
(filament preheat)
(e) Selectable zero voltage mod
e, strobe mode,
direct mode or continuous
mode
5. Selectable logical channel for each
physical output channel
6. Chaser modes implemented as a
virtual machine
7. Trigger channel with:
(a) Selectable audio passband
(b) Selectable trigger threshol
d
8. Firmware support for RC5 remote
control (requires
additional PC board; to be described
next month)
9. Firmware support for high speed
UART (requires
additional PC board)
10. Selectable balance
11. Selectable display frequency, brig
htness and screen
saver time-out period
12. Selectable sampling frequency from
16kHz to 50kHz
simultaneous on all channels
13. Real time 7-bit FFT using double
buffering
14. Persistent software settings and
multiple non-volatile
user memories
15. Self calibration and Diagnostics
16. Automatic and manual tuning of
the internal fast
RC oscillator for increased accuracy
17. Adaptive potentiometer controls
18. Silence detection and triggering
19. Input op amp stage clipping dete
ction
August 2008 79
3. If you are running from a 50Hz supply and somehow the
frequency is not properly detected and defaults to 60Hz, the
shorter mains period will at worst mean that less power is
delivered to the output loads. Therefore even if your mains
supply is 50Hz and the detection fails, at least the outputs
will not flicker. Flickering can occur when the Triacs are
switched on beyond the next zero crossing of the mains
waveform and should not occur in normal operation.
Another fail-safe feature is that in the rare event that no
good mains frequency is detected, the firmware will disable
all output channels (the rest of the firmware will function
normally, however);
4. The firmware will load any persistent settings from
the last active session and initialise all internal peripherals,
including enabling all interrupts in the correct sequence;
5. The firmware will detect and enable any connected
accessories. It is possible to add a small infrared remote
control PC board to the main board to allow the DSP Musicolour to be operated by a standard RC5 remote control.
Also, the firmware implements a RTSP (Run Time Self
Programming) server in a secure part of program memory
(it also switches the interrupt vectors to an alternative location), which can be used with a UART. The DSP Musicolour
is highly customisable but for most applications you will
not need to change any settings, as the preloaded defaults
should be adequate.
6. The firmware will jump to the main loop (described
below).
Automatic Calibration
Although the DSP Musicolour will adjust its settings according to the detected mains frequency, all its calculations
assume a fixed system clock.
The system clock is derived from the microcontroller’s
(dsPIC30F4011) internal fast RC oscillator (nominally
7.37MHz) and a 16xPLL multiplication stage is used to
achieve around 30MIPs operation (4 clocks per instruction).
Since this oscillator’s frequency tolerance can be relatively high due to internal manufacturing variations, it may
be necessary, if you are experiencing unusual effects like
flickering lights on the output channels, to calibrate the
frequency as close to 7.37MHz as possible. This is a good
thing to do just in case.
The dsPIC30F4011 has an internal non-volatile calibration setting to achieve this, meaning the internal fast RC
oscillator can be tuned to bring it as close as possible to its
intended frequency. The firmware assumes that the mains
line frequency is very close to its theoretical value of either
50Hz (if you are in Australia, Europe and most other parts
of the world) or 60Hz (if you are in America, Japan and a
few other places).
Since the mains frequency can be measured by the
firmware against the system clock, the firmware can then
calculate the error in the internal fast RC oscillator and
automatically adjust it to minimise the error.
This is what the firmware does in its automatic calibration. It will run once when you first power up but if you
need to, you can also do it manually.
To do this, go to the ADVANCED>Calibration sub-menu.
If you wish to see how far from the ideal the microcontroller
is operating, go to the INFORMATION>Error menu and the
current percentage error in the measure mains frequency
will be displayed.
The Main Loop
After boot up, the firmware spends most of its time in the
main loop, whereby the Musicolour is either in Automatic
mode (AUTO LED is lit) or User Mode (USER LED is lit).
Either way, the AUTO LED or the USER LED will flash if
there is no input signal detected. The SET LED will also
flash if there is clipping (overload) in the op-amp stages of
either the Left or Right audio input channels.
While clipping is very undesirable in an audio amplifier,
greatly affecting the sound quality, its effect may actually
help in getting a good display from the DSP Musicolour.
So the detection of clipping is merely an indication that
you may want to turn down the LEFT and RIGHT potentiometers.
While in the main loop, you may enter the menu system by pressing the SET button. The display is refreshed
according to the currently selected display. The selected
display can be scrolled to the next available display using
the AUTO button when already in Automatic Mode and
the USER button when already in User Mode.
Some of the implemented main loop displays are shown
in Table 1. Note that they do not affect the internal operation
of the DSP Musicolour; they only affect what the display
shows.
In the main loop in Automatic Mode, the CH1-CH4 LEDs
will light according to the logical output channel levels.
The main difference between Automatic mode and User
Mode is that in Automatic mode the Musicolour uses its
current settings for all functions, whereas in User Mode, one
of four previously stored settings profiles is used instead.
Thus User Mode can be used to quickly run the Musicolour in a previously set configuration. In User Mode, the
CH1-CH4 LEDs will indicate one of the four preset profiles
currently active. You may press the CH1-CH4 buttons to
Table 1: The display modes in the main loop
Spectrum Fine:
The spectrum is displayed on the display from lowest to highest frequency (left to right).
Spectrum Centered:
The spectrum is displayed in centred mode.
Logical Channel Displayed Single:
The output levels of each channel are displayed. The top horizontal bar indicates the first logical
channel’s level. The third horizontal bar from the top indicates the second logical channel’s level.
Similarly, the fifth and seventh horizontal bars from the top indicate the third and fourth logical
channels’ levels respectively.
Logical Channel Display Averaging:
Same as above except every horizontal bar in between the output channel bars is the average
of the previous and next bars.
RMS display:
Displays the RMS level of the input signal as an analog meter.
80 Silicon Chip
siliconchip.com.au
change the preset on the fly while in User Mode.
The main loop running in Automatic or User Mode consists of the following sequence, which is diagrammatically
represented in Fig.1.
Logical and physical channels
We should first mention that the firmware supports four
logical output channels and four physical output channels.
The physical output channels correspond to the outputs on
the back panel. Each of these can be associated to a logical
channel. In normal operation, the physical channel N is
associated to the logical channel N.
However, added effects can be achieved by changing
the mapping from output channels to logical channels.
For example, you can have all four physical channels on
the back panel controlled by one logical output channel.
We now explain the operation of the main loop. As
can be seen in Fig.1, the three inputs consisting of the
Left and Right audio inputs and the Microphone inputs
are digitised and mixed according to the balance settings
under AUDIO>Balance. Any combination of these three
channels can be used as the input signal. The result of
this software mixing is passed to the FFT (Fast Fourier
Transform) system.
The output of the FFT resolves the captured slice of the
input audio waveform into 128 (27) frequency amplitudes.
These are equally spaced from 0Hz up to the sampling frequency. The smallest frequency that the FFT can resolve
is F/128, where F is the sampling frequency. For example,
when F is 48kHz we can resolve down to 375Hz or ±137Hz.
If you are not very interested in the audio sub-band above,
say, 10kHz, then you can lower the sampling frequency
to 20kHz and the FFT will be able to resolve frequency
components down to 156Hz or ±78Hz.
The audible spectrum for humans is nominally from
about 20Hz to 20kHz. Although the sampling frequency
of the ADC system can be set anywhere from 16kHz up to
50kHz, keep in mind that according to the Nyquist sampling
theorem the highest frequency that can be resolved using a
sampling frequency F is F/2.
This means that aliasing will occur at least somewhere
in the audible spectrum if the ADC system’s sampling
frequency is set below about 44kHz. Aliasing is usually an
unwanted characteristic of a digitising system. However,
since most music has very little high harmonic content, in
fact little content above 4kHz, it may be desirable to lower
the sampling frequency in order to increase the resolution
of the FFT.
The FFT system computes logical output channel
levels in two acquisition modes. These can be set in the
CHANNELS>Mode sub-menu.
The two acquisition modes are PEAK and AVERAGE.
In AVERAGE mode, the average of the relevant frequency
components falling within the channel’s passband (set by
the minimum and maximum frequencies for the channel)
will be the output level requested in the output stage. In
PEAK mode, however, only the maximum level within the
channel’s passband will be the output level requested in
the output stage.
There is an optional Equaliser module which can be enabled or disabled. The levels of the equaliser can be changed,
however, by going to the AUDIO>Equaliser sub-menu.
The equaliser has eight bands set to affect preset portions
siliconchip.com.au
Warning!
The DSP Musicolour operates
from the 230/240V AC
mains and many internal compon
ents and sections of the
PC board tracks are also at mains
potential. Contact with
any of these could be FATAL.
DO NOT TOUCH any of these parts
unless the power cord
is unplugged from the mains supp
ly. DO NOT CONNECT
this device to the mains unless
it is fully enclosed in the
specified case.
This project is not for the inexperi
enced. Do not build
it unless you know exactly wha
t you are doing and are
completely familiar with mains
wiring practices and construction techniques.
of the audible spectrum. The current equaliser bands can
be seen under the INFORMATION>Equaliser sub-menu
and cannot be changed by the user (it can be changed by
reprogramming the device however).
Note that the equaliser affects the output of the FFT, not
the input. After any equalisation is performed, the levels
of the logical output channels are set by the FFT system,
if the chaser mode is set to OFF (see the CHASER>Mode
sub-menu below).
If the chaser mode is not set to OFF then the level data produced by the FFT system is ignored and the data produced
by the current chaser program (see the CHASER>Program
sub-menu below) is used to set the logical output channel
levels instead. If the chaser mode is set to TRIGGERED, then
the trigger pulse (produced by the FFT system) is used to
step through the chaser program.
Triggering
Triggering can either occur directly from the Trigger
channel or from the Silence detection. Silence detection
triggers when there is a relative silence in the input Left
or Right audio signals (the MIC input is not used for the
silence detection).
The trigger can be considered a separate logical channel.
It has its own selectable passband and threshold. When the
threshold is reached the trigger occurs. The trigger is used
by the chaser system to trigger the current chaser program
in TRIGGERED mode.
Tips: If, for example, you want bass response triggering a pre-set chaser program, you would set the TRIGGER
minimum frequency to 0Hz and the maximum frequency
to around 300Hz. Then adjust the threshold level to get an
acceptable level of triggering.
Light Chaser
The chaser program is either executed at the rate set in
OUTPUT>Output Rate or each step in the program is triggered. Both the Chaser system and the FFT system produce
a set of output levels for the logical output channels. Depending on the chaser mode being used, the chaser levels
or the FFT levels will be used to change the levels of the
logical output channels. These will then affect the physical
output channels.
Channel Modes and Settings
Each of the four logical output channels can operate in
one of four primary modes: DIRECT mode, CONTINUOUS
August 2008 81
Mode, ZV Mode or STROBE mode.
In the DIRECT and CONTINUOUS modes, the brightness
of the logical output channel is varied in 256 levels (8 bit
resolution). The output brightness is approximately linear
as the firmware uses an internal dimming curve to correct
the non-linearity inherent in phase control. The difference
between DIRECT and CONTINUOUS mode is how the
output level is set by the output system.
The main difference between the DIRECT and CONTINUOUS modes is that while in DIRECT mode the brightness
is set directly, in CONTINUOUS mode, the brightness is
“continuously” modified from the current brightness level.
In other words, in CONTINUOUS mode, if the requested
level is higher than the current level, the current level is
increased by the ATTACK setting for the channel, while
if the requested level is lower than the current level, the
current level is decreased by the DECAY setting for the
channel. Setting different ATTACK and DECAY levels for
the channel can affect the level of the output logical channels in CONTINUOUS mode.
In ZV Mode, the output channel responds as in DIRECT
and CONTINUOUS modes, except that the output is not a
brightness level but a digital output. The output is either
fully on or fully off. This mode approximates a zero voltage
switching mode and can be used to reduce RF interference
or achieve a digital effect.
In STROBE Mode, the output level sets the frequency
of the logical output channel rather than the brightness
level. The strobe frequency will be set from the maximum
(equal to the mains supply frequency, either 50Hz or
60Hz, down to 1/256th of the mains supply frequency,
ie. around 0.2Hz).
Quiescent Level or Filament Preheat
In all channel modes except STROBE, each logical output channel has a settable quiescent level, which is used
to reduce the stress on the filaments in your incandescent
lamps and to reduce surge currents through the Triacs at
switch on.
The quiescent level can be set by going to OUTPUT>
Fig.2: one of the physical output channels being switched
without software correction for asymmetrical phases.
The yellow trace is the output of the Triac while the green
trace is the trigger pulse applied to the gate through
the optocouplers.
82 Silicon Chip
Quiescent Level and is settable from 0 to 25% of the full
brightness level. Note that if the channel mode is ZV (zero
voltage switching) and the Quiescent Level is not 0% the
channel may seem to be continuously on, depending on
the ZV threshold. In this case, you should set the Quiescent
Level to 0% or disable ZV mode or change the ZV threshold
by going to OUTPUT>ZV Threshold.
A closer look at the operation of the Musicolour
The Triacs are controlled through the optocouplers using
the four output compare channels of IC1 (dsPIC30F4011).
In order to maintain a constant brightness of the output
lights, it is necessary for the switch-on pulses to the Triacs
to be synchronised to the frequency of the mains supply.
To achieve this, the microcontroller uses the INT0 external interrupt pin which is supplied by one side of the
transformer’s secondary winding. An interrupt can be triggered on a rising or falling edge of INT0. Now a low level
on INT0 is any voltage lower than about 1.5V while a high
level is considered to be anything above 3.5V.
We have a 5V supply but a 7.5V secondary winding.
This means that the triggers to INT0 (which is the microcontroller’s zero detection interrupt) are asymmetrical. The
measured duty cycle is about 42% rather than the expected
50%. The firmware corrects this asymmetry, adjusting the
value of a phase counter to take account of this.
Compare Fig.2. (Without software correction) and Fig.3
(with software correction). In the scope screen grab of Fig.3,
the yellow trace is the output of the Triac and the green
trace is the trigger pulse.
You can see that the trigger pulse period is only 8.5ms
whereas for symmetrical triggering it should be close to
10ms (this is the 100Hz rate which is twice the mains
frequency in Australia) as shown in Fig.3.
User Operation of the DSP Musicolour
The Musicolour has many settings which can be changed
by the user. As mentioned, the preloaded default values
should be adequate for most applications. You can go to
Fig. 3: the same set up as in Fig.2 but with software
correction. The period is now much closer to the correct
value of 10ms. The firmware automatically corrects this
asymmetry when driving the Triacs. It does so in real time
at a frequency twice the mains line frequency.
siliconchip.com.au
the SILICON CHIP website and download more complete
user instructions for the DSP Musicolour that were too
long to include here.
Front Panel
There are seven push buttons on the front panel which
are used to navigate through the menus and change internal settings. Some buttons have multiple functions,
according to context. The SELECT potentiometer is also
context-sensitive and is used to change settings. The
incorporated LEDs in each of the buttons will light depending on the context. Usually, a lit or flashing button
will mean that the button has an active function in the
current menu. When the firmware is executing the main
loop, the LEDs will indicate the state of the output channels and the current operating mode.
Adaptive Potentiometer Controls
The DSP Musicolour firmware implements adaptive
potentiometer controls. This means that if a setting is to
be modified using the SELECT potentiometer, the setting
will begin to change only when the potentiometer position first matches the current value of the setting. This
gives the potentiometer a kind of memory and is used
to seamlessly change internal settings depending on the
current menu.
Menu System
The settings of the DSP Musicolour are changed through
a hierarchical menu system. When the DSP Musicolour
is in the main loop, pressing the SET button allows you
to enter MENU mode.
Keep in mind that some of the behaviour of the Musicolour is dependent on its current settings. For example,
the display will be blank if the screen saver has been set
to NONE and there is no key activity for the period of the
screen saver timeout.
Using the Chaser Modes
Go to the CHASER>Mode sub-menu. Here you can
choose Normal or Triggered modes. In NORMAL mode,
the currently selected Chaser program is executed. In
TRIGGERED mode, the currently selected Chaser program
is executed but the stepping through the program depends
on the trigger (affected by the music). If you are using
TRIGGERED mode, you should know that the triggering
will depend on the current settings for the trigger channel. Go to the TRIGGER sub-menu. There you should set
the pass-band and threshold. Set the mode to OFF to run
the output channels from the FFT.
Once you have set the Chaser mode, you then select
the Chaser Program that you wish to run by going to
CHASER>Program.
Conclusion
As you can see, the DSP Musicolour offers an amazing repertoire of features – far too many to allow us to
describe in detail here.
Next month, we plan to have more information on
driving the DSP Musicolour, as well as an optional PC
board which gives you complete remote control. What?
A lightshow with remote control? You betcha!
siliconchip.com.au
Quick Setup Checklist
Here’s how to set up the DSP Musicolour quickly and the relevant
settings that will affect its operation:
1. Set the ADC system’s sampling Frequency:
go to AUDIO>Sampling Frequency.
2. Set the mixing settings for the input signal:
go to AUDIO>Balance.
3. Set the minimum and maximum frequencies for each logical output channel: go to CHANNELS>Min Freq and CHANNELS>Max
Freq. Alternatively go to CHANNELS>Freq to set a non-overlapping frequency mask.
4. Set the gain for each logical output channel:
go to CHANNELS>Gain.
5. Set the mode for each logical output channel:
go to CHANNELS>Mode.
6. Set the output connections of the logical channels:
go to OUTPUT>Logical Channels.
7. Set the CHASER>Mode and CHASER>Program
8. Exit the menu system.
Tip: Every submenu has a Default option to reset all values in that
submenu to default values.
Simple Setup Guide
Assuming you have a music source connected to an audio amplifier,
connect the output terminals of your amplifier to the speaker terminals
on the back panel of the DSP Musicolour.
Next, adjust the sensitivity of the Left and Right channels using the
LEFT and RIGHT potentiometers on the front panel.
Load default values by going to the menu. Press SET while in the
main loop to be directed to the menu. Scroll down to the DEFAULTS
sub-menu using the UP and DOWN buttons on the front panel.
Press SET to enter the DEFAULTS sub-menu. Scroll down to “Load
Defaults” and press SET. This will restore all default values. Exit the
menu system by pressing CH 4/D (the back button while in menu
mode) and the DSP Musicolour should start running the main loop
in Automatic mode. The output channels will respond to the music.
Remember that the DSP Musicolour has many user options. As
a summary you should know that:
(a) Each of the four physical output channels must be connected
to a logical channel. Two physical channels can be connected to
the same logical channel. Go to OUTPUTS>Logical Channels to
set these.
(b) The input signal source is an arbitrary mix of the Microphone,
Left and Right audio inputs. You set this in the AUDIO>Balance
sub-menu.
(c) The inputs are sampled at the set Sampling Frequency.
Go to AUDIO>Sampling Frequency to set this.
(d) For each logical channel, you should select its pass-band (the
minimum and maximum frequencies). Only frequencies in the
input signal that fall in this pass-band will affect that logical
channel.
(e) For each logical channel, you can select the gain. The higher
the gain the more sensitive the channel will be to pass-band
frequencies in the input signal.
(f) For each logical channel, you should select its mode. This affects how the channel responds to level requests. Choose from
PEAK or AVERAGE acquisition modes. These determine how the
FFT data affects the level of the logical output channel. This level
is interpreted differently according to the whether the channel is
in DIRECT, CONTINUOUS, ZV or STROBE mode. So you should
choose one of these 4 modes as well.
August 2008 83
User Operating Instructions: Menu System
The Musicolour uses a hierarchichal menu system. From the main loop press the SET button to enter the menu system. You will be directed to the main
menu, where you may scroll up or down between sub-menus by using the UP and DOWN buttons. Use the SET button to enter a sub-menu. In any
submenu, you may use the CH4/D button to go back to the previous menu (if you are in the main menu, you will be directed back to the main loop).
Sub-menus available in the main menu:
1. CHANNELS: this sub-menu allows you
to change any settings related to the four
logical channels;
2. TRIGGER: this sub-menu allows you to
change the trigger passband and the trigger threshold;
3. CONSOLE: this sub-menu contains user
applications, allowing the Musicolour to
function as a light dimmer or communications terminal;
4. OUTPUT: this sub-menu is used to set
the chaser mode, the chaser program, the
output rate, the quiescent level of each
physical channel and to define the logical
to physical channel translation;
5. AUDIO: this sub-menu is used to change
the equaliser settings, the software mixing/
balance of the input signal and the sampling
frequency;
6. DEFAULTS: this sub-menu is used to save
and recall settings and to load default
values;
7. ADVANCED: this sub-menu is used to access advanced features, including calibration, software upgrade and tuning;
8. INFORMATION: this sub-menu displays
information about the Musicolour’s operation like the mains frequency, the frequency
of the ADC system and the screen refresh
frequency. The error in the overall accuracy
of the timing system can also be seen;
9. DISPLAY: this sub-menu is used to change
the display’s settings, including the screen
refresh frequency, the screen brightness
and the screen saver time out period;
10. SYSTEM: this sub-menu can be used
to change system settings, the firmware
version is displayed, the baud rate of the
UART can be changed, the remote control
system can be enabled and other system
settings changed;
Here are the major sub-menus used at this
stage:
CHANNEL submenus:
CHANNELS>Min Freq: Press the channel
buttons CH1-CH4 to display the current
minimum frequency for that logical channel;
Use the SELECT potentiometer to change
84 Silicon Chip
the minimum frequency;
CHANNELS>Max Freq: Press the channel buttons CH1-CH4 to display the current maximum
frequency for that logical channel; Use the
SELECT potentiometer to change the maximum frequency;
CHANNELS>Freq: this is similar to the
CHANNELS>Mi n Freq menu, except that
after exiting, the minimum and maximum
frequencies for the four channels are set in
non-overlapped fashion.
CHANNELS>Gain: Press the channel buttons
CH1-CH4 to display the current gain for that
logical channel; Use the SELECT potentiometer to change the gain.
CHANNELS>Mode: Press the channel buttons
CH1-CH4 to display the current mode for
that logical channel; Use the UP and DOWN
buttons to scroll through the available modes;
CHANNELS>Attack: Press the channel buttons
CH1-CH4 to display the current attack rate
for that logical channel; This is only relevant
when the channel is operating in CONTINUOUS mode. Use the SELECT potentiometer to
change the attack rate.
CHANNELS>Decay: Press the channel buttons
CH1-CH4 to display the current decay rate
for that logical channel; This is only relevant
when the channel is operating in CONTINUOUS mode. Use the SELECT potentiometer to
change the decay rate.
CHANNELS>Test Channel: Press the channel
buttons CH1-CH4 to test the relevant logical
channel with a range of output level requests
from 0 to full level; This can be used to test
the current settings for the channel.
CHANNELS>Defaults: Press SET to restore
default CHANNEL sub-menu values;
TRIGGER sub-menus
TRIGGER>Min Freq: Press the UP and DOWN
buttons to set the minimum frequency defining the trigger pass-band. Exit using the SET
button.
TRIGGER>Max Freq: Press the UP and DOWN
buttons to set the maximum frequency defining the trigger pass-band. Exit using the
SET button.
TRIGGER>Threshold: Use the SELECT potentiometer to change the threshold level for the
trigger. Triggering will occur when the input
signal has an amplitude component within
the trigger pass-band that is greater than the
trigger threshold. The level is indicated as
a horizontal bar. Exit using the SET button.
TRIGGER>Defaults: Press SET to restore default
TRIGGER sub-menu values.
CONSOLE sub-menus:
CONSOLE>Dimmer: Press the channel buttons
CH1-CH4 to select the relevant logical output
channel. Use the SELECT potentiometer to
change the output level of this channel. Here
the Musicolour functions as a four channel
light dimmer.
CONSOLE>Com: The Musicolour enters an echo
terminal mode. Received data from the UART
is displayed on the display. The UART can be
enabled using additional hardware.
OUTPUT sub-menus:
OUTPUT>Chaser Mode: the current chaser mode
is displayed. Press the SET button to scroll to
the next available mode.
OUTPUT>Chaser Program: the current chaser
program is displayed. Press the UP and
DOWN buttons to set the program. Press
SET to exit.
OUTPUT>Output Rate: the current output rate is
displayed. Use the SELECT potentiometer to
change the rate; Press SET to exit.
OUTPUT>Quiescent Level: Press the channel buttons CH1-CH4 to select the relevant
logical output channel. Use the SELECT
potentiometer to change the quiescent level
of this channel.
OUTPUT>Logical Channels: Press the channel buttons CH1-CH4 to select the relevant
physical output channel (on the back panel).
Use the UP and DOWN buttons to change
the logical output channel associated to that
physical channel. In Normal operation, you set
CH1=1, CH2=2, CH3=3, CH4=4; if for example,
you wish to have logical channel CH1 control
two physical outputs on the back panel you
could set CH1=1 CH2=1 CH3=3 CH4=4; If you
would like to permute the channels you can
also do that here.
OUTPUT>Defaults: Press SET to restore default
OUTPUT sub-menu values.
AUDIO sub-menus:
siliconchip.com.au
AUDIO>Equalizer: The current equalizer settings
are shown as vertical bars. Use the UP and
DOWN buttons to scroll to the next setting,
and use the SELECT potentiometer to vary the
current equalizer setting.
AUDIO>Balance: the current percentages of each
the three audio channels contributing to the
input signal are shown. Press SET to change
these. The levels are then displayed as bars.
The first bar from the left is the MIC line level.
The next two bars indicate the LEFT and RIGHT
levels respectively. Use the SELECT potentiometer to change the LEFT/RIGHT balance. Use
the UP and DOWN buttons to change the MIC
contribution to the input signal.
AUDIO>Sampling Frequency: the current sampling frequency in kHz is displayed. Press
SET and use the SELECT potentiometer to
vary this value.
AUDIO>Defaults: Press SET to restore default
AUDIO sub-menu values.
DEFAULTS sub-menus:
DEFAULTS>Load Defaults: Press SET to restore
all settings to default values;
DEFAULTS>Save Settings: Press UP and DOWN
buttons to change the memory number to save
to. Press SET to save all current settings to
non volatile memory.
DEFAULTS>Recall Settings: Press UP and DOWN
buttons to change the memory number to load
values from. Press SET to load all settings with
previously stored values.
ADVANCED sub-menus
ADVANCED>Calibration: Press SET to automatically calibrate the Musicolour’s internal fast
RC oscillator against the mains frequency.
ADVANCED>Software Upgrade: Press SET to
upgrade the firmware. This mode requires a
functioning UART connecti on, which needs
additional hardware.
ADVANCED>Tune Oscillator: Press UP and
DOWN to change the internal calibrating value
for the system clock. This value is updated
by the automatic calibration above. You can
manually adjust the value here.
INFORMATION sub-menus
There are no settings to change here. Only
the values of certain system parameters are
displayed. This is for operating information
like the mains frequency, the screen refresh
rate, the sampling frequency, the system
clock, the error in the system timing from
the ideal, etc.
DISPLAY sub-menus:
DISPLAY>Brightness: Press SET to change, us-
siliconchip.com.au
ing the SELECT potentiometer, the brightness
of the display.
SYSTEM>Reset: Press SET to reset the
Musicolour.
DISPLAY>Frequency: Press SET to change,
using the SELECT potentiometer, the screen
refresh frequency. Note that strange display
effects can occur at low screen refresh
frequencies. If this is the case, increase the
frequency. Usually a level around 65Hz or
higher is adequate.
SYSTEM>System Defaults: Press SET to load
SYSTEM submenu defaults.
DISPLAY>Timeout: Press SET and use the UP
and DOWN buttons to select the timeout
period for the screen saver.
DISPLAY>Screen Saver: Press SET and use the
UP and DOWN buttons to select the current
screen saver.
DISPLAY>Display Defaults: Press SET to restore
all DISPLAY submenu defaults;
SYSTEM sub-menus:
SYSTEM>Version: displays the current firmware
version.
SYSTEM>Uart: Press UP and DOWN to change
the baud rate for the UART. This requires additional hardware.
SYSTEM>Remote Control: Press SET to enable
or disable the remote control decoding. This
requires additional hardware and can be
used to control the Musicolour using an RC5
compatible remote control.
SYSTEM>IrDA: Press SET to enable or disable
the IrDA decoding. This requires additional
hardware and can be used to add a wireless
infrared serial port. This can be used to send
and receive data from a PC.
SYSTEM>Test: Press SET to run a test on the
display, the output channels and the LEDs.
Can be used to check that all these are working correctly.
SYSTEM>Detected Mains: this shows the detected mains frequency and is either 50Hz
or 60Hz. It should match your area’s mains
supply frequency.
SYSTEM>Startup: Press SET to scroll through
the start up modes for the Musicolour. The
initial startup can be made quicker by disabling
the normal boot-up messages.
SYSTEM>RF6: Press UP and DOWN to change
the RF6 pin mode. This is an advanced feature
that can be useful to debug any problems
with the Musicolour. The RF6 output of the
microcontroller is a digital output and is available at pin 9 of CON3 on the main board. The
system clock frequency can be measured at
this pin, as well many other internal operating
frequencies like the screen refresh frequency
and the ADC system frequency. You will not
need to normally use this menu.
In Depth Explanation of the Main Loop
In more detail the main loop is as follows:
1. The firmware waits until the internal ADC
system signals that the buffer has been filled
with digitized and software mixed audio
data (while waiting all interrupts are active,
including all timers, key press detection and
display refresh interrupts);
2. Once a full buffer of data has been acquired,
the Fourier Transform is computed;
3. For each logical output channel, a level
corresponding to the channel is computed.
This may involve adjusting the output of the
FFT with equalization, it will depend, for each
channel on its selected acquisition mode;
4. A request is made, for each logical output
channel to set its output level to the previously computed level. The implementation
of this step is dependent on the channel’s
current setting. If a channel should be accepting data from an active chaser program,
the level requested in this step is ignored;
5. If a Chaser program is active, it is serviced
by the virtual machine; This may involve the
triggering channel if the program is in trigger mode; Any output level requests made
by the chaser program are set. Again, the
implementation of this step is dependent
on the channel’s current settings;
6. The display is refreshed according to the
currently selected display:
1. Spectrum Fine: the spectrum is displayed
on the display;
2. Spectrum Centered: the spectrum is display
in centered mode;
3. Logical Channel Displayed Single: the output
levels of each channel are displayed. The
top horizontal bar indicates the first logical
channel. The third horizontal bar from the
top indicates the second logical channel.
Similarly, the fifth and seventh horizontal
bars from the top indicate the third and
fourth logical channels respectively.
4. Logical Channel Display Averaging: same
as 3. above except every horizontal bar
in between the output channel bars is the
average of the previous and next bars.
5. RMS display: displays the RMS level of the
input signal as an analog meter.
6. The firmware updates any LEDs on the front
panel and returns to step 1. It also responds
to key presses.
August 2008 85
FRO NT
SEC ON DARY
100 nF
E NIL N OITAL OSI
ISO LATION
220 Ω
220 Ω
220 Ω
PIN
3:
4.7k
0V
100 nF
10k
100 k
+
5.6nF
10k
10k
10k
CON 2
1k
47 µF
IC2 LM3 24
4148
PIN 5:
+5V DC
220 Ω
270 Ω 1W
+
1k
470 Ω
100 nF
dsPIC 30F4 011
IC1
+
Problem:
You apply power and there is a sudden short of the mains
supply (consequently the fuse blows or the circuit breakers/
fuse in your home open). There seems to be a short of the
mains supply.
Possible Cause:
This could be caused by incorrect link settings for LK1, LK2
and LK3 underneath the mains transformer.
first” mode
If all goes to plan, you’ll bui
ld the DSP Musicolour, turn
it on . . . and1kit will work per
TRANSFO RM ER
fectly, first time.
But what if it doesn’t?
4148
D8
100 Ω
+
We’ve warned a number of
TP0
470 times tha
t the Musicolour
must not be run with the lid µF
off and the ma
TPI ins connected.
It is simply too dangerous. D11
So how can you work on an
unpowered circuit?
D12
LED8
T1
Obviously, you can’t. But D13
fortunately, all of the log
30V
D14
icA 7.5 V
and processing circuitry (inc
luding the dsPIC) can be
run from a 5V DC supply (ra
ted at 500mA or so) so you
can troubleshoot with safety 4700µF
.
If you need to poke around 16V
the Musicolour, CON3 can
LK5 LK6
be used to supply pow
er to the100
circ
Ω uit. Simply
+5V to pin 5 and 0V to pin
100con
Ω nect
3 of CON3 and all of
100the
Ω lowvoltage circuitry will be pow
1 µF
ered, up to and including the
D10
fou
r opto-couplers. DON’T plu
g in D9
the mains lead!
1k
Problem:
You apply power and there seems to be no activity, there is
no display.
Possible Cause:
Is the fuse blown? Have you installed a fuse?
8 0 0 2/ 4 0 G M
RU OL O CISU M
Troubleshooting in “safety
YRAD N O CES
Some common problems that may help you troubleshoot
the DSP Musicolour.
1 8 0 7 0 1 0 1 CS
REG 1
LM3 17T
CON 1
4148
Troubleshooting Tips:
TNORF
+
33k
33k
3.3k
OPTION AL
Problem:
9
1
Section +
270 Ω 1W
10
2
One or both voltages at test points TP0 and TP1 are not at LINK
47 µF
of full MIC
normal levels around +5V and +10V respectively.
270 Ω 1W
overlay
Possible Cause:
from the
CON 3
68nF
68nF 68nF
One possible cause is that links LK1, LK2, LK3 are impropJuly 2008 68nF
erly set or omitted. Remember these have to be installed
SILICON CHIP
according to the mains supply voltage. Install LK2 and omit
LK1 and LK3 if you are using a 220-240V mains supply;
install LK1 and LK3 and omit LK2 if you are using a 110-120V mains supply. These links are
found under the mains transformer, so you may have to unsolder the transformer to change them. If you have erroneously configured these links for 110-120V operation while you are actually in a 220-240V region of the world, you will
get double the intended voltage at test-point TP1. This can very easily destroy REG1 and cause further damage to the
main PC board. Disconnect power immediately if the voltages at TP0 or TP1 are much higher than their intended values.
Problem:
The main board seems to be operating correctly, except nothing is shown on the dot matrix LED display.
Possible Cause:
The most common cause of this problem is that the 26-way ribbon cable connecting the main board and the display
board is either faulty, not all connections are good, or it is incorrectly oriented. If you can verify that the ribbon cable’s
26 connectors are good, it may indicate a fault with incorrectly oriented parts. Check the transistors and ICs are correctly oriented on the display PC board. Check also that the dot matrix LED modules are in their sockets the right
way around.
Problem:
At least one key does not respond to key presses or its LED does not light up.
Possible Cause:
This is most likely caused by the tactile switch being incorrectly oriented, improperly soldered, or its accompanying
diode being incorrectly oriented.
Problem
When in a menu, moving the SELECT potentiometer does not affect the setting, or does so after much turning.
Possible Cause:
This is most likely not a problem but a feature. It is called adaptive control. See the text for an explanation.
Tips and Tweaks
Notice that if the display frequency is set too low you may see strange effects on the display. Increase the screen refresh
frequency if this occurs. Also, if the sampling frequency is lower than twice the highest frequency of the input audio,
aliasing will occur.
86 Silicon Chip
siliconchip.com.au
OPTO 1
MOC 30
|