Issues when switching out a VS1011e with a VS1053B

Designing hardware that uses VLSI Solution's devices as slave codecs such as an external MP3 decoder chip for a host microcontroller.
Post Reply
toni.patroni
User
Posts: 1
Joined: Sun 2018-11-11 15:38

Issues when switching out a VS1011e with a VS1053B

Post by toni.patroni » Sun 2018-11-11 16:22

Hi,

We use the VS1011e and VS1053B through a module called "SmartMP3" from Mikroelektronika.

We have two HW revisions from them, rev 1.10[0] hosting a VS1011E and rev 1.21[1] hosting a VS1053B.
Schematics are linked below.

As we always used the VS1011e in native mode i did not changed much initially, and just tried the new revision and voilà it seemed to work immediately. But whenever I reset my whole AVR development board, which then triggers a hard reset of the VS10XY at boot I have a high chance that the play back speed (and volume) is wrong, i.e., different levels of to fast or to slow. Respectively, DREQ gets triggered more often or less often.
If I hit such a "glitch" start then I also have problems reading DECODE_TIME or the version info from the STATUS register, the flip/flop around, with DECODE_TIME having some underflows, etc.

If I have luck and hit a good start then the version from STATUS stays stable (and correct) and DECODE_TIME counts upwards in seconds, as expected, also playback and volume are correct then.

I then researched a bit and found the migration guide from vs1011e to vs1053b[2] and take a closer look to the new revisions schematic[1] and adapted CLOCKF (I played with that around to see if I could narrow down the problem, but now I set it correctly).

Here a bit shortned code of what I do on reset.

Code: Select all

setupPorts(); // setup IO direction and pullups
spi_init(); // MCU clocks with 16MHz and I use 4 prescaler -> 4 MHz SCLK, I also tried to lower that with 16 x prescaler


bsyncHigh();
mp3CSHigh();

mp3Reset(); // pull RESET pin to LOW for 1MS (tried also 10MS)

sciWrite(MODE, (1<<11)); // ensure native mode (default)

uint16_t vs_status = sciRead(STATUS);
PORTJ = vs_version = (vs_status >> 4) & 0x0F; // this can flap around, btw. when is this valid to read?

// sciWrite(CLOCKF, 12500L); // for HW rev 1.10 vs1011e where XTAL was 25MHZ so -> 25MHZ / 2kHz
sciWrite(CLOCKF, 0x0000); // HW rev 1.21 uses 12.288 clk, so no need to change, we only play mp3 so no need for CLK MUL/ADD (I tried though)
sciWrite(BASS, 0x7A00); // get some bass

sciWrite(VOL, 0x3000);
For playing I get 32 byte data from an SDCard and send it to the VS10XY, I get the sound, which sounds like the song wanted just often to slow/fast and louder or quieter, change after each board reset, seemingly random... Plugging in the older rev. makes it just work....

Do you have any pointer of what I do wrong, maybe I missed something to update? Or is anything problematic with the PCB from Mikroelektronika?
(I also posted to their fForum, but my message awaits moderation approval and the Forum did not seem very active, so here i am :) )

thanks!
Thomas

[0]: rev 1.10, vs1011e: https://lamprecht.org/temp/ecs/smartmp3_manual_v101.pdf
[1]: rev 1.21, vs1053b https://download.mikroe.com/documents/a ... c-v121.pdf
[2]: http://www.vlsi.fi/fileadmin/app_notes/ ... 11to53.pdf

User avatar
Panu
VLSI Staff. Currently on holiday.
Posts: 2680
Joined: Tue 2010-06-22 13:43

Re: Issues when switching out a VS1011e with a VS1053B

Post by Panu » Sun 2018-11-11 23:16

Hi!

I'll take a look at your schematics and read in with thought when I get to the office, but in the mean time, please read the "MCU Howto" link below. Your problems might not even be due to protocol differences between the chips, they might even be due to subtle timing differences on clock edges, so be sure to check your SPI parameters such as clock phase and clock inversion. But in the mean time, here's a few general pointers - these are remarks not only for you but for others seeking information with similar keywords in the future.

Please see the "MCU Howto" link below.

Basically everything in the operation of digital circuits boils down to three basics: power, clock and reset. Please check these. Powering is different in VS1053 - there are different voltage levels and the requirement of added CVDD, which the VS1011 doesn't use. Clocking is also different, as you have noticed, as there is only clock doubler in VS1011, but a full fledged clock multiplier in VS1053. And crystals - modern crystals really don't want 30pF capacitors. And resetting - that's often not really considered so much by engineers, so be sure that you have a proper reset in your circuit: clean, fast enough edge on XRESET, but only AFTER power has been applied.

Welcome to the forum!
-Panu
Info: Line In and Line Out, VS1000 User interface, Overlay howto, Latest VSIDE, MCU Howto, Youtube
Panu-Kristian Poiksalo, VLSI Solution Oy

User avatar
Panu
VLSI Staff. Currently on holiday.
Posts: 2680
Joined: Tue 2010-06-22 13:43

Re: Issues when switching out a VS1011e with a VS1053B

Post by Panu » Mon 2018-11-12 15:18

Hi!

Hmm, first of all, wait a little after resetting the VS1053 before you start SCI communication.

Secondly, I don't think your SCI commands are getting through. Set less than 1Mbps SPI speed for your SCI commands. Change clock phase, then polarity.

Then, set 3X clock. And 0x3000 is quite strange setting for volume, try 0 for start.

-Panu
Info: Line In and Line Out, VS1000 User interface, Overlay howto, Latest VSIDE, MCU Howto, Youtube
Panu-Kristian Poiksalo, VLSI Solution Oy

User avatar
pasi
VLSI Staff
Posts: 1571
Joined: Thu 2010-07-15 16:04

Re: Issues when switching out a VS1011e with a VS1053B

Post by pasi » Mon 2018-11-12 15:45

Like Panu says, you definitely need to wait for DREQ to go high (or at least long enough for the oscillator to start) after releasing reset to make sure the vs10xx is ready to respond to SCI writes.

Some registers are ok to write as long as the chip is not in reset, but even if you write SCI_MODE successfully, if you write SCI_MODE too quickly after reset, the ROM code will set the SCI_NEWMODE bit, overriding your write. So, you definitely want to wait until DREQ is high.
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook

Post Reply