Skip to content

Not able to run the lib with ESP32 Wrover #102

@rjrajbir

Description

@rjrajbir

Hi I have made my custom hardware where I am custom SPI pins to communicate with VS1053b chip and A TFT Display.

I am able to test my display properly but not able to run VS1053b.
I checked with logic analyser that I am not able to get the proper SPI communication with VS1053b and esp32 wrover.

Here is my code


  The circuit (example wiring for ESP8266 based board like eg. LoLin NodeMCU V3):
  --------------------------------
  | VS1053  | ESP8266 |  ESP32   |
  --------------------------------
  |   SCK   |   D5    |   IO18   |
  |   MISO  |   D6    |   IO19   |
  |   MOSI  |   D7    |   IO23   |
  |   XRST  |   RST   |   EN     |
  |   CS    |   D1    |   IO5    |
  |   DCS   |   D0    |   IO16   |
  |   DREQ  |   D3    |   IO4    |
  |   5V    |   5V    |   5V     |
  |   GND   |   GND   |   GND    |
  --------------------------------

  Note: It's just an example, you may use a different pins definition.
  For ESP32 example, please follow the link:
    https://github.com/baldram/ESP_VS1053_Library/issues/1#issuecomment-313907348

*/

// This ESP_VS1053_Library
#include <VS1053.h>

// Please find SampleMp3.h file here:
//   github.com/baldram/ESP_VS1053_Library/blob/master/examples/Mp3PlayerDemo/SampleMp3.h
#include "SampleMp3.h"

#define SCK 14
#define MISO 12
#define MOSI 13
#define XRST 32

//#ifdef ARDUINO_ARCH_ESP32
#define VS1053_CS    27
#define VS1053_DCS    5
#define VS1053_DREQ   2
//#endif

#define VOLUME  100 // volume level 0-100

VS1053 player(VS1053_CS, VS1053_DCS, VS1053_DREQ);

void setup() {
  Serial.begin(115200);

  // initialize SPI
  SPI.begin();

  Serial.println("Hello VS1053!\n");
  // initialize a player
  player.begin();
  Serial.println("Code is here before chip");

  while (player.isChipConnected() == 0)
  {
    Serial.println("No Chip Detected!");
  }

  if (player.getChipVersion() == 4) { // Only perform an update if we really are using a VS1053, not. eg. VS1003
    player.loadDefaultVs1053Patches();
    Serial.println("Code is here 1");
  }
  player.switchToMp3Mode(); // optional, some boards require this
  player.setVolume(VOLUME);
  //Serial.println("Code is here");
}

void loop() {
  Serial.println("Playing sound... ");

  // play mp3 flow each 3s
  player.playChunk(sampleMp3, sizeof(sampleMp3));
  delay(3000);
}```


I am confused about these pin decelartions
#define SCK 14
#define MISO 12
#define MOSI 13
#define XRST 32

Please help

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions