cs3318 and arduino

If you have the click issue with the PGA you will also have it with the CS. It is not caused by resolution but by having some DC offset on the signal. When switching the DC offset changes and that sounds as clicking. Because of the DC, the zero=volt switching of the PGA will not work.
Get rid of that and you get rid of the clicking.

Jan

Believe me, after everything ive been thru this chip i can assure you its not DC offset.
To proof my clame i did an audio clip record, i saw the steps, it very clear even without zooming.
Another proof is i did a nother test.
I connecred pin 10 via 30k resistor to GND, and the outpit of R to the input of L.
Doing some mods to the code and i manage to increase the resolution by 4 (or even more, i dont recall exactly), and guess what? The clicks where history.
Said that, i dont really think my solution was the best way to illuminate the clicks.
Used dc coupled caps, in the inputs, input buffers using OPA's (Mark Hennessy), all kinds of power supplys, endless night of researchs.
And more then 100 emails help from Jeff, a member in this forum.
The click will always be in this chip.
If yoy cant hear them, it means your speakers are not good enough.
Its not for home theater, its for studio use.
So my speakers are high top notch super qualiy ones.
I can hear every click, pop or a fly that was on the end of the room during record.
Try to record the ouptut of the PGA and look at the waveform you recorded.
Use 500Hz sine wave.

If you can proof to me otherwise ill be more then happy.
 
AX tech editor
Joined 2002
Paid Member
Last edited:
I have done projects with PGA as well as CS3318, like this:

https://linearaudio.nl/dcx2496-active-output-mod-6-channel-vol-control

All click-free, if you take care to have no DC on the signal lines.
All these chips have zero-crossing switching, which should be enabled default.

Jan

Thank for your reply.
Assuming you've read my previous post and still think i have DC issues, can you please tell me how to get rid of them?
Il be greatfull to not throw my project away.
PS the zero cross at pin 1 is always connected.
Regards,
Isak
 
Last edited:
One thing you could do is ground the input and see what comes out of the output.
You could also pick up clock noise from your wiring. Try to disable the chip switching by disabling the select line, and then do clocking to see if that is the case.

Jan

I dont think this is the cases, but its worth to try.
Ill try this later on today and post the results here.
 
Think about it logically. Almost nobody has switching issues with these chips when properly implemented. Therefore it must be external to the chip. 1 + 1 = 2.

jan
BTW, the clicks are only happening in Volume change the lower the volume goes the lower the clicks, the higher, well...higher clicks.
If nothing is connected i have no clicks on volume change.
I meant to say i already checked the above mentioned by you, and ill recheck them.
For the meantime, you try my test, try to record the output whwn the volume goes up and down all the way.
You will see the steps im talking about.
 
Last edited:
AX tech editor
Joined 2002
Paid Member
BTW, the clicks are only happening in Volume change the lower the volume goes the lower the clicks, the higher, well...higher clicks.

This seems to imply that it is related to the input signal level which would make sense with DC offset, but you say you don't have any. I assume the chip input is terminated to ground with a resistor for DC bias.
Is the PGA channel ground connected directly to the signal input ground, no chance of a (DC) ground loop in the play?

You will see the steps I'm talking about.

Yes of course you will see steps, it is the signal getting larger or smaller and that goes in steps. If you can zoom in you will see that it happens on a signal zero crossing, or at least it should be.

Jan
 
This seems to imply that it is related to the input signal level which would make sense with DC offset, but you say you don't have any. I assume the chip input is terminated to ground with a resistor for DC bias.
Is the PGA channel ground connected directly to the signal input ground, no chance of a (DC) ground loop in the play?



Yes of course you will see steps, it is the signal getting larger or smaller and that goes in steps. If you can zoom in you will see that it happens on a signal zero crossing, or at least it should be.

Jan
Ok, as promised here are the resouts.
As i said before, not an mm of offset, and the clock is crystal clean.
If i came to the conclusion that its the resolution, its becouse I tried everything as i said before.
The audio wave coming out from my pro sound card at 0dB (max vol), 500Hz sine wave, when the pga delay time is set to 20ms between each step.
Im a synthesis guy, so i know synthesis very good, i create the sound that suppose to be geeting out from the pga, meaning i created an audio file, sine wave, 500Hz, 20ms step and 0.5dB for each step logarithmic! And i did the changes on the zero corss, so no way i should hear any click, right?
WRONG!
When i did this sound test, nothing was involved, no pga, no arduino, the sound card directly to the studio monitor, i must say i wasn't surprised when i heaerd the clicks, not just the clikcs, even the same tone of the clicks, the same harmonical tones.
So finally i can say its the resolution!
If you my friend cant hear it there is 2 possibilitys why...
1. You dont hear becouse you just cant hear it.
2. Your speakers have a bad resolution frequency.

Cheers,
Isak.
 
When i did this sound test, nothing was involved, no pga, no arduino, the sound card directly to the studio monitor, i must say i wasn't surprised when i heaerd the clicks

I don't understand. You connect your sound card directly to the speakers, with no PGA2310 in the signal chain and you get clicks? Doesn't that mean the clicks are nothing to do with the PGA2310 and some other problem with your setup?
 
I don't understand. You connect your sound card directly to the speakers, with no PGA2310 in the signal chain and you get clicks? Doesn't that mean the clicks are nothing to do with the PGA2310 and some other problem with your setup?

Hi
Please read carefully what i did with this test.
I illustrate the sound behaviour by generate the same sound as the pga2310 is outputing with a audio editing software.
Then i play this illustrated sound without going thru the pga at all, from my sound card to the studio monitor.
The clicks where there.
Meaning it doesn't matter what ill do, the clicks will always be there.

