Page 3 of 3

Re: VS1003 WAV recording

Posted: Tue 2019-07-23 9:57
by mbprogrammer
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.

Re: VS1003 WAV recording

Posted: Thu 2019-07-25 11:34
by mbprogrammer
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;
}

Re: VS1003 WAV recording

Posted: Thu 2019-07-25 22:37
by Panu
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

Re: VS1003 WAV recording

Posted: Sun 2019-08-04 12:24
by mbprogrammer
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?

Re: VS1003 WAV recording

Posted: Mon 2019-09-02 11:58
by pasi
mbprogrammer wrote:
Sun 2019-08-04 12:24
Now I have noise when recording. any idea on this noise?
My guess would be writing to the SD card either through the power supply or through the ground.

How are the modules connected? Can you add power filtering and more ground connections?