Couple Quick VS1005 Questions from New Guy

Discussion about writing software for VS1005 and the VSOS Operating System. Also posts about VS1005-related hardware design and device drivers should be posted here.
Post Reply
gfvalvo
User
Posts: 2
Joined: Fri 2020-02-14 15:19

Couple Quick VS1005 Questions from New Guy

Post by gfvalvo » Fri 2020-02-14 15:54

Hi All.

I just discovered the VS1005 though lots of Google searching and it seems like it would be useful for my next project. Actually, it looks “over qualified” since all I need is an MP3 Decoder with I2S output. But, there’s not many of these available on nice break-out boards.

Anyway, I hope you’ll tolerate a couple of questions from a forum newbie:
  • The VS1005 datasheet is a little vague when it discusses the I2S output format. When it states “32-bit mode” does that mean each of the Left and Right samples is 32-bits wide (with I assume 24-bit resolution)? I hope so, because that’s what my application requires: BCLK = 64 * Fs and MCLK = 256 * Fs.
  • This will be my first time developing code in an environment like VSOS. I’m mainly a “bare metal” programmer. I see that VSOS abstracts away many of the underlying chip’s details into high-level constructs. That’s fine, but can I still get to the hardware?

    For example, the section on “Redirecting an Audio Output” in the VSOS Programmer’s guide says that I can select I2S output, but only at 96 KHz sample rate. I need 48 KHz sample rate. I can change that in the I2S_CF register (address 0xFE60). But, how do I get there from code running under VSOS?
That’s all for now. Thanks in advance.

User avatar
Panu
VLSI Staff
Posts: 2743
Joined: Tue 2010-06-22 13:43

Re: Couple Quick VS1005 Questions from New Guy

Post by Panu » Fri 2020-02-14 20:31

Hi, and welcome to the forum!

The maximum I2S output rate from VS1005 when using the hardware modulator is 192/16 or 96/32, which both have the same bitrate. You can set 48/32, which is what you want. Then I2S_FRM (LRCLK) frequency will be 48 kHz, and each frame will carry two 32-bit samples, one for the left channel and the other for the right channel. In general, the samples carry 24 bit data. The data format is I2S (some ICs have 3 formats: left-justified, right-justified and i2s - the VS1005 has only i2s).

From hardware point of view it's fairly simple to get the i2s output, just need to write to the I2S config register to switch it on. We can help you if it's not obvious from the audio driver documentation.

Yes, you can do bare metal coding with the VSOS, the OS just gives you a framework that makes it easier to handle files, SD cards, memory management and loading different drivers, that's all.

PS. Also VS1010 has MP3 decoding and I2S output, same as VS1005g, if you're looking for a more low cost option and don't already have the VS1005 board.

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

gfvalvo
User
Posts: 2
Joined: Fri 2020-02-14 15:19

Re: Couple Quick VS1005 Questions from New Guy

Post by gfvalvo » Fri 2020-02-14 21:25

Hi Panu, thanks for the quick reply and offer of future help.

For right now, I'd just appreciate learning how to access the hardware registers from my application code running within the VSOS framework.

* Do I do it with ioctl calls?

* Are the registers memory mapped within the address space of my application code? If so, what is that mapping?

Is there a document that lays this out?

Thanks again.

Post Reply