VS1053 sound board SPI interface failing

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
zaphod_b
 
Posts: 7
Joined: Thu Oct 27, 2022 9:01 pm

VS1053 sound board SPI interface failing

Post by zaphod_b »

I'm building an internet radio using the Adafruit ESP32 HUZZAH and VS1053 sound board. I'm using the SPI interface in the 7-wire configuration (using the ESP32's hardware SPI port), and I'm using the Adafruit VS1053 and SPI libraries to drive the interface.

Initially the SPI interface appears to be working normally: I can read and write registers and I can run the sine test.

I'm hitting a problem where after sending a certain amount of data (around 42k) to the decoder's data interface (SDI), the command interface (SCI) stops working. The VS1053 drives the MISO line high and I'm unable to read any registers; I just get 0xFF's. The device also does not appear to respond to any commands from SCI while in this state.

While in this state, I can continue to feed MP3 data via the SDI port and get sound, but I can't do anything via the SCI interface.

What's troubling is neither a soft reset nor hard reset clears the issue! I have to power down the project to get the VS1053 out of this state.

Here are some traces from my logic analyzer showing the issue.
First, here's a normal case, where I am sending a few bytes of data to the decoder, then reading the status register, the lower byte of which is 0x40, giving the chip version number of "4".
Image

Here's what happens when the issue is triggered:
Image
The same read command sent via SCI (using the XCS select) but the VS1053 MISO is stuck high, returning 0xff.

One interesting item to point out: the device briefly drops the DREQ signal after the read command is complete, both when working normally and when the issue is triggered. It's like some logic in the device is acknowledging the transaction, but the data isn't getting to the pin.

I've not been able to find a way to clear this condition. Resets don't work, and since the device appears to ignore commands sent via SCI in this state, I've been unable to successfully send commands that would normally be used to stop playback gracefully, such as CANCEL, and resynching.

Any ideas? Is it a bad device?

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: VS1053 sound board SPI interface failing

Post by adafruit_support_mike »

That's more likely to be a signal/protocol issue than a hardware problem. Hardware failures usually aren't limited to specific conditions.

The most likely guess would be related to DREQ timing. Are you checking to make sure DREQ has gone high before sending each new block of data?

User avatar
zaphod_b
 
Posts: 7
Joined: Thu Oct 27, 2022 9:01 pm

Re: VS1053 sound board SPI interface failing

Post by zaphod_b »

I am. I have a wait loop before each transfer.

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: VS1053 sound board SPI interface failing

Post by adafruit_support_mike »

Hmm.. try sending gradually increasing amounts of data to see where the failure kicks in.

User avatar
zaphod_b
 
Posts: 7
Joined: Thu Oct 27, 2022 9:01 pm

Re: VS1053 sound board SPI interface failing

Post by zaphod_b »

I've set up a test routine where it sends just the first byte of my MP3 test file, polls the status register, then waits for a keypress on the serial port. Then it sends the next two bytes of the file polls the register and waits, then the next three, and so on.

It fails (the status register no longer reads correctly) after I send a 292-byte chunk, which equates to 42,778 total bytes of data. It's very consistent and repeatable.

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: VS1053 sound board SPI interface failing

Post by adafruit_support_mike »

Does it fail immediately if you try to send a 292-byte chunk first?

My interest is whether the failure follows the size of the data or the location in the MP3 file.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”