FPGA Based Theremin Project: : Cora Z7 Theremin Shield

This page describes design of theremin shield for Cora Z7

Connected to Cora Z7 board using Arduino/Chipkit connector.

Two on-board PMods of Cora board are left unused for future extensions.

Contains additional microSD card socket.

Used to connect other boards

Design

The purpose of Theremin Shield is intefacing between FPGA board and peripherials.

The only peripherial placed on shield is MicroSD card socket.

The rest of peripherials are being connected via various connectors.

Based on chosen hardware components, it's necessary to plan available FPGA board pin usage.

Waveshare 4.3" 800x480 TFT Capacitive Touch Screen

TFT Touch screen with RGB interface requires a lot of FPGA pins. Only RGB data needs 24 (8 * 3) pins.

To minimize FPGA board pins usage for TFT, it was decided to reduce color resolution of display from 8 to 4 bits per component. Lower 4 pins of each component are wired to upper 4 bits. This approach allows to keep full range 0x00..0xff of component values equally distributed with 0x11 step - instead of 0x00..0xf0 if it decided to set lower components to 0.

Although LCD Touch screen allows to control virtually any device features, often it's feasible to have hardware controls. There is Encoders board with 5 incremental encoders and one button. Multiplexing is used to reduce number of required pins from 16 to 5.

There are 6 single ended analog inputs (ADC) on Cora Arduino/Chipkit connectors. They can be used as analog inputs from pot based pedals (expression pedals).

Since there were several unused pins on FPGA board after assignment of main peripherial devices, I decided to add MicroSD Card on shield.

Display supports both FPC and IDC connectors. Both types of connectors are traced on shield PCB. Although, FPC/FCC connector is really hard to solder. Probably, it makes sense to use IDC.

LCD interface pin assignment: IDC40 connector (J1)

Please note: odd/even pins are mirrored comparing with Waveshare LCD pins assignment

LCD pin headerCora Z7 pinSignalDirection
Touch controller
1IO41Touch IRQInput
25V5+5VPower Output
3n/cn/cn/c
4SDATouch I2C SDABidirectional
5SCLTouch I2C SCLOutput
6IO40Touch ResetOutput
Backlight control
7IO5LCD Backlight PWMOutput
8GNDGNDPower Output
9n/cn/cn/c
10n/cn/cn/c
Red data
11IO13R0 = R4Output
12IO39R1 = R5Output
13IO12R2 = R6Output
14IO38R3 = R7Output
15IO13R4Output
16IO39R5Output
17IO12R6Output
18IO38R7Output
Green data
19IO11G0 = G4Output
20IO37G1 = G5Output
21IO10G2 = G6Output
22IO36G3 = G7Output
23IO11G4Output
24IO37G5Output
25IO10G6Output
26IO36G7Output
Blue data
27IO9B0 = B4Output
28IO35B1 = B5Output
29IO8B2 = B6Output
30IO34B3 = B7Output
31IO9B4Output
32IO35B5Output
33IO8B6Output
34IO34B7Output
LCD clock and control signals
35IO7PXCLK - pixel clockOutput
36+3.3V via 10K RDISP - display enableOutput
37IO33HSYNC - horizontal syncOutput
38IO6VSYNC - vertical syncOutput
39IO32DE - data enableOutput
20GNDGNDPower Output

PMod adapters

PMod connectors for I2S2 and AMP3 PMods are made using custom pmod adapter boards - to place PMods above shield.

There are two audio PMODs used in this theremin design

I2S interface of both pmods reuse the same clocking signals: MCLK (master clock), WS(RLLK), SCLK(data clock)

I2S2 PMod uses 2 data pins - one for line in data, one for line out data

AMP3 PMod uses 1 data pin - out data to phones. Additionally it uses I2C interface for controlling.

PMod I2S2 connector (J8)

I2S2 pmod pinCora Z7 pinSignalDirection
1IO3Line Out MCLK = Line In MCLKOutput
2IO29Line Out LRCK = Line In LRCK (WS)Output
3IO2Line Out SCLK = Line In SCLKOutput
4IO28Line Out dataOutput
5GNDGNDPower Output
6+3.3V+3.3VPower Output
7IO3Line In MCLK = Line Out MCLKOutput
8IO29Line In LRCK = Line Out LRCK (WS)Output
9IO2Line In SCLK = Line Out SCLKOutput
10IO1Line In dataInput
11GNDGNDPower Output
12+3.3V+3.3VPower Output

PMod AMP3 connector (J9)

AMP3 pmod pinCora Z7 pinSignalDirection
1IO29LRCK (WS)Output
2IO30out dataOutput
3n/cn/cn/c
4IO2SCLKOutput
5GNDGNDPower Output
6+3.3V+3.3VPower Output
7IO31I2C SDABidirectional
8IO4I2C SCLOutput
9IO3MCLKOutput
10+3.3V via 10K RnSDOutput
11GNDGNDPower Output
12+3.3V+3.3VPower Output

Oscillator connectors

To connect each of two oscillators it's necessary to use one input pin

Pitch oscillator connector (J7)

Connector pinCora Z7 pinSignalDirection
1GNDGNDPower Output
2IO0Pitch oscillator signalInput
3+3.3V+3.3VPower output

Volume oscillator connector (J6)

Connector pinCora Z7 pinSignalDirection
1GNDGNDPower Output
2IO42Volume oscillator signalInput
3+3.3V+3.3VPower output

Encoders board connector (J4)

Multiplexing is used to reduce number of used pins.

There are 5 incremental encoders with buttons and 1 tact button on Encoders board. They give 16 output signals.

To decrease number of used FPGA pins, multiplexing is used. Address A0..A3 selects signal to get value from. MUX out provides value of signal which index is set to A0..A3 pins.

Differencial ACD input pins are used as digital I/O for encoders board connection.

Connector pinCora Z7 pinSignalDirection
1A7MUX outputInput
2n/cn/cn/c
3A8A0 mux addressOutput
4A9A1 mux addressOutput
5A10A2 mux addressOutput
6A11A3 mux addressOutput
7+3.3V+3.3VPower output
8GNDGNDPower Output

Analog pedals board connector (J5)

Additional controlls may be connected using 6 on-board single-ended ADC analog input pins.

Connector pinCora Z7 pinSignalDirection
1A0Analog In 1Analog Input
2A1Analog In 2Analog Input
3A2Analog In 3Analog Input
4A3Analog In 4Analog Input
5A4Analog In 5Analog Input
6A5Analog In 6Analog Input
7+3.3V+3.3VPower output
8GNDGNDPower Output

MicroSD Card socket (J3)

MicroSD socket is traced on theremin shield PCB.

uSD card pinCora Z7 pinSignalDirection
1IO27DAT2Bidirectional
2IO26DAT3/CDBidirectional
3SPI SSCMDBidirectional
4+3.3V+3.3VPower Output
5SPI SCLKCCLKOutput
6GNDGNDPower Output
7SPI MISODAT0Bidirectional
8SPI MOSIDAT1Bidirectional
9A6Card Detect BInput
10GNDCard Detect APower Output

PCB design

Schematic and PCB are designed in KiCAD.

BoardKiCAD SchematicGerber file
Cora Z7 Theremin Shield

Connected to Cora Z7 board using Arduino/Chipkit connector.



PCB from=From pcbway

FPGA part

TBD

...

Back to main page