This is only a preview of the May 2022 issue of Practical Electronics. You can view 0 of the 72 pages in the full issue. Articles in this series:
|
Digital
FX Unit
Our new Digial FX Unit, introduced last
month, can produce 15 different effects
for musicians or recording technicians to
customise their instruments and sounds.
You can customise eight of those
effects – and this article describes how
to create and install different effects
patches into the unit’s EEPROM.
W
hile we have included a great variety of
pre-programmed effects in the EEPROM supplied
for our new Digital FX Unit (adding to those already present within the SPIN FV-1 chip), you might want
to change some of these effects patches. That will ensure
that the Digital FX Unit has the effects you want.
Numerous effects patches can be freely downloaded.
If you are an avid programmer, free software is available
with graphical programming to write your own effects
patches – more on that later.
To program the Digital FX Unit’s EEPROM, you need an
EEPROM programmer suitable for the 24LC32A. We will
describe how you can do this with a Microchip PICkit 2 or
PICkit 3 programmer. (Do see the box on page 25.)
Available effects patches
First though, let’s look at the premade effects that are freely available.
There is a reasonably comprehensive
list at: https://mstratman.github.io/
fv1-programs/
In that set of listings, you can
see details for each by selecting the
‘MORE’ box. This additional information often includes details on the
functions of VR7 (A control), VR6 (B
control) and VR5 (C control) on the
Digital FX Unit. These are labelled
as 1, 2 and 3 in the program listings.
The assembler program for the selected effects patch can be downloaded from
the site by choosing the cyan ‘Download
SpinAsm’ link at the bottom of the effect
patch detail area (see Screen1 opposite).
If you want to access more programs,
these are available directly from the
SPIN semiconductor website at:
www.spinsemi.com/programs.php
20
Part two – by John Clarke
You can download these files to any folder you like, as
long as you remember where you put them.
Collation
Once you have all your selected effects patches, these will
need to be collated in a form suitable for programming into
the EEPROM. Each effects patch is placed into a separate
512 x 8-bit memory block, and there are eight such memory blocks in the 32kbit EEPROM. To generate the required
data, you will need to use the Spin Semiconductor assembler called ‘SpinAsm’ (note: Windows only).
SpinAsm can be downloaded from the Spin Semiconductor website linked above; it is called ‘SpinAsm assembler
for the SPN1001 V1.1.31 (Windows executable)’.
Patch
1
2
3
4
5
6
Effect
Chorus-reverb
Flange-reverb
Tremolo-reverb
Pitch shift
Pitch echo
Test
Adjustment C
Chorus mix
Flange mix
Tremolo mix
Echo mix
-
Adjustment B
Chorus rate
Flange rate
Tremolo rate
Echo delay
-
Adjustment A
Reverb mix
Reverb mix
Reverb mix
±4 semitones
Pitch shift
-
7
8
Reverb 1
Reverb 2
Low filter
Low filter
High filter
High filter
Reverb time
Reverb time
9
10
Octaver
Pitch shift glider
Down octave level Up octave level
Glide
Depth
11
Oil can delay
Feedback
Chorus width
12
Soft clip overdrive
Tone
Volume
13
Bass distortion
Dry/wet mix
Tone
14
Aliaser
15
Wah
Filter Q
Sensitivity
16
Faux phase shifter Feedback level
Time
Table 1: preprogrammed effects patches (9-16 can be changed)
Dry mix
Rate
Time rate
Gain threshold
Gain
Sampling rate
Reverb
Speed width
Practical Electronics | May | 2022
Table 2. ICSP header pin mapping.
ICSP
header pin
24LC
Function
EEPROM pin
1
-
MCLR / Vpp
2
8
Vdd (positive supply)
3
4
GND / Vss (0V)
4
-
PGD (Data)
5
6
PGC/SCL (Clock)
6
5
SDA (Data)
Table 2: ICSP header pin mapping
See last month for all
the construction details
for the Digital FX Unit.
If you need more information regarding installing this
program, see the installation guide later in this article.
Once you have installed SpinAsm, move the saved
effects patch files (.spn extension) to the folder:
C:\Program Files (x86)\SpinAsm IDE\spinsrc
To open the SpinAsm program, right-click on the
SpinAsm icon and select ‘Run as Administrator’. (If you do
not run as Administrator, your work will be not be saved.)
You will be asked whether you want this app to make
changes to your computer. After clicking ‘Yes’, the program
opens. Left-click on the ‘Open Project Dialog’ icon just to
the right of the Spin icon (see Screen2).
This opens up a table of PROG0 to PROG7, where
you can place the required effects patches, as shown in
Screen3. To select the first effects patch, right-click on the
PROG0 box in the (UNCHANGED-NO OVERWRITE) area
and select Load File Entry from the project dialog box
(Screen4). Then, select the required file from the folder:
C:\Program Files (x86)\SpinAsm IDE\spinsrc\
Note that you can change the directories for file locations
by selecting the tree icon just to the right of the project dialog icon (Screen5). However, we will describe the setup
using the default directory locations, as shown.
With the first patch selected (Screen6), use the same
technique to load the patches for PROG1 to 7. You do not
need to load all PROG locations if you don’t need all eight
effects used. However, do note that the programs you wish
to load must start at PROG0 and continue with successive
PROG locations.
Screen1: you can download a range of pre-made effects
patches from the Spin Semi website as ‘SpinASM’ files.
These can then be compiled and uploaded to the EEPROM
on the Digital FX Pedal.
Practical Electronics | May | 2022
It is fine to have the UNCHANGED-NO OVERWRITE comment after the last program entry if you do not fill up all the
possible programs.
This is meant for use with the SPIN development board.
It allows single-location programming without affecting the
other programmed locations in EEPROM. We don’t use
that feature, however.
Once all the required programs are loaded, select the
Save button and save the project under a suitable name.
We named ours SC Patches.spj – see Screen7.
Once saved, select the ‘Intel Hex’ checkbox in the lowerleft portion of the project dialog box and press the ‘Build’ button. The HEX file will then be saved to the following folder:
C:\Program Files (x86)\SpinAsm IDE\hexout. It will be
named the same as the project saved, but with a .hex extension.
In our example, it is SC Patches.hex – this is the file you
need to program into the EEPROM. If the hex file and project file were not saved, that probably means that SpinAsm
was not run as an Administrator.
Programming the EEPROM
There are several ways to program the EEPROM. If you
have an EEPROM programmer suitable for the 24LC32A,
that would be the easiest way to do it.
If you have a Microchip PICkit 2 or PICkit 3, you can
program the EEPROM using free software that you can
download from Microchip’s website. We are not using
MPLAB X IPE, as we would for PICs, as it does not support this EEPROM.
For PICkit 2, download the software. PICkit 2 Firmware V2.32 and user’s guide PICkit 2 Microcontroller
Programmer User’s Guide. Both can be found at: https://
bit.ly/pe-may22-pk2
This is very similar to the PICkit 3 programming software that we now describe.
The PICkit 3 is the successor to the PICkit 2, and while
PICkit 2 is suitable for directly programming the 24LC32A
EEPROM, the PICkit 3 requires some modifications. It also
Screen2: use the Open Project Dialog button in SpinASM to
load one of the effects patch ASM files you have downloaded.
21
Screen3: when loading a SpinASM file, you will be prompted
to select which of the eight available EEPROM slots it should
go into. See our comments in the text about large (512-byte)
patches needing to go into the last slot (PROG 7).
Screen4: after right-clicking on one of the slots, you are
presented with a menu. Select the ‘Load File Entry’ option,
and you will be prompted to choose a file to load into that
slot.
needs to be loaded with a PICkit 2 emulator to work.
In this article, we describe how to program the EEPROM
using the Microchip PICkit 3 programmer, as that is the one
we think readers are most likely to have. We tested one clone
version of PICkit 3, and found it would not connect correctly.
Different clone versions might work, but we cannot recommend using anything but the genuine Microchip PICkit 3.
The Digital FX Unit includes an in-circuit serial programming connection (ICSP) suitable for programming
the EEPROM. The PICkit 2 or PICkit 3 plugs directly onto
the ICSP header. However, you might need to use jumper
wires to make suitable connections to the ICSP header for
other programmers.
Table 2 shows the connections from the ICSP header pins
to the EEPROM on the Digital FX Pedal PCB.
EEPROM pin 7 is disabled and connected to GND. Pins
1, 2, 3 are the address pins and are connected to Vcc or
Vdd, depending on the application.
However, you can also do it with a regular iron, by alternately heating the joints while holding it with tweezers,
until the part comes loose.
Modifying the PICkit 3
To enable the PICkit 3 to program the 24LC series of EEPROMs, TR3 (a diode) and R50 (a resistor) need to be removed from inside the PICkit 3. Crack open the case and
locate the components. These are labelled on the PCB screen
printing, as shown in Fig.1.
Desolder these, taking note of TR3’s orientation and keep
the parts in a safe place for replacing later on. The easiest
way to do this is with a hot air rework station, gently heating the components while holding them with tweezers.
Screen5: you can change the default folders where files are
loaded and stored by the SpinASM, although we decided to
stick with the defaults.
22
PICkit 2 programmer emulator
The software to use the PICkit 3 to program the EEPROM
can be downloaded here: https://bit.ly/pe-may22-pk3
If you aren’t sure how to install this software package,
see the separate section below.
Before starting the PICkit 3 programmer, you need to
connect the PICkit 3 to the computer. This so that the program will run correctly at startup.
Having installed the software linked above, navigate to
C:\Program Files (x86)\Microchip\PICkit 3 v3\ and start
the PICkit 3 application, or place a shortcut on your desktop and use that. The programming software will open, and
state that the PICkit is connected (Screen8).
Under the Tools menu, select ‘Download PICkit Operating System’ (Screen9). This is the PICkit 2 emulator. Select
the file C:\Program Files (x86)\Microchip\PICkit 3 v3\
PK3OSV020005.hex (installed with the software; see
Screen10) and the PICkit 3 will be loaded with the required firmware. Then, in the Device Family menu, select
EEPROMS and 24LC (Screen11). Next, find the 24LC32A
entry under the Device dropbox (Screen12).
Next, using the File menu, load the Spin.hex file located at C:\
Program Files (x86)\SpinAsm IDE\hexout\SC patches.hex
(or whatever name you saved it under).
Screen6: the SpinASM files have an extension of .spn, and
here we have loaded the new octaver effect into the first
slot, PROG 0.
Practical Electronics | May | 2022
Screen7: a standard file dialog is presented when you opt to
save your project (.spj file). Note that we have loaded all eight
slots with different effects. Choose a memorable file name.
Once this file has been loaded, the EEPROM can be
programmed. First, make sure one of the first eight effects
is selected so the FV-1 chip will not access the EEPROM
during programming. Then connect the PICkit 3 to the ICSP
header, with its triangle to pin 1, and switch on power to
the Digital FX Pedal. Do not select the option of target power via the PICkit. Then click the ‘Write’ button to program
the EEPROM – see Screen13.
Before closing the program, in the Tools menu, select the
‘Revert to MPLAB mode’ option to restore the PICkit 3 to normal operation, suitable for use with MPLAB (see Screen14).
When closing this program, it is not unusual to see an ‘unhandled exception’ dialog box appear, as shown in Screen15.
Click ‘Quit’ to close it. The program may take a while to close;
you might have to force close it using Windows Task Manager.
If you are finished programming, you can reinstall TR3
and R50 on the PICkit 3 board, to restore its full PIC programming function.
Fig.1: we temporarily removed two components from the
PICkit 3: diode TR3 at far left, and resistor R50 just above the
programming socket. These interfere with EEPROM programming. Keep the parts as you can reinstall them later if you
want to turn the PICKit 3 back into a PIC programmer. Note
the original orientation of TR3 (cathode stripe towards PTC4).
Catch 22
If an effects patch fills the entire 512 x 8-bit memory
block, it must be placed in the last used PROG position.
Otherwise, that effect will not work, as its data will be corrupted. The catch is that you won’t know as the corrupted
file will have similar ending values to the other patches.
The hex files are easily viewed in the PICkit 3 Programmer software. Typical effects patches do not fill the entire
512 bytes, and the unused memory is filled with 00s and
11 at every 4th location.
So a corrupted file will not be evident until it is tested and found not to work. Swapping the non-working
patch to the end of the list by reordering the PROG selections should solve this. It also means that you can
only use one effects patch that fills the entire allocated
memory section.
We found that the ‘Faux-phaser-2’ patch did not work
when it was placed in PROG6 position. Moving it to the
PROG7 (last) position made it work. We then realised that
the code for this patch filled the full 512 bytes. When this
patch was in PROG6, the 512 bytes were not completely
filled with code, showing that it was corrupted. Note that
each PROG entry has its own address range:
Screen8: this version of the PICkit 3 programming software
can program EEPROMs. Note the message in the yellow
shaded box indicating that it has detected the hardware.
Screen9: use this menu option to load firmware into the
PICkit 3 to emulate a PICkit 2. This is required to program
the type of EEPROM we are using.
Practical Electronics | May | 2022
23
•
•
•
•
•
•
•
•
PROG0: 000 to 1FF
PROG1: 200 to 3FF
PROG2: 400 to 5FF
PROG3: 600 to 7FF
PROG4: 800 to 9FF
PROG5: A00 to BFF
PROG6: C00 to DFF
PROG7: E00 to FFF
Navigate to the SpinCAD Designer folder and open the
Spin CAD-designer-1027 jar file. This will start SpinCAD
Designer. Note that the patches folder for SpinCAD Designer includes many effects patch files that have already
been written, in a compressed format. These are included
as SpinCAD files as well, as SpinAsm files. These can be
used as examples to get you started.
Home-grown effects
Writing your own effects, or modifying existing effects
patches, can be done using SpinAsm, or you can use a
graphical programming package called SpinCAD Designer.
You will need to do some reading to be conversant with
how to write the required code. You can also load some of
the already-written effects patches to use as examples. The
SPIN Semiconductor website has much of the required information. It is recommended that you read the knowledge
base section: https://bit.ly/pe-may22-spin
This has information on the FV-1 architecture, instruction set, DSP basics and coding examples to list a few. You
would also benefit from reading the data sheet and the user
manual. These are found at https://bit.ly/pe-may22-spin2
and https://bit.ly/pe-may22-spin3
SpinCAD Designer
SpinCAD Designer is an open-source Java project
which allows the creation of patches for the Spin FV-1
audio DSP chip using graphical instead of text coding. SpinCAD is available from https://github.com/
HolyCityAudio/SpinCAD-Designer
If you need help installing this, see the separate section
on installation.
Screen12: you can now select 24LC32A from the Device
dropdown at upper left, then use the File menu to open the
EEPROM HEX file you generated earlier.
Screen10: having selected the option shown in Screen9, the
next step is to find the file shown here, This file is included
with the software download and should be on your
computer in the location described in the text.
Screen11: with the PICkit 2 emulator loaded, select the
24LC EEPROM device from the Device Family menu.
24
Screen13: with the programmer connected to the powered
Digital FX Pedal, the Device selected and the HEX file loaded,
click the Write button to program the effects into the EEPROM
chip. You should be greeted with the Programming Successful
message on a green background. Unplug the programmer and
test all the effects to check that they are working as expected.
Practical Electronics | May | 2022
The example shown in Screen16 is a test patch written
for a ring modulator in Patch0. It includes a 6-band equaliser and ring modulator adjusted with Pot 0.
It took me only a few minutes to create, and probably
is not a very good effect, but it does show that the graphical program is very useful and effective for developing an
effects patch.
Once you have created a patch, it can be saved as an assembler file and then loaded into SpinAsm and converted
to the Intel hex format using the ‘Save Patch as ASM’ option in the File menu (see Screen17).
Screen17: once you have created your effect in SpinCAD
Designer, select the ‘Save Patch as ASM’ option to get a file
that you can program into the Digital FX Pedal using the
procedure described in this article. It’s also a good idea to
use the ‘Save Patch’ option to save it in a format that will
allow you to make changes in future!
Screen14 (left): after you have finished your EEPROM
programming, if you want to revert the PICkit 3 to normal
operation, in addition to refitting the two components
removed earlier, you will have to select this menu option to
re-load its original firmware.
Digital FX Unit build options
There are two choices to make when building this project.
1) Effects selection device
As explained last month, you need to choose which
type of device you want to use to make effects
selections: either a (possibly hard-to-source) 4-bit BCD
switch, or a potentiometer/PIC combination, and from
there choose the relevant PCB.
Screen15: do not be surprised if you get this error message
upon closing the programming software. Click Quit.
You might need to launch Task Manager (eg, by pressing
Ctrl+Alt+Del) to kill the process if it lingers.
2) EEPROM programming
This month, we explained the method for programming
the EEPROM. While it is a somewhat involved process,
it is not actually that difficult, but we would not
recommend it for beginners or those new to device
programming with PICkits.
If you are happy with the default effects and/or handprogramming the EEPROM is not for you then preprogrammed EEPROMs are available from the PE PCB
Service (see the May 2022 section). We are also selling
the pre-programmed PIC for the potentiometer effects
selection option (see above).
PICkit 2, 3 and 4
You will have noticed that we reference PICkit 2 and 3
to program the EEPROM. While they are no longer sold
by Microchip, they are easy to buy used from eBay;
typical prices are around £20. Do ensure you buy a
Microchip-branded programmer and not a clone – they
are often made to ‘look’ similar.
We do not recommend using a PICkit 4 to program the
project’s EEPROM.
Screen16: SpinCAD Designer allows you to design effects
patches without having to write assembly language code. The
graphical designer is easy to use, and once you know what
you are doing, you can create an effect very quickly indeed.
Practical Electronics | May | 2022
Reproduced by arrangement with
SILICON CHIP magazine 2022.
www.siliconchip.com.au
25
Installing SpinCAD Designer
You can download SpinCAD from: https://github.com/
HolyCityAudio/SpinCAD-Designer
Click the green ‘download code’ button towards the upper
right-hand corner of the page (see Screen18), then select ‘Download I . aving downloaded the file, e tract its contents to a
suitable directory such as: C:\Program Files\SpinCad Designer
Select ‘Save File’, then once it has downloaded, open it. It might
ask you whether you want this app (from an unknown source) to
make changes to your computer.
Select ‘Yes’, then agree to the terms and conditions and select the
standard setup option (Screen20).
Screen20: the default options to install SpinAsm IDE will
suit most users.
Click ‘Next’ to continue, then click ‘Install’ (Screen21).
Screen18: you need to extract the SpinCAD Designer
software zip before you can use it. You can accept the
default destination, as shown here, or alter it before
continuing.
To run SpinCAD, you will need the Java Runtime Environment
JRE/JDK 1.8 or later installed. You can get this from: www.java.
com/en/download/
fter downloading ava, run the e ecutable file and agree to
allow it to make changes to your device. Click through the following steps to install the Java runtime environment.
Now you can navigate to the folder where you extracted SpinCAD
esigner earlier, and launch the pin
designer
ar file.
Screen21: you can change the SpinAsm IDE installation
folder, but we left it at the default.
When you are prompted to install the driver (Screen22), click
‘Next’, then ‘Finish’ (Screen23) and installation is complete.
Installing SpinAsm
When you click on (or type in) the link to download
SpinAsm, you might get a dialog box like the one shown in
Screen 19.
Screen19: when you click the link to download Spin,
depending on what web browser you are using, you will
probably be faced with a save dialog something like
this. You will need to click ‘Save File’ and allow it to
download before launching the installer.
26
Screen22: as part of the SpinAsm installation, you will also
need to install the SpinAsm drivers, which will require you
to click through some more permission dialogs.
Practical Electronics | May | 2022
ESR Electronic Components Ltd
All of our stock is RoHS compliant and CE
approved. Visit our well stocked shop for
all of your requirements or order on-line.
We can help and advise with your enquiry,
from design to construction.
Screen23: after SpinASM itself is installed, the driver
installer will launch. Click Next to complete the setup.
3D Printing • Cable • CCTV • Connectors • Components •
Enclosures • Fans • Fuses • Hardware • Lamps • LED’s •
Leads • Loudspeakers • Panel Meters • PCB Production •
Power Supplies • Relays • Resistors • Semiconductors •
Soldering Irons • Switches • Test Equipment • Transformers
and so much more…
Monday to Friday 08:30 - 17.00, Saturday 08:30 - 15:30
Installing the PICkit 3
Programmer software
The software ip file the link is under I kit programmer emula
tor in the main body of this article is in a compressed format, often
described as an archive .
pen the file and select e tract all , accepting the default folder
sers username ownloads I kit rogrammer pplication
v . , as shown in creen .
ou can change the default e traction path if you like it doesn t
matter since, once installation is complete, you can delete the
folder entirely.
Station Road
Cullercoats
North Shields
Tyne & Wear
NE30 4PQ
Tel: 0191 2514363 sales<at>esr.co.uk www.esr.co.uk
JTAG Connector Plugs Directly into PCB!!
Screen24: now that it has been installed, you can click
Finish and launch the software.
ith the bo at the bottom ticked, the folder should appear as
soon as the e traction process has finished. hen that happens,
launch the setup e ecutable normally done by double clicking
on the file . se the default settings and file locations and agree
to the conditions.
The installer will ask permission to install the software. pon
clicking es , the installation will begin. hen completed, close
the installer.
To save disk space and reduce clutter, after the installation has
completed, you can delete the e tracted installation folder, as the
files will have been copied elsewhere on your system.
Reproduced by arrangement with
SILICON CHIP magazine 2022.
www.siliconchip.com.au
Practical Electronics | May | 2022
No Header!
No Brainer!
Our patented range of Plug-of-Nails™ spring-pin cables plug directly
into a tiny footprint of pads and locating holes in your PCB, eliminating
the need for a mating header. Save Cost & Space on Every PCB!!
Solutions for: PIC . dsPIC . ARM . MSP430 . Atmel . Generic JTAG . Altera
Xilinx . BDM . C2000 . SPY-BI-WIRE . SPI / IIC . Altium Mini-HDMI . & More
www.PlugOfNails.com
Tag-Connector footprints as small as 0.02 sq. inch (0.13 sq cm)
27
|