I'm setting up my ESP32 WROOM32 with a VS1053 with inbuilt SDcard to run MD_MidiFile which uses SDFat.
I'll be playing MIDIFiles from the SD Card, MIDI audio playing out of the jack headphone socket on the vs1053 board and also triggering LEDs as the file plays.
What are the pin connections that i need to make between the ESP32 and VS1053?
On the VS1053 i have following pins available..
5V - Easy
GND - Easy
CS
MISO
SI
SCK
XCS
XRESET
XDCS
DREQ
I have been down many google dead ends so thank you in advance for your time and my apologies if this is all really obvious - i appreciate your help.
The connections depend on how you intend to run the device. From the pins it looks like there is an SPI interface available (CS, SCK, MISO - maybe for the SD card), but the other pins are something else.
It would be useful if you look at the definition of the pins from the product spec sheet for the VS1053 board or at least provide a link to that specification.
Late reply because I've been away treble checking I'm not making any obvious silly mistakes with wiring and config. Still no success - so here is what i am up to...
- Connect Boards with... - * VS1053 - ESP32**
CS - D22*
MISO - D19*
SI - D23*
SCK - D18*
XCS - D32*
XRESET - EN*
XDCS - D33*
DREQ - D35*
5V - 5v*
GND- GND* - Plug headphones into speaker jack output from the VS1053 board - Load files on SD card. Confirm SD card works by successfully running SdFat examples - IN SdInfo.h change this value from 50 to 25, any higher gives error of 'SD init fail!' - * #define SPI_FULL_SPEED SD_SCK_MHZ(25) - In MD_MIDIFile_Play change SD to match CS pin - * #define SD_SELECT 22 - Compile to MD_MIDIFile_Play to ESP32. - ---RESTART ESP32--- Serial Monitor shows data flowing as I would expect eg... File: ELISE.MID 2079 M T1: Ch 1 Data C0 0 2079 M T1: Ch 1 Data B0 7 64 2079 M T1: Ch 1 Data B0 A 40 2080 M T1: Ch 1 Data B0 5B 7F Audio output through the headphones gives hisses, clicks and pops in a manner that don't quite sound random (see attached audio) and certainly don't sound like the sweet synthesized MIDI piano i was hoping for. I tried a replacement vs1053 board just incase this one was faulty - no change. I tried using a different pin for CS - no change If anyone has a known working hardware setup to share then i'd love to hear about it, very happy to switch hardware. I'm chomping at the bit to build my project once these initial hardware issues are out of the way.. vs1053 Audio ESP32.zip (278 KB)
I have been looking at the VS1053 shield, starting with it attached to the UNO.
I am just trying to use ESP32 now. UNO has not enough memory to program much for this board.
I have got my program to compile for the ESP32 and loaded it up, but it is returning gobbledygook to the console as yet.
I did have to disconnect the Reset/EN between the two board when loading the code.
So the cheap ($5) VS1053 boards from aliexpress are set up for mp3/radio etc however they are not wired for handling MIDI signals despite what their item descriptions say! If you wish you can spend substantially more money and get a board that will do that from adafruit.
There is however a workaround. Mike Rainbow has beautifully documented how he hacked the board to accept MIDI input to produce audio. The mods are straightforward but require some high level soldering skills. I'm going to give it a go!
There are assorted versions.
They don't seem to be supported for ESP32 so it needs assorted code changes to get it to work (which I haven't got to the bottom of)
Configuration of the pins is necessary in the library.
They use SdFat..h
I got confused by all the old information as SdFat looked to have superceded SD.h for the Arduino, which originally had 8.3 file length naming restrictions
but SD.h in ESP32 library is fine.