Guitar Effects Pedal using the MachXO2 FPGA by 8tDh90y


									Guitar Effects Pedal using the MachXO2 FPGA


This Echo/Reverb Guitar Effects Pedal is designed using the new Lattice MachXO2 FPGA and
provides 8 programmed presets capable of providing high quality Echo, Reverb, or combined
Echo/Reverb guitar effects. Only 3 digital LSI ICs: the MachXO2, a 24 bit audio Codec, and an
8 Mb SRAM plus some analog circuits provide everything needed for audio signal processing.

Functional Description

The drawing below illustrates the simplicity and design of the Effects Pedal user interface.

To reduce cost and simplify the user interface, preset settings are programmed using a rotary
“Select” switch (Gray Encoder), a 3.5 digit LCD, and a rotary “Adjust” switch (Quad Encoder).
The “Select” switch selects programmed presets 1-4 (red LED) or 5-8 (green LED) when the
corresponding footswitch is pressed. After first selecting the preset to be programmed, the
“Select” switch is used to make adjustments to the selected preset setting. As the “Adjust”
button is rotated, the LCD display shows the changes.
Block Diagram

Circuit Description

The Echo/Reverb Block Diagram shows that the MachXO2 is the central IC providing both user
interface control and audio signal processing. Other ICs include a 24 bit audio CODEC
(PCM3060) and an 8 Mb SRAM (CY62157EV30). Input audio processing consists of a discrete
transistor input level amplifier and a FET bypass switch. The input amplifier contains a dual
FET/dual bipolar circuit with AD7376 digital potentiometer providing an input gain of -6 to +24
db. The Output level is adjusted inside the CODEC. Both the input gain and the output level are
controlled by the MachXO2 SPI bus. The 8Mb SRAM is used for Echo and Reverb signal
processing. A 16.384 MHz oscillator provides a 32KHz CODEC sample rate, a 61nsec SRAM
cycle time, and a 32.768 MHz MachXO2 clock (2x PLL) for audio signal processing. The 32
KHz sampling rate and the 8 Mb SRAM provides 8.192 seconds of 32 bit storage for echo and
reverb algorithms. The system is designed to use a standard 9v pedal power source.

MachXO2: User Interface Circuit Description

The LatticeMicro8 microcontroller (open IP core) provides 32 8 bit registers and uses 18 bit
instructions to reduce program memory space. The micro is attached to three harden cores:
SPI master, two 1K x 9 bit dual port RAMs (128 word block), and part of the UFM Flash
memory (6K x 8 block). In addition, the micro is connected to two open IP cores: the Wishbone
interface and the LCD controller. All input and output ports connect through the Wishbone
interface to the Micro8.

The LCD controller interfaces to a 3.5 digit 3 VAC static display using 24 segment bits and 1
common. A 128 word dual port ram provides the 16 bit delay addresses, 8 bit coefficients, and
8 bit MAC/MUX control used by the audio signal processing section. The 6K x 8 UFM flash
memory stores 9 different echo algorithms, 9 different reverb algorithms and the data for 8
presets. This includes data for the 128 word dual port ram, echo type, reverb type, effects level,
AD7376 digital potentiometer (SPI data), and the PCM3060 (SPI data). The flash memory also
stores LED data, user states, and the LCD segment lookup table.

MachXO2: Audio Signal Processing Circuit Description

The audio signal processing section uses two IP cores: I2S master receiver and I2S master
transmitter. The remaining circuits are split into 3 sections: (1) memory address calculation, (2)
audio controller state machine, and (3) audio data signal processing.

The 8 Mb SRAM is split into 2 different large dual port memories with address wrap around to
handle continuous audio streams. The MSB address bit splits the memory into an echo memory
and a reverb memory. This means that the maximum time for echo or reverb processing is
4.096 seconds. The current write address for echo and reverb processing are held in the echo
and reverb 17 bit counters; these increment with each sample clock. The selected counter
value is added to 0 and stored in bits 1-18 of the address latch. Bit 19 is the Echo/Reverb bit
and bit 0 is the high/low bit to handle 32 bit values. The 128 word dual port memory provides 16
bit offset values that are loaded into bits 1-16 of the address offset latch (bit 0 = “0”). The offset
value is added to the current echo or reverb counter for all data that is read back from the

The audio controller state machine has 1024 clock cycles (512 61 nsec SRAM cycles) to do
echo and reverb processing between sample clocks. Echo processing is simple and requires
less than 10 clock cycles while reverb processing takes the remaining cycles. Reverb
algorithms combine early reflection processing with longer reflection processing to simulate hall,
room, plate, and other reverb sounds. The audio controller uses different combinations of delay
offsets and coefficients to create these reverb effects. The 128 word dual port memory provides
all delay offsets, coefficients and MAC/MUX control for calculating echo effects, early reverb
reflections, and long reverb reflections.

Audio data from the CODEC is converted from 24 bits into 24.8 bit data (sign extended) that
flow through the MUX and the signed MAC into the SRAM write register. Two write cycles are
used to write the 32 bits into the SRAM. The signed MAC consists of an 8 bit by 24.8 bit signed
multiplier with 32 bit output, signed 32 bit adder, and four accumulators. Input to the 32 bit side
of the multiplier is selected from audio in, SRAM, or one of the four accumulators. The signed
multiplier is designed to handle multiplication of 24.8 bit audio samples by an 8 bit signed
coefficient value that is between +1 and -1. The master accumulator is used for general
processing and as an input to the adder while the other input is from the multiplier. The other
three accumulators are used for storing partial calculations. After all processing, the final data is
converted from 32 bits back to 24 before being transmitted to the DAC in the audio CODEC.

The Echo/Reverb Guitar Effects Pedal uses the MachXO2 as the main integrated circuit of a
three IC system to provide a low cost guitar effects pedal with excellent audio performance,
simple user interface, programmed sound effects, and 8 preset selections.

To top