Download free music MP3s on genuine quality, the world’s largest online music catalogue, powered by your scrobbles. Free listening, videos, photos, The world’s largest online music catalogue, powered by your scrobbles. Free listening, videos, photos, stats, charts, biographies and concerts. stats, charts, biographies and concerts.
Monday, December 9, 2024
ESP32 WROOM Mozzi Experimenter PCB Build Guide
Here are the build notes for my ESP32 WROOM Mozzi Experimenter PCB Design. Warning! I strongly recommend using old or second hand equipment for your experiments. I am not responsible for any damage to expensive instruments! If you a…
8x 10K potentiometers (PCB mount, see PCB and photos for footprint)
2x 100nF ceramic capacitors
2x 10uF non-polar capacitors (electrolytics probably fine too)
1x 100uF electrolytic capacitor
1x 3.5mm stereo TRS socket (PCB mount - see photos/PCB)
Either 2x 180 degree DIN sockets (PCB mount - see photos/PCB)
Or 2x 3.5mm stereo TRS sockets
1x 2.1mm barrel jack socket (PCB mount - see photos/PCB)
Optional: 2x or 4x 15-pin header sockets
Optional: 1x 6 way DIP socket
Optional: pin headers
Optional: jumpers
Optional: SPDT slider switch, 2.54mm pitch connections (see photos/PCB)
Build Steps
Taking a typical "low to high" soldering approach, this is the suggested order of assembly:
All resistors and diode.
DIP socket (if used) and TRS socket(s).
Disc capacitors.
Headers.
Switch (if used).
Barrel jack.
Non-polar and electrolytic capacitors.
DIN sockets (if used).
Potentiometers.
Here are some build photos.
There are several options for headers - there is an additional breakout of all the pins of the ESP32 module and these can be populated with sockets, pins or just left unpopulated as shown below.
And finally adding the potentiometers.
Configuration Options
Two of the potentiometers, RV1 and RV2, have configurable GPIO connections, which are selected by solder jumpers on the rear of the board. The default has them mapped as follows:
RV1
GPIO 13
RV2
GPIO 12
The alternative is configured by cutting the default track between the top solder pads and re-soldering to the bottom pads:
Only one can be changed if required. The alternative configurations are:
RV1
GPIO 39
RV2
GPIO 36
Testing
I recommend performing the general tests described here: PCBs.
Functionality testing is covered by the Sample Applications given below.
PCB Errata
There are the following issues with this PCB:
The UART jumper is labelled UART0 and UART1, but in actually, UART1 is almost certainly going to end up being UART2 as UART1 is typically used for onboard flash memory.
Enhancements:
I could add a slightly larger prototyping area, perhaps mirroring the layout of a mini solderless breadboard and still keep within a 100x100mm footprint.
void loop() { for (int i=0; i<NUM_POTS; i++) { int aval = analogRead(potpins[i]); Serial.print(aval); Serial.print("\t"); } Serial.print("\n"); delay(100); }
DAC Write Test
The following code will generate two sawtooth waveforms on the two DAC pins, GPIO25 and GPIO26, which are connected to the audio output L and R channels.
GPIO 25 will generate a 440Hz saw tone, and GPIO26 will generate a 880Hz saw tone.
This works, as the code generates a 6-bit (i.e. 0 to 63) value saw wave, updating the value every time through the loop() function. The value is effectively scaled up to 8-bits (0 to 255) by multiplying by 4. The frequency is doubled for pin 26 by multiplying by 8.
In reality, I'm actually taking advantage of the fact that "count" is a uint8_t - i.e. only an 8-bit value - and will automatically wrap around back to zero when the value gets to 255. So in the code, every time the actual "count" variable wraps (0 to 255), the multiplied by 4 version will have wrapped 4 times (i.e. 0 to 63 four times - well, actually it is going 0 to 255, but in steps of 4 at a time, so it will do that 4 times). Similarly the multiplied by 8 version will have wrapped 8 times.
The code has to output these 64 values, 440 times a second, to generate the 440Hz saw tone - so 64 x 440 = 28,160 values a second. That means there is one value required every 35 uS or so. I use the ESP32 microsecond timer to manage this.
void loop() { uint32_t newtime = esp_timer_get_time(); if (newtime >= timer) { dacWrite(25, count*4); // Auto wraps at 256 dacWrite(26, count*8); // Twice frequency of wrapping... count++; timer = newtime + 35; // 35 uS in future of last timer read } }
MIDI Test
The ESP32 Simple MIDI Monitor code can be used for a simple MIDI test. The code is configurable for either UART0 or UART1 (in reality mapped onto UART2 in the ESP32) for MIDI.
In use, on reception of any NoteOn message the onboard LED will light up. Also, any MIDI data received over MIDI IN is software-THRU echoed to MIDI OUT.
When using UART1 (UART2) then there will also be a MIDI message dump to the serial monitor.
Closing Thoughts
This board seems to work well. But I have a bit of a problem at the moment. There seems to be a problem with the current (at the time of writing) Mozzi library and the ESP32. There is an incompatibility with the I2S driver used for streaming data out to the DAC.
So at the time of writing, as a Mozzi experimenter board, my options are a little limited. But as soon as Mozzi is updated to the latest ESP32 SDK I2S interfaces, hopefully I'll be able to properly get going. Watch this space.
No comments:
Post a Comment