VS1003 WAV recording

Writing software for systems that use VLSI Solution's devices as slave codecs to a host microcontroller.
mbprogrammer
User
Posts: 3
Joined: Tue 2019-07-23 9:49

Re: VS1003 WAV recording

Post by mbprogrammer » Tue 2019-07-23 9:57

Hello,
I'm a newbie in vs1003. I have an Arduino-Mega 2560 and a VS1003. I was able to build and program vs1003_hello.
I want to record wav with vs1003, (actually I prefer to record in compressed formats like mp3 or .. but for now, I have VS1003 and it doesn't have the ability to encode to mp3 so..). so I want to record audio with vs1003, but I cann't. Is it possible for you to share your code or is there any library to use for this?

thanks in advance for your help.

mbprogrammer
User
Posts: 3
Joined: Tue 2019-07-23 9:49

Re: VS1003 WAV recording

Post by mbprogrammer » Thu 2019-07-25 11:34

I found out that my problem is during read from spi port, I receive 0 from spi. I'm using this function for reading spi:

Code: Select all

  
uint16_t VS1003::read_register(uint8_t _reg) const
{
  uint16_t result;
  control_mode_on();  //dcs=HIGH, cs=Low
  unsigned char hsb = 0, lsb = 0;
  delayMicroseconds(1); // tXCSS
  SPI.transfer(VS_READ_COMMAND); // Read operation
  SPI.transfer(_reg); // Which register
  hsb = SPI.transfer(0xFF);
  lsb = SPI.transfer(0xFF);
  result = hsb << 8 | lsb;
  delayMicroseconds(1); // tXCSH
  await_data_request();
  control_mode_off();
  return result;
}

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

Re: VS1003 WAV recording

Post by Panu » Thu 2019-07-25 22:37

Please check that VS1003 has proper power, clock and reset. Check other things in the checklist "MCU Howto", link below. Check that your MCU can read from the pin: short circuit the input pin to iovdd and check that you get 0xff instead of 0x00.

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

mbprogrammer
User
Posts: 3
Joined: Tue 2019-07-23 9:49

Re: VS1003 WAV recording

Post by mbprogrammer » Sun 2019-08-04 12:24

The problem was because of the SDCard module, when I disconnect the SD Module, I can read from VS1003 SPI.
Both modules (vs1003 and SD card) were connecting to SPI ports, (with different Chip_Select pins). I connected SD card to other pins and enabled SoftwareSPI for SD access (using SdFat library). Now I have noise when recording. any idea on this noise?

Post Reply