schreibfaul1 / ESP32-vs1053_ext

With this library You can easily build a WebRadio with a ESP32 board and a mp3-module. See: https://www.youtube.com/watch?v=u4u9NvZvWRk
GNU General Public License v3.0
106 stars 29 forks source link

Change of pins no audio #4

Closed Uksa007 closed 6 years ago

Uksa007 commented 6 years ago

Hi,

When I change the Pins used for the VS1053 there is no audio output, eg using the following pins:

// Digital I/O used
#define VS1053_CS     33
#define VS1053_DCS    32
#define VS1053_DREQ   34

If I use the defult pins it work ok.

Uksa007 commented 6 years ago

Hi, Been having a look in the library to see if I can see why changing the pins causes issues no luck so far. The Adafruit VS1053 library works fine with the pins I use eg 33,32,34. When using the miniwebradio I get the following message on the serial log: setup : VS1053 not found

Any ideas? Regards

schreibfaul1 commented 6 years ago

Hello, I have tested this on my breadbord and changed VS1053_CS from 2 to 32. No function, the same with GPIO 33. The reason is a 32bit mask in gpio_struct.h line 24 and 25

uint32_t out_w1ts; /*GPIO0~31 output value write 1 to set*/ uint32_t out_w1tc; /*GPIO0~31 output value write 1 to clear*/

the GPIOS are setting fast this way inline void DCS_HIGH() {GPIO.out_w1ts = (1 << dcs_pin);} inline void DCS_LOW() {GPIO.out_w1tc = (1 << dcs_pin);} inline void CS_HIGH() {GPIO.out_w1ts = (1 << cs_pin);} inline void CS_LOW() {GPIO.out_w1tc = (1 << cs_pin);} So we can not use pin32 and 33 for VS1053_CS or VS1053_DCS see https://github.com/espressif/esp-idf/issues/285

Adafruit simple change the level this way: digitalWrite(_dcs, LOW); It is possible but reduces speed