[Question] Cannot detect VS1053 module under ESP32-WROOM-32 using Adafruit VS1053 Lib

User avatar
rickygai
Posts: 2
Joined: Wed Jul 28, 2021 6:45 am

[Question] Cannot detect VS1053 module under ESP32-WROOM-32 using Adafruit VS1053 Lib

Postby rickygai » Tue Nov 12, 2024 3:33 am

Software and Hardware:
Visual Studio Code Version 1.93.1 (user setup)
PlatformIO Core 6.1.16 Home 3.4.4
ESP32-WROOM-32 (38pins) https://www.aliexpress.com/item/1005007 ... cDOwE&mp=1
VS1053 module board https://www.aliexpress.com/item/1005006 ... 1802HcFDYe
SD Card module https://www.aliexpress.com/item/3278751 ... 1802HcFDYe

Dependencies under platformio.ini:

Code: Select all

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
...
lib_deps = 
	plerup/EspSoftwareSerial@^8.2.0
	arduino-libraries/ArduinoBLE@^1.3.7
	olikraus/U8g2@^2.35.30
	ivanseidel/LinkedList@0.0.0-alpha+sha.dac3874d28
	greiman/SdFat@^2.2.3
	adafruit/Adafruit ST7735 and ST7789 Library@^1.10.4
	adafruit/Adafruit VS1053 Library@^1.4.1
...

I have configured the pin connection between ESP32-WROOM-32, SDCARD and VS1053 as shown picture below and able to detect the SD card but failed to detect the VS1053 module at .begin() instruction of Adafruit VS1053 Library. The VS1053 module board is powered by 5V input but on board is operating at 3.3V.

VS1053 ESP32-WROOM-32 connection.png
VS1053 ESP32-WROOM-32 connection.png (126.45 KiB) Viewed 353 times

main.cpp

Code: Select all

#include <Adafruit_VS1053.h>
#include <SD.h>
Adafruit_VS1053_FilePlayer[b] vs[/b] = 
                                        //    23        19         18         17         5           16          4            32
Adafruit_VS1053_FilePlayer( NIMOSI, NIMISO, NISCLK, NIVSRS, NIVSCS, NIVSDC, NIVSDQ, NIVSSDCS );

void setup()
{
...
	SPI.begin( NISCLK, NIMISO, NIMOSI, NIVSCS );
	if( [b]vs[/b].begin() )
	{
	Serial.printf( "\n\rVS1053 OK" );
	}
	else
	{	
        [b]Serial.printf( "\n\rERROR: VS1053 not detected" );  // Always fail at this line.[/b]
        }
...
}

Adafruit_VS1053.cpp

Code: Select all

uint8_t Adafruit_VS1053::begin(void) {
  if (_reset >= 0) {
    pinMode(_reset, OUTPUT);
    digitalWrite(_reset, LOW);
  }

  pinMode(_dreq, INPUT);

[b]  uint32_t control_speed = 250000; // I have set this value to 1000000 but still failed
  uint32_t data_speed = 8000000;    // I have set this value to 4000000 but still failed.[/b]
  if (useHardwareSPI) {
    spi_dev_ctrl = new Adafruit_SPIDevice(_cs, control_speed, SPI_BITORDER_MSBFIRST,
                                          SPI_MODE0, &SPI);
    spi_dev_data = new Adafruit_SPIDevice(_dcs, data_speed, SPI_BITORDER_MSBFIRST,
                                          SPI_MODE0, &SPI);
  } else {
    spi_dev_ctrl = new Adafruit_SPIDevice(_cs, _clk, _miso, _mosi, control_speed,
                                          SPI_BITORDER_MSBFIRST, SPI_MODE0);
    spi_dev_data = new Adafruit_SPIDevice(_dcs, _clk, _miso, _mosi, data_speed,
                                          SPI_BITORDER_MSBFIRST, SPI_MODE0);
  }

  spi_dev_ctrl->begin();
  spi_dev_data->begin();

  reset();

  return (sciRead(VS1053_REG_STATUS) >> 4) & 0x0F;
}
Anyone successfully detected VS1053 module using Adafruit VS1053 Library on ESP32-WROOM-32 under Arduino platform, your feedback is greatly appreciated.

I do not want to use GPL related library related licenses to program VS1053, only Adafruit VS1053 library is preferred.

Please advise.

User avatar
rickygai
Posts: 2
Joined: Wed Jul 28, 2021 6:45 am

Re: [Question] Cannot detect VS1053 module under ESP32-WROOM-32 using Adafruit VS1053 Lib

Postby rickygai » Thu Nov 14, 2024 2:38 am

I just noticed the model of the VLSI chip is VS1003B, may be this is the reason the Adafruit VS1053 library failed to detect.
VS1003B.jpg
VS1003B.jpg (422.73 KiB) Viewed 313 times

Who is online

Users browsing this forum: Baidu [Spider] and 29 guests