I hope its more clear now :)
If someone want me to upload the audio clip i illustrated for the test ill be happy to send it.
 
Last edited:
fwiw, on the 3318 I built many years ago - and on the pga project I'm currently working on, there are no clicks that I can hear as you vary the knob or remote.

on the pga, one trick is to use the reset line at startup as a calibration line. the spec sheet talks about bouncing that line in order to set the 0-crossing logic properly. maybe you are not doing that?

I gave up on the 8ch chip (for now) since its expensive, it does not seem to be better than the pga (when both are properly implemented), its harder to solder and it needs level shifting (3v instead of 5v). the 3318 is a fine chip but I'm now spending my time on the easier to buy and build pga2311/10.

again, neither had clicks as you vary the controls. so I know its possible to have a clean build. a clean build is the sum of many little details and its possible if you got a few of the small details wrong, this could add noise to your system.

I'm preparing a group buy/build on my pga project. you are welcome to join and try building a pga with my board and my firmware. if you do that, you'll get a good ref implementation and you could use that to debug your other builds to see what they did wrong.

I will post a note to this thread (and others that apply) when I'm ready to start the beta test. I plan to have full parts kits and boards and a detailed build-it guide for the beta team.
 
fwiw, on the 3318 I built many years ago - and on the pga project I'm currently working on, there are no clicks that I can hear as you vary the knob or remote.

on the pga, one trick is to use the reset line at startup as a calibration line. the spec sheet talks about bouncing that line in order to set the 0-crossing logic properly. maybe you are not doing that?

I gave up on the 8ch chip (for now) since its expensive, it does not seem to be better than the pga (when both are properly implemented), its harder to solder and it needs level shifting (3v instead of 5v). the 3318 is a fine chip but I'm now spending my time on the easier to buy and build pga2311/10.

again, neither had clicks as you vary the controls. so I know its possible to have a clean build. a clean build is the sum of many little details and its possible if you got a few of the small details wrong, this could add noise to your system.

I'm preparing a group buy/build on my pga project. you are welcome to join and try building a pga with my board and my firmware. if you do that, you'll get a good ref implementation and you could use that to debug your other builds to see what they did wrong.

I will post a note to this thread (and others that apply) when I'm ready to start the beta test. I plan to have full parts kits and boards and a detailed build-it guide for the beta team.
Thanks for your reply Brian.
Well, again ill be happy if someone can proof me wrong.
Im not aware of the reset code your talking about.
Can you please show me what your talking about?
BTW, ive ordered the PGA2310 EVM just in case im wrong.
 
Last edited:
on the pga, one trick is to use the reset line at startup as a calibration line. the spec sheet talks about bouncing that line in order to set the 0-crossing logic properly. maybe you are not doing that?
I just read the datasheets again, pga2310,2311,2320, I do not see any mention of this.
I did see,
Muting is accomplished by switching the input multiplexer to analog ground (AGNDR or AGNDL) with zero crossing enabled.

On power up, “power–up reset” is activated for about 100ms during which the circuit is in hardware MUTE state and all internal flip-flops are reset. At the end of this period, the offset calibration is initiated without any external signals.
 
I think its the MUTE line on the pga. on the cirrus 8ch, I think they call it 'reset'.

wiggling the mute line at power-up is one thing that is not too obvious but I think it does get mentioned or implied. I'm not sure if this is a big thing or not, but in my early builds I tied that mute line to a solid high or low (whatever I needed) and it never bounced. now, I run a gpio line from the cpu and bounce it at system startup time. I think that calibrates the zero crossing (but who really knows).

I'm also prebuffering and post buffering and cap-blocking where needed.

I don't have a good circuit board for the 8ch chip but I'm about to rev the pga board another time. you can get one of those boards (if they check out ok when I do a test build, first).
 
Linuxworks
Can you do me a favour please?
Run into your PGA2310 (not 2311) a sinewave at 0dB, 500Hz for 30 seconds.
Play it using what ever software you want (winamp, foobar etc)
And record the output from the PGA2310 to your soundcard while you do volume change going up and down, up and down, save it and send it over or upload in SoundCloud or what ever you like to upload to
You can use Adobe Audition to record the PGA2310 output.
After ill hear it in my studio environment system ill be more the convinced that the PGA2310 is really clicks free.
 
Last edited:
wiggling the mute line at power-up is one thing that is not too obvious but I think it does get mentioned or implied. I'm not sure if this is a big thing or not, but in my early builds I tied that mute line to a solid high or low (whatever I needed) and it never bounced. now, I run a gpio line from the cpu and bounce it at system startup time. I think that calibrates the zero crossing (but who really knows).

I'm also prebuffering and post buffering and cap-blocking where needed.
.
i use the same buffers in and out and cap-blocking as you did.
but the MUTE is something that i didnt thought of.
i found this is the datasheet...
"The MUTE pin is active low. When MUTE is low, each channel is muted following the next zero crossing event or
time-out that occurs on that channel. If MUTE becomes active while CS is also active, the mute takes effect once
the CS pin goes high. When the MUTE pin is high, the PGA2310 operates normally, with the mute function
disabled."

is this what you mean by saying "mentioned or implied"?
i'm not a code guy so can you please tell me what should be the code line for this?
 
On power up, “power–up reset” is activated for about 100ms during which the circuit is in hardware MUTE state and all internal flip-flops are reset. At the end of this period, the offset calibration is initiated without any external signals.

hi rsavas.
where did you saw this line, in the pga2310 datasheet?
do you have the same clicks as i have in volume change?