VS1053

From ElectroDragon Wiki

VS1053 Note

Pin Definition

  • SPI SCK, MISO, MOSI - SPI interface
  • SPI - XCS / XDCS - select and controll different operation
  • DREQ - data requst, check if the module can output music data
  • RST - IC reset, low ttl to reset

Code Steps of VS1053

  • Mount the file system (we use the file system is Petit Fatfs) only mount the system before you can open the tf card music files
  • Initialize the VS1053 chip (including hardware initialization and software initialization, and some value of the test)
  • Reads the data of the specified music file into the cache array
  • Through the way to read out the data stream to every 32 bytes once the way into the VS1053
  • At this time VS1053 audio output will have music broadcast.

VS1053 Main Register

  • MODE register is used to control the operation of the VS1053 and is one of the most critical registers. The reset value of this register is 0x0800, which is the default mode.
  • BASS register can be used to set the high and low sound effects of the VS1053.
  • CLOCKF register is used to set the clock frequency, multiplier and other related information.
  • DECODE_TIME register is a register that stores the decoding time,
  • HDAT0 and HDTA1 are two data stream header registers, different audio files, read out the value of different meaning, we can use these two registers to obtain the audio file rate, which can calculate the total length of the audio file.
  • VOL register is used to control the output volume of the VS1053. This register can control the volume of the left and right channels respectively. The control range of each channel is 0 ~ 254, and each increment represents the attenuation of 0.5db. Therefore, the smaller the value, The greater the volume.

Reference

Datasheet

Datasheet CN

Demo Code

Other Documents and Sources