24 bit audio boards

@whollender: no, there was no noticable noise of that extent.
A FFT analysis revealed lots of humming from low-frequency AC, but as far as I can tell, that is actual sound from electronic devices.
Being able to record beyond chunk sizes the RAM can hold has many advantages for "primitive" audio quality testing, as one can capture normal voice and music, vary in loudness and move the microphone around to verify that it is picking up real sound sources instead of internal distortions.

Your board looks really good, do you have more information available?
Looking at the pictures, U202 and U203 isolate the digital ground on the teensy (connected to a computer, which may bring all kinds of noise) from your main ground on the board. It follows that U301 is the 28-Pin TSSOP CS4272 chip which controls the show, and to the right are your stereo input and stereo output stages.
The 4 individual groups suggest that you have differential audio connection towards the outside world (probably to keep the audio quality high) .. but what I yet don't understand is the fact that you need four 8-Pin SOIC chips (2x input, 2x output) for that.
I thought a single LME49721 was already designed for dual channel (=stereo) operation - do you need this configuration for the differential output?
 
The 4 individual groups suggest that you have differential audio connection towards the outside world (probably to keep the audio quality high) .. but what I yet don't understand is the fact that you need four 8-Pin SOIC chips (2x input, 2x output) for that.
I thought a single LME49721 was already designed for dual channel (=stereo) operation - do you need this configuration for the differential output?

In order to do the fully differential input and output, I went with a fully differential amp (the THS4521) for each I/O. You can achieve the same thing with single-ended amps, but diff amps are better at driving fully differential signals.

I do have a second design that is almost identical, except for using the LME49721 to drive single-ended outputs. I don't plan on using that design unless the current board doesn't work well when it's driving a single-ended load.

Right now, the only real information available is the schematic: https://forum.pjrc.com/threads/27215-24-bit-audio-boards?p=59718&viewfull=1#post59718

I'll get more information up once I finish bringing up the board.
 
In order to do the fully differential input and output, I went with a fully differential amp (the THS4521) for each I/O. You can achieve the same thing with single-ended amps, but diff amps are better at driving fully differential signals.

I do have a second design that is almost identical, except for using the LME49721 to drive single-ended outputs. I don't plan on using that design unless the current board doesn't work well when it's driving a single-ended load.

Right now, the only real information available is the schematic: https://forum.pjrc.com/threads/27215-24-bit-audio-boards?p=59718&viewfull=1#post59718

I'll get more information up once I finish bringing up the board.

There's a board for the Raspbery PI, called "HifiBerry", I2S 24BIT 192KHz - from the pictures it seems to be very simple, and perhaps its possible to connect it to the Teensy, too.
I did not find any shematics, but from the pictures it seems that it has only the minimum required components, and so i'm sure your's is better.
 
Last edited:
unless i'm mistaken, that's the one i've been using : pcm5102a.

When used w/ raspberry pi, i think people mostly just use it as 16/48 (at least that's what you'd do if any sort of mildly interesting audio processing is to be involved)

Indeed, i found that the "DAC" (Raspberry 1) has a PCM5102, and the "DAC+" (Raspberry 2) a PCM5122.

I think it should be possible to use this boards with the teensy. Is this correct ?
Edit: of course not with 192 kHz :)
 
Indeed, i found that the "DAC" (Raspberry 1) has a PCM5102, and the "DAC+" (Raspberry 2) a PCM5122.

I think it should be possible to use this boards with the teensy. Is this correct ?
Edit: of course not with 192 kHz :)

yep, i have no experience with the pcm5122, but the pcm5102a is very easy to use. no i2c, no MCLK, no AC coupling needed; works out of the box with the audio library. i've been using it in a few teensy and raspberry pi projects. (none of them having to do with hi-fi though, they're all synthesizer modules).
 
Yes, you should be able to use it with the Teensy if you can find the pinout of the pi connector.

One of the things that I had been contemplating was an adapter board for the raspberry pi and the board I'm working on because the interfaces are the same (I2C control and I2S audio). The only downside is having to write a kernel driver :)
 
I'm sure there is already some linux-code somewhere in the web that could be used. It's not too hard to create a driver.
Years ago, when the raspi was very new, I patched the existing I2C driver to accept different speeds (before, it was fixed to 100khz) , and it was surprisingly easy to get my patch accepted by the maintainers of "raspbian" and in the official release. I think it's still there.
 
Last edited:
Hi guys!. I'm doing a DAQ with my raspberry Pi B+ and i'm using CS4272, but i have several problems with SPI communitacion. I'm using wiringPi library for GPIO (i so similar to C code) i don't understand how send my samples to DAC.
Could someone help me with that?
Thank you very much

