This is a quote from an old VS1001k FAQ item. Note that VS1001k did not have NEW_MODE which is the recommended bus mode for our more modern chips such as VS1003 and VS1053.
* If hardware reset (pin XRESET) is active, deactivate it. Wait for at least 1 millisecond.
* Activate software reset (bit SM_RESET in SCI register MODE).
* Wait for at least 5 microseconds.
* Read the DREQ pin and wait until it has activated. If activation seems to take more than 1 millisecond, activate hardware reset (pin XRESET), wait at least 1 microsecond, and go back to square one.
* Set all the SCI registers you want to: MODE, VOL, CLOCKF, etc.
* Send at least one (preferably two) byte containing zero to SDI.
* Send the MP3 file to SDI.
* Send 2048 bytes containing zero to SDI (respect the DREQ pin just as with MP3 data).
Note: for VS1053, please use endFillByte instead of zero. See instructions in the datasheet
* Wait 50 milliseconds to make it absolutely sure that audio buffers have been cleared even if the sample rate is only 8 kHz. (Usually this step doesn't need to be implemented.)
* For the next MP3 file, go back to 1.
- See that power, crystal and reset signals are at valid states.
- Check that you don't have unconnected GPIO's in the VS10xx, and that the TEST and RX pins are pulled high. All GPIO pins should be pulled low (or in some cases high to activate functions). For VS1053 it is important that GPIO1 is pulled low. Otherwise VS1053 starts as a midi synthesizer, and won't accept normal commands as in the "normal" mode.
- Select NEW_MODE if it's possible. Don't set "SHARED MODE" if you can connect both XCS and XDCS to your microcontoller. To set NEW_MODE and allow tests, write 0x0820 to the MODE register.
I know the name "shared_mode" is confusing. The "shared" means that SCI and SDI share the same chip select pin XCS on the VS10xx: SCI is activated when XCS=0 and SDI is activated when XCS=1. If the chip select is not shared, then SCI and SDI have separate chip select pins (XCS and XDCS). Then they can be both disabled at the same time (XCS = 1, XDCS = 1) and you can then use the SPI bus for communicating with other devices.
- Be very careful with the chip select signals!
- Check that XCS and XDCS are never both "0" at the same time.
- Check that your chip select signals remain low until the end of the last bit of the last byte of the transmission.
- Measure XCS, XDCS, SCK, MOSI and DREQ signals with your oscilloscope.
- Check that when DREQ is physically high/low (pull up and down the signals on the PCB) that your microcontroller can reliably read these. If not, check your microcontrollers GPIO states (data direction, gpio/periph mode, pullup/pulldown). If you use a #define macro to read the DREQ state, check that it really works (enough parentheses...), a malformed macro might not work correctly and has caused problems in the past.
- Start by sending the Sine Test sequence with ALLOW_TESTS bit set in the MODE register.
- Verify that GBUF/CBUF signal is at 1.25 volts.
- Verify that you can hear a beep.
- Note that for the VOLUME register: 0x0000 is Full Volume, 0x0606 is -3dB, 0xfefe is No sound and 0xffff is Analog Off. Default is 0x0000 (Full Volume).
- The chip resets in 1X clock speed. It's not enough to play MP3 at full speed (you will hear music but it has gaps), so setting the CLOCKF register is required. You should check the datasheet for calculating a good CLOCKF value for your crystal and MHz requirement, but if you use 12.288 MHz crystal, you can use for example these CLOCKF values:
- 0x9000 or 0x8800 (3.5+1.0X) for VS1053
- 0xB3FE (3.5+0.5X) for VS1003
- 0x9800 for VS1011
- Note that after reset, before you set the CLOCKF register clock doubler/multiplier, the SPI bus speed must be less than 1/6 of your crystal clock. That's 2 Mbits/s for the default crystal.
- If use a SD library or some other code using the same SPI port, check that the speed stays below CLKI/7 (for SCI reads) and CLKI/4 (for writes) even after using those functions.
See also: Making new designs work with VS1011 / VS10xx
See Henrik's MCU example code at: http://www.vlsi.fi/fileadmin/app_notes/ ... layrec.zip
For an example schematic and some software about connecting VS10x3 to a microcontroller, you can see the information of our (now discontinued) VS1053 Evaluation Kit:
http://www.vlsi.fi/fi/support/evaluatio ... onkit.html
http://www.vlsi.fi/fileadmin/evaluation ... 43_sch.pdf
http://www.vlsi.fi/player_vs1011_1002_1 ... larplayer/