We use the VS1011e and VS1053B through a module called "SmartMP3" from Mikroelektronika.
We have two HW revisions from them, rev 1.10 hosting a VS1011E and rev 1.21 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 and take a closer look to the new revisions schematic 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);
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 )
: rev 1.10, vs1011e: https://lamprecht.org/temp/ecs/smartmp3_manual_v101.pdf
: rev 1.21, vs1053b https://download.mikroe.com/documents/a ... c-v121.pdf
: http://www.vlsi.fi/fileadmin/app_notes/ ... 11to53.pdf