Sorry, my level of english is very low :(
 
You may be able to approximate an I2S interface using the GPIO library, but it probably won't work very well because it's not using the dedicated I2S hardware on the Broadcom SoC.

The best way to do it is to write a kernel driver so that the normal audio programs on linux will automatically play through the dedicated I2S interface to the codec.

If the board I'm working on performs the way I expect and people are interested in a version that can talk to the raspberry pi, then I'll probably look into that, but I don't really have time at the moment.
 
Yes, it's expensive. Unfortunately, it's also very necessary.

Perhaps the PCB can be designed so either the isolation chips or some jumpers or resistors could be placed?

Paul,

I recently made some boards to interface a pcm5122 to a Raspberry Pi. I read this comment and am wondering if I need to add this level of complexity. I do not believe the i2c is used except to change volume or filter, etc, so during a 'listening session' I assume it is not contributing noise/distortion. Do I have this right? As for the I2S, this is probably a problem. As it is, I use the 3v3 supply on the raspberry to power the digital of the pcm5122 and have a low noise 3v3 regulator off the 5V supply for the analog side of the pcm5122 and these are star grounded on my board. If I were to do this, I would still need an analog and digital ground star connected, no?

Regards,

Keith
 
@keithg
The main thing is that there are no common return paths, so no digital return current can travel over the analog ground and vise versa. At these frequencies, using a star ground is an easy layout trick that can solve this issue.

I just checked the pcm5102 of the HiFiBerry and found a measurement
The spectrum is dominated by the distortion of the IC and some pickup of the mains. I don't think the mains is coming through the power supply, since there you would expect strong multiples of 100 Hz (rectified mains).

The good thing in their layout is that in the spectral domain no clear spurious due to the raspberry pi is visible, despite the close proximity.

On the other hand, what bothers me is the distortion. I assume here that the performance is not limited by the measurement equipment itself. The datasheet claims to have a SINAD of 93 dB (= 15.1 bits). The measured performance is 88 dB (ie. only 14.3 bits). This value should essentially be the IC itself, since there seems to be no output buffer amp on the board.
 
@kpc
Thanks for the reply. I am an ME with audio interests, so I am a bit light on the theory and experience for board layout. I did not get that analysis from the published graph of only 14.3 bits, but nice to know. I am wondering if I need to do anything more/different to get the best performance out of this design. I attach the schematic (basically straight from the spec sheet from TI) and the board layout if you care to comment. This is my Rev2 and I'd like to get as much improvement in it as possible before I have more made. My first attempt did not have a star ground, so that will be one improvement.

Thanks!

Keith
 

Attachments

  • pcm5122_dac_brd.pdf
    51 KB · Views: 320
  • pcm5122_dac_sch.pdf
    21 KB · Views: 345
Just with a quick look, the grounding looks strange to me. But on the other hand, professionally I designed circuits up to 120 GHz, so I lost the ability to see a PCB just as a connection, I am always thinking in E/H-fields, instead of a normal voltages/currents.
The analog signal is the most important signal. I drew the current the signal follows. Starting from the power supply capacitor to the IC, then from the connector and all the way back. You would want to make this loop as small as possible, to prevent any RFI/noise etc from entering the line. In general for these kind of lines, there should be a ground return path underneath, without any other line crossing the ground.
Furthermore, I do not really see the ground strategy. I would put the 'star ground' underneath the pcm5122.
From a filtering perspective you will always want to force the current over the capacitor. I do not know if you need the planes near the regulator for dissipation, If you need it, I would put slots in it, to force the current over the capacitors. Likewise, I would route the trace from R5 to C12, and then from the C12 pad to the connector, but like I sai, this is probably the RF engineer in me. Another thing about the capacitors, you will always want to place then with the smallest values near the IC, so swap C6 and C8.
return_current.png
Edit: I only drew the loop for the L-signal. If you imagine a similar loop that the R-signal will follow, you see both loops overlapping, thereby reducing the isolation between both signals.
 
Last edited:
@keithg
The main thing is that there are no common return paths, so no digital return current can travel over the analog ground and vise versa. At these frequencies, using a star ground is an easy layout trick that can solve this issue.

Yes, I agree with this.

The tricky part of achieving "no digital return current can travel over the analog ground" in practice involves what happens when you connect a Teensy+DAC or RaspberryPi+DAC to anything else which has a ground connection.

If your DAC has a built-in headphone or speaker amplifier and you connect the speaker directly, and it's a DAC output only (no ADC receiving signals from an audio system), then things are relatively simple.

But the moment you try to connect to anything else (which isn't purely battery powered and isolated from ground), you suddenly get other ground paths around that nice star ground.
 
I might not have been very clear, when I said
easy layout trick
I meant easy to remember, not easy to implement. I really do know the reality is very harsh.
 
kpc,

Thanks for the instruction. I really appreciate it. Yes, this is a dedicated digital to analog device (playback only). No analog in to deal with.

My (faulty) logic was to split the ground on the bottom and connect the analog and digital at J1. The ??? on your jpg refers the portion of the analog ground plane which is split from the output ground and connects at J1.

My 'strategy' was 3 separate the ground from the star at J1: one f for the PCM5122 Digital ground, analog supply ground and analog output ground and all meeting at J1. It is unclear on the PDF, but that is the layout. The large + fill is not needed, I can delete it and just use a large-ish trace for the analog + rail. From your comment,. though, my R ground will always cross the L signal unless I have a separate L and R ground traces on the bottom which do not cross. Is that what you mean?

I will noodle on this a bit... If I rotate the chip 90 deg, I can shorten the analog outs, and keep the + rail from crossing the outputs but the SDA/SCL will cross them. I'll try again, but with the star at the PCM5122 and see what it looks like.

Thanks!

Keith
 
I played a little with the layout as well. It is just a rough sketch.
I am not very proud of it.
The SDA/SCL crossing can indeed not be prevented. But then again these lines should be static when audio is playing.
I assume ground plane anywhere. The special zones are indicated with the green haching, as well as where they should be connected. In principle no line should cross a gap between groundplanes.
I am a bit unsure about Vneg. I assume it to be used for the analog stuff, so I also included the analog groundplane underneath it. Or is this voltage part of the charge pump?
testlayout.png
 
kpc,

Thanks for the help. I have not had time to work on it. Maybe this weekend. I spoke too soon, though. I do not think I have to rotate the part, but do have to move the regulator to the other side to do what you have outlined. I'll make these changes and see if I understand all of it and post back. Do you use Eagle? I could post the board layout in that if you want. Regardless, when I am done, the eagle files will be available for others to use/convert to teensy.

Keith
 
kpc.

The Gerbers are attached. One thing that was not clear to me was if I should connect the charge pump to the digital ground or the analog ground. I have it on the digital. Also, the low noise regulator is set up for the analog side of the 5122 chip. I use the on board regulator for the digital 3v3 supply.

Thanks again for the 'class' in board layout!

Keith
 

Attachments

  • pcm5122_V2.zip
    14.6 KB · Views: 335
Although the digital side is not very critical, I would align the digital signals with the connector where there is still round, instead of underneath the connectors.
Furthermore, I would give the power supply a little more space wrt the I2C.
I would also keep the I2C signals together.
I personally do not like the big loop the power supply takes.
As for the analog power supply, I see the clean power supply crosses the I2C signals. I would only allow it to cros the digital power supply
I would also keep the digital ground pin attached to the digital ground and the analog ground pin connected to the analog ground. (I hope the chip designers also kept it separate internally)
The input of the power supply crosses a gap. This is (almost) never a good idea. In principle there should always be a return path near the signal.
You can rotate the power supply 90 deg CCW. I kept the decoupling the same, but as there are now 4 C's at the output close together, I would move one of these C' as a 10/100nF input decoupling C, with the ground on the digital side, as this is where the noise is coming from, therefore the current should short this noise to its own local ground.
Finally, I would keep the charge pump also on its own ground.
keithg1.png

keithg2.png

Edit: I would also place capacitor at the (optional) power supply input, before the diode. I suppose there will be long leads attached, so it will be perfect as an antenna for picking up mobile phone signals. I do not know where you live, but here in Europe with GSM, all cheap audio stuff will perfectly detect the mobile phone signals. You want to short circuit these signals with a 100p...1nF capacitor.
The audio lines will also have the same problem, but these already have the capacitors.
 
Last edited:
kpc,

Thanks again. I think I follow most of your suggestions, but a couple have me stumped.
"but as there are now 4 C's at the output close together, I would move one of these C' as a 10/100nF input decoupling C"
The supply has 10uf/10nf on its output and the chip has 10uf/10nf as well. Do you suggest only having the pair at the DAC chip grounded to the digital instead of analog ground? My current layout does not show this, but it is easily done.

The other is the 5V lead. I need the 5V lead from pin2 on the 40 pin connector to supply the 3v3 regulator. You showed it connected to the 3v3 digital supply which I am pretty sure will not work. Your comment that it is a long run around the 40 pin connector, I get. Is it better to have a long run like that or to run it on the bottom and cut a slot in the digital ground? The only other way I can see it is to have a jumper on the board but do not know if that is even worse. Regardless, I added a small cap to digital ground for the alternate 5V input (J1). I do not intend to use it right now, but could, in the future, use a more appropriate supply on these pins to power the system (board and Pi).

Also, you showed pin VCOM (pin 10) connected to the digital ground. As I read the data sheet, it seems like this should be connected to the analog ground, but maybe I misunderstand. I interpret this as the ground connection for single ended instead of balanced output...

Are the grounds connected correctly, now?

Regards,

Keith
 

Attachments

  • ver_3.zip
    130.8 KB · Views: 262
Back
Top