Page 1 of 1

VS1053B SS_REFERENCE_SEL patch output noise

Posted: Tue 2018-05-01 19:26
by cinpezzo
Hi all,
I'm using VS1053b and I'm interest to increase the analog output swing (AVDD is 3.3V) . Reading the datasheet I have seen there is an issue in the fw so, when the volume routine is called, the SCI_STATUS.0 is cleared (SS_REFERENCE_SEL). So I tried both the following ways:
- set bit 0 of SCI_STATUS every time I change the volume level (writing 0xc001 to SCI_WRAMADDR, then write the new SCI_STATUS value to SCI_WRAM as explaied in the datasheet);
- load Patch Version: 2.6 Modified: 2018-04-23 to the VS1053b then set bit 8 of SCI_STATUS (reading the patch documentation I understood the patch copy automatically bit 8 to bit 0 after every volume update)

So, both ways work!!....but....in both case, without playing any mp3 file, I eared noise from the speaker every time I change the volume level. I think it's due to the bit0 of SCI_STATUS that goes to 0 for a certain time before go back to 1 and it changes the analog output gain, generating that noise. If I repeat the same test (volume level changing with no file in play) without set SS_REFERENCE_SEL the noise is not present. I'm trying without mp3 in play just beacuse I can ear better the noise, but I'm sure the noise persist even playing mp3....so, how can I set the maximum swing without noise?

In addition I have seen there are bits 12:14 (SS_SWING) of the SCI_STATUS that could be used to Set swing to +0 dB, +0.5 dB, .., or +3.5 dB. I tried to set this bit to 7 (3.5dB) but the datasheet suggest to not use more then 2 (+1dB). Does these bits work in the same way of SS_REFERENCE_SEL? Because I'm considering to clear SS_REFERENCE_SEL and to use SS_SWING=7. In these way I can increase the output swing and I checked there is no noise on the speaker. Obviously I can't reach the maximum swing (SS_SWING = 7, SS_REFERENCE_SEL = 1) but if there aren't other solution it could be enough...I'm just scared by the datasheet phrase "Although the range of the register is upto 7, higher settings than 2 do not work and should not be used."

Anyway I'd like to understand the difference between to use SS_REFERENCE_SEL and SS_SWING.

Thanks in advance,
Nicola

Re: VS1053B SS_REFERENCE_SEL patch output noise

Posted: Wed 2018-05-02 10:06
by pasi
SS_SWING allows the volume control to amplify instead of just reducing. However, the sigma-delta modulator can only handle a little bit more. If increased more than a few dB, at certain (high) frequencies the modulator will overflow.

I think the reference select being set to '0' for a short period might produce the clicks you're hearing.

As a workaround, instead of adjusting volume from SCI_VOL, you could write the DAC_VOL register directly. The encoding section of the datasheet tells you how. However, if SCI_VOL (or SCI_BASS) is changed, you give a software reset, or restart the patch, that will overwrite DAC_VOL.

Re: VS1053B SS_REFERENCE_SEL patch output noise

Posted: Wed 2018-05-02 10:43
by cinpezzo
Thanks!! I'll try to write DAC_VOL directly. Just a question...I saw that the 8 bits/channel are managed in the following way:
bits 0-3: 6dB attenuation
bit 4-7: 0.5dB attenuation (range 0-11)

Does the bits 0-3 range from 0 to F or from 0 to E? If it's from 0 to F the maximum attenuation I can obtain is (6db*15) + (0.5dB * 11) = 95.5dB that is lower then the maximum attenuation I can reach using SCI_VOL to 0xFEFE (0.5dB*254)=127dB. Anyway -95.5dB could be ok for me...I'm asking just to check if what I understood is rigth or not.

Anyway, if I write DAC_VOL directly I think I could avoid to use the patch because the SCI_STATUS.bit0 will not be clear when I set the new volume level...does it right?

Thanks again.

Re: VS1053B SS_REFERENCE_SEL patch output noise

Posted: Thu 2018-05-03 10:20
by pasi
The maximum shift is 15, which leaves just the sign bit.

SCI_VOL values above 0xbfbf do not actually differ from each other (except the power-down value 0xffff).

Also, DAC_VOL 0x1010 = +0.5dB, 0x2020 = +1.0dB, 0x3030 = +1.5dB, 0x4040 = +2.0dB, but anything at or above will probably overflow the modulator at some high frequencies.

However, the positive gains are useful when using the I2S output without using the analog outputs.

If you don't need the other features of the patch, then you don't need to load it.

Re: VS1053B SS_REFERENCE_SEL patch output noise

Posted: Thu 2018-05-03 11:05
by cinpezzo
Thank you for the perfect explanation!! ;) ;)