What is the Function of SCI_AICTRL3 of VS1053b?

Writing software that inputs and/or outputs audio and performs DSP algorithms such as filters, new codecs or audio effects.
Post Reply
Arun Joe
Senior User
Posts: 28
Joined: Sat 2017-04-22 9:01

What is the Function of SCI_AICTRL3 of VS1053b?

Post by Arun Joe » Mon 2017-04-24 7:53

Hi,
What is the exact function of the SCI_AICTRL3 register of VS1065b?,
is it used in controlling the recording function ? or is it used in setting the following functions as mentioned in the datasheet?

SCI_AICTRL3 1..0 0 = joint stereo (common AGC), 1 = dual channel (separate AGC),
2 = left channel, 3 = right channel
2 0 = IMA ADPCM mode, 1 = LINEAR PCM mode
15..3 reserved, set to 0

User avatar
pasi
VLSI Staff
Posts: 1518
Joined: Thu 2010-07-15 16:04

Re: What is the Function of SCI_AICTRL3 of VS1053b?

Post by pasi » Mon 2017-04-24 11:06

Hello,

SCI_AICTRL0 through SCI_AICTRL3 are application-specific control registers used by the application firmware. Thus their use changes depending on which application is running.

In the vs1053b Encoding Mode the AICTRL registers work as specified by the encoding chapter of the datasheet.

With the vs1053b PCM Recorder application they work as specified in its documentation. And with the vs1053b Ogg Vorbis Encoder application they work as specified in its documentation.
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook

Arun Joe
Senior User
Posts: 28
Joined: Sat 2017-04-22 9:01

Re: What is the Function of SCI_AICTRL3 of VS1053b?

Post by Arun Joe » Mon 2017-04-24 11:33

Hi Thanks for your response,
Both Datasheet http://www.vlsi.fi/fileadmin/datasheets/vs1053.pdf and Application Note,
VS1053B / VS1063A WAV PCM RECORDER http://www.vlsi.fi/fileadmin/software/V ... corder.pdf
describes about the WAV PCM Recording.

In the datasheet(Page 54) of VS1053B that SCI_AICTRL3 Register has the functions as given below

SCI_AICTRL3

Bit 1-0 : 0 = joint stereo (common AGC), 1 = dual channel (separate AGC),
2 = left channel, 3 = right channel
Bit 2 : 0 = IMA ADPCM mode, 1 = LINEAR PCM mode
Bit : 15..3 reserved, set to 0

Whereas in the Application Notes mentioned above gives a different description for those registers.

For Example in App Note : VS1053B / VS1063A WAV PCM RECORDER(Page 7) it is described as given blow.

SCI_AICTRL3

Bit 0 W: Finish recording, set to 0
Bit 1 R: Recording finished, set to 0
Bit 2 R: There is at least one byte to read, set to 0
Bit 15:3 Unused, always set to zero and they stay zero

which among this is right?
if the application is different,where is the difference in the application? or s there anything more I should know?

User avatar
pasi
VLSI Staff
Posts: 1518
Joined: Thu 2010-07-15 16:04

Re: What is the Function of SCI_AICTRL3 of VS1053b?

Post by pasi » Mon 2017-04-24 12:17

AICTRL registers do not have fixed functions.

If you use the encoding mode in vs1053b ROM, you use the datasheet definitions.

The WAV PCM RECORDER Application replaces / reimplements the ROM functionality, so if you load and run the WAV PCM RECORDER Application, then you use AICTRL in the way the application defines its use.

It is just a co-incidence that both provide you with (different) ways to record linear PCM WAV format.

The WAV PCM RECORDER Application supports a few fixed samplerates, and it can thus use a slightly different audio processing path, and is more 'bit-exact'.
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook

Arun Joe
Senior User
Posts: 28
Joined: Sat 2017-04-22 9:01

Re: What is the Function of SCI_AICTRL3 of VS1053b?

Post by Arun Joe » Mon 2017-04-24 12:54

You mean to say that , it is the .plg plugin, that is loaded ,which changes the functionality of the AICTRL Registers?
In page 8 of the application note,http://www.vlsi.fi/fileadmin/software/V ... corder.pdf
The 4th step mentioned is given below?

4. Disable any potential user application by setting SCI_AIADDR (10) to 0.

Is this to avoid any override any previously running Application?

Thanks.

User avatar
pasi
VLSI Staff
Posts: 1518
Joined: Thu 2010-07-15 16:04

Re: What is the Function of SCI_AICTRL3 of VS1053b?

Post by pasi » Mon 2017-04-24 15:32

Yes, the loaded application decides how it uses the values of the AICTRL registers.

Step 4 (write 0 to AIADDR) makes certain that while you are loading new code it does not overwrite code that is currently in use. (AIADDR is used to set a hook function which is called in various parts of the program execution.)

If you use the vs1053b patches package, you should start with a software reset instead. Software reset also sets the internal copy of the application hook function to 0 (even when it doesn't clear the SCI_AIADDR register itself).
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook

Arun Joe
Senior User
Posts: 28
Joined: Sat 2017-04-22 9:01

Re: What is the Function of SCI_AICTRL3 of VS1053b?

Post by Arun Joe » Mon 2017-04-24 15:50

Thanks for your Answers,
It would be greatly appreciated if you could clear two more doubts.
Is SCI_AICTRL0 as per the datasheet,(page 54)http://www.vlsi.fi/fileadmin/datasheets/vs1053.pdf
a sample rate divider or used to mention the sample rate?
And How am I supposed to stop the recording as per the datasheet?

User avatar
pasi
VLSI Staff
Posts: 1518
Joined: Thu 2010-07-15 16:04

Re: What is the Function of SCI_AICTRL3 of VS1053b?

Post by pasi » Tue 2017-04-25 15:29

SCI_AICTRL0 is read when the encoding mode is started. AICTRL0 specifies the samplerate to use. In the example at the bottom of page 54 the samplerate is set to 16000Hz.

In vs1053b (with WAV and IMA ADPCM) you end encoding by a) stop reading the data, b) set the software reset bit in SCI_MODE and also clear the SM_ADPCM (also named SM_ENCODE) bit.
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook

Arun Joe
Senior User
Posts: 28
Joined: Sat 2017-04-22 9:01

Re: What is the Function of SCI_AICTRL3 of VS1053b?

Post by Arun Joe » Thu 2017-04-27 14:51

Hi,
Page 9 of the Application note http://www.vlsi.fi/fileadmin/software/V ... corder.pdf says that the
The PCM buffer size is 39166 16-bit words, or approximately 78 KiB. Which is different from what is mentioned in the datasheet http://www.vlsi.fi/fileadmin/datasheets/vs1053.pdf page 56 as, The PCM / IMA ADPCM sample buffer is 1024 16-bit words.
which among this is correct?; or does these values also change as per the plugin(application) being used?

User avatar
pasi
VLSI Staff
Posts: 1518
Joined: Thu 2010-07-15 16:04

Re: What is the Function of SCI_AICTRL3 of VS1053b?

Post by pasi » Thu 2017-04-27 14:59

Both are correct. The PCM Recorder application takes over the system and uses a larger buffer than the regular encoding mode.
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook

Post Reply