CS42448 board update for T4 pinouts and improved performance

Status
Not open for further replies.
Just for the sake of correctness.
Your statement is only valid for T3.x.
On the T4.0 the audio lib runs @ 44100Hz.

... and it supports any other frequency. 48kHz should work, with minimal jitter, but I have not tested it.
48kHz is interesting, so if there are any problems I'm willing to help to solve that.
 
Last edited:
Thanks Mhelin for the commentary,
One part of the circuit I'm not yet happy with is the 5V power changeover from VUSB to external. I've simply left it that you shouldn't plug both in a the same time. Not very elegant. I originally included a jumper, as it merely duplicated the "don't plug both in together" instruction. The only other solution I can think of would be a power management chip, but this would be better on the Teensy board than a daughter board.

What if you just required that the board is powered only using USB, a phone charger for an instance when it's not connected to PC, or connect the +5V socket to VUSB pins (on teensy) directly, they are directly connected anyway. Teensy 4.0 VIN is +5V. You could of course use a small 5V relay which disconnects VIN supply when VUSB is connected.
 
Neat idea - I hadn't thought of using Teensy's USB as ext pwr - simplifies that things a bit, and we're unlikely to get anywhere near the 1A limit (or even 500mA) of a phone charger.

As for the relay (or FET) - it's at least another 5 components. I've culled a lot of nice features to keep complexity and board size down, so probably not, this time around.
 
Thanks for the bow tie suggestion - it's saved some real estate and allowed "normal" operation OOB on the inputs and outputs.

While, I'm not trying for T3 / T4 compatibility on this iteration (first prototype), maybe later. There's plenty of real estate under the Teensy to allow for this, if needed. I've taken the view that Paul's version works with T3s, and that the sample rate differences between T3 & T4 make synchronizing digital connections between T3/T4s a pain (dropped or extra packets), that everyone will move fairly quickly to T4's, particularly if Paul does some T4.x's with extra pins someday (I'm personally not a fan of the Teensy's underside pads).

Here's the current state of the schematic and board layout.

@mhelin - I've decided to keep the AUX_ADC header, as I think some one who wants 6 inputs is more likely to want 8 than some of the other features I've had to forgo. As for a long MCLK degrading over distance - good point - I was thinking of a direct plug daughter card, rather than a ribbon cable, to keep signal line short.

I've kept the I2C, as some of the preamp designs I have in mind have digital pots for gain control.

I've combined all the ext power inputs into a single header. Possibly a pain with Ext 5v/USB powering and +/-V as well. I've kept a separate EXT_5V header just in case.

Board size is 109 x 90 - so within the Eurorack limits.

I'm getting to the point where I'm thinking about price points - as I suspect many more people would adopt a board populated with the basic components (everything except the LM358, shrouded I/O, ext power and I2C headers?) I can't see that I can get anywhere near the cost of Paul's SGTL5000 board - particularly with a small run.

$A40 BOM ($10 of this is the 3.5mm sockets)
$A17 - board, assembly and shipping, run of 20.

That brings the cost to $A56 (or $A46 without 3.5mm sockets), before overheads, postage etc. So the retail price would be around $A60 without sockets, and $A70 with. What do you think?
 

Attachments

  • cs42448 schematic.pdf
    214.6 KB · Views: 149
  • cs42448 layout.pdf
    779.4 KB · Views: 138
Last edited:
I felt bad about saying the jumpers for T3 / T4 could be a later addition.

Updated schematics and layout attached, with T3/4 jumpers included.

Please check my pinouts for both T3 & T4.
 

Attachments

  • cs42448 schematic.pdf
    217.1 KB · Views: 156
  • cs42448 layout.pdf
    772.4 KB · Views: 110
Hey thanks for running with the idea. I'm not up to speed with all the details of which pin goes where yet. Been mulling over building a Teensy synth incorporating some tricks I used in a self-build in the late '70s. Starting the audio design tool tutorial in the near future after installing some holes.
 
I felt bad about saying the jumpers for T3 / T4 could be a later addition.

Updated schematics and layout attached, with T3/4 jumpers included.

Please check my pinouts for both T3 & T4.

BLCK is still connected to wrong pin D22 it should go to D21.
 
Many thanks. BCLK fixed now.

Will republish in a few days after others have had a chance to comment.

Hope to send of the boards for a prototype (board only) run for completion before Lunar New Year takes my Chinese PCB house offline for a couple of weeks.
 
I've finally got the prototype PCBs back and loaded, and the initial results are not too bad: 80dB S/N and .0058% THD.

With some rerouting of MCLK (shortening its path and moving it further away from any audio lines) and adding the magic 100 Ohm resistor in series, I hope to improve the noise figures.

The final version will have provision on board for an CS5343 ADC to provide the two AUX inputs, bringing the total to 8 in - 8 out.


Noise: noise.png

THD: thd.png

Layout: v3 CS42448 Board.PNG
 
Looks good. I have a couple of questions...

1.) What was your test method (and equipment) for the above results?
2.) Did you happen to test DC signals as well?
3.) Which EDA software do you use, and do you plan to release the sources or just the gerbers?

Thanks for the update.
 
Test approach:
  • Focusrite Saffire Pro as test set (> 105dB S/N; < .01% dist in loopback test.)
  • RightMark
  • 1.8v p-p signal (-3.8 dB from clipping - so I could claim another 4dB S/N)
  • One channel driven, others shorted to ground (AC coupled)
  • CS42448 settings "out of the box" (i.e. high pass ADC filters still in place if Paul programmed them that way).

DC not tested, but allowed for by headers and jumpers. Library code would need modification to turn off HP filter.

Created in Eagle. Happy to release schematic, gerbers and BOM, not sure about releasing board routing files as I may do a production run if Paul thinks there's a market for it (as a service to the Teensy community, rather than as a profit-making venture).

You are welcome to one of the bare prototype boards (only two wire jumpers needed) or one of the next version boards when I get to them (they will have the CS5534 on board, unlike version 1). It's always nice to have someone else testing your work! (Same goes for any of the folks who provided useful suggestions during the initial design.) The BoM cost about $75AUD including all the headers and jacks.

Image is my testbed board, with pins instead of jacks and proper headers:
cs42448 v2.jpg
 
Last edited:
Instead of CS5343, why not pick an ADC that's balanced, like the other 6 inputs? Just a thought.
 
Yeah, that could be an idea.

Board real-estate is very tight with the extra chip on board (and I'm trying to keep within the Eurorack limits), but I'll see if I can fit the extra pins & components.

Any suggestions of appropriate ADCs?
 
To answer my own question - the CS5361/5381 seem to be candidates - with no others at reasonable cost and in reasonably small packages (TSSOP 24 or less) from other manufacturers.

I'm not sure if I can fit the larger TSSOP 24 (7 x 8mm) package on the board in place of the current TSSOP 10 (3 x 5mm) for the CS5343, but a first glance at the specs look OK.

One upside of the 5361 would be 0.65 mm pin spacing, rather than 0.5mm on the 5343 which is a real accuracy test for PCB loading and soldering!

Sadly, the unit price of the slightly better spec'd 5381 is prohibitive ($42 AUD), leaving the 5361 as a candidate ($17 AUD). However it is still much more expensive than the CS5343 ($6) and on par with the CS42448 ($17).

All in all, I don't think it's the best value to upgrade - and I'm unsure how many people would use the differential inputs anyway. If the use was professional audio and we were looking for the best CMRR/noise performance at 24 bits, then the upgrade would be worthwhile.

On balance, I'm retaining the CS5343 for at least the next version - with 6 channels fully differential and the last 2 single ended. Thanks for triggering the thinking, if this board takes off, then the Mk III version will definitely get the upgrade!

BTW: I haven't published a schematic for a while. I'll upload one after I get the file size below 2MB!
 
Last edited:
I'm interested in multichannel audio.
Last year, I've tested Teensy's TDM capability with the CS42448 audio codec board, which I found here in this forum.

Thank you very much for this great contribution!

While looking further into audio performance and it's application for stand alone sound modules, modular or installative works, I was interested in using active filters for all inputs and outputs.

The CS42448 developer boards seemed to be well documented and I decided to make a layout based on it. From my previous analogue projects I've 8 channel buffers and amplifier modules for further signal conditioning.

When I've found this thread a couple of days ago, I thought that I could share my layout and discuss it here, if someone is interested in.
I still need to double check some footprints and component availability as well as the Teensy connections and the analog and digital ground section. I'm thinking about making a slit in the ground section to separate the digital part. But I'm not that deep into implementing proper grounding in mixed signal designs.

There are already some very nice and thoughtful CS42448/Teensy layouts out here, which consider different applications and, most important, these designs are very elegant and usable. Whereas the layout I did according to the CS42448 developer board is quite big and has a high part count and includes even 402 smd packages. I guess it's recommendable to use a stencil and reflow ofen to build this board.
Nevertheless, it could be interesting for some people.
2020-05-25 14.19.20.jpg
 
Those long loopy rails look like big inductors or antennas to me ...

My experience is that high-quality audio benefits from four-layer boards, and may benefit from two-sided component mounts.
Four-layers isn't that much more expensive than two-layer (I mean, the PCB is twice the cost, but the PCB isn't the biggest part of the BOM.)
Double-sided surface mount is tough for home-solderers, but if you use a place like Macrofab, they charge no extra for double-sided stuffing.

Anyway, so, with a four-layer board, you'll want to use a wide ground layer right underneath the signals, and a wide power layer below that.
You may even want to route all the components with via-in-pad, with a layer order of something like GND+pads, signals, power-and-signals, GND.

Also: film capacitors, thin film (or even metal foil) resistors. Yes, it increases BOM cost. Yes, it's worth it.
 
Just to add to the layout discussion, small component spacing is a pain for home builders but also fabricators.

Keeping the analog and digital ground planes separate, and joining them up under the CS42448 is best practice. On my board I've put a separate ground plane under the Teensy and stretching to the CS chip, particularly to avoid audio return (ground) currents from travelling through the noisy digital groundplane around the Teensy.

As @jwatte noted, long loopy rails act like inductors, so need to be properly bypassed to avoid becoming noise transmitters. It's unclear from your image whether this is being done. 100nF X7R every 2-3 linear inches / at each chip is about right.

Make sure you specify COG capacitors (or electrolytics) for any audio capacitances - particularly those across the AIN+/- inputs. X7Rs, which are great for bypassing, have non-linear V-C coefficients and can add significantly to overall distortion.

Best wishes for your board.
-------------------------------

For those following the original thread, the final prototype boards are still stuck in a Chinese dispatch centre - for more than 6 weeks now!

One of the disadvantages of living in Oz is that there are some very good PCB manufacturers, but they tend to be on the expensive side.
 
Make sure you specify COG capacitors (or electrolytics) for any audio capacitances

That's not really feasible for the main inline DC blocking caps and bulk capacitance, though. Hence, the fall-back to film!
Even there, a 4.7 uF capacitor is going to be 7.5x7.5 millimeter of board space, 20 mm+ tall, and cost you a buck fifty, each.
High quality audio is expensive, compared to digital.
 
Last edited:
Thank you very much for your feedback. Much appreciated!
Those comments make sense and I'll consider them.
When I'm continuing on this project I'll open up a separate thread.

But I'll follow up on palmerr's original thread here. Hope that you'll get your boards soon!
 
Folks,

I've reopened this project after a long COVID delay, where other things needed to be attended to.

Taking a quick look at the revised I2S-oct objects (teensyDuino 1.53), it seems like you're now using 4 pins to transfer TDM data (SDIN_0..3 and SDOUT_0..3). Is this correct?

If so, which Teensy pins do they connect to? I'm not sure whether the CORE_PINS are the same as Teensy "D" pins and which SDIN/OUT signal goes to which pin. Also, it appears that they are multiplexed, rather than separate SDIN and SDOUT pins.

Input_i2s_oct.cpp[50..59]:
Code:
AudioOutputI2S::config_i2s();
I2S1_RCR3 = I2S_RCR3_RCE_4CH;CORE_PIN7_CONFIG  = 3;
CORE_PIN32_CONFIG = 3;
CORE_PIN6_CONFIG  = 3;
CORE_PIN9_CONFIG  = 3;
IOMUXC_SAI1_RX_DATA0_SELECT_INPUT = 2; // GPIO_B1_00_ALT3, pg 873
IOMUXC_SAI1_RX_DATA1_SELECT_INPUT = 1; // GPIO_B0_10_ALT3, pg 873
IOMUXC_SAI1_RX_DATA2_SELECT_INPUT = 1; // GPIO_B0_11_ALT3, pg 874
IOMUXC_SAI1_RX_DATA3_SELECT_INPUT = 1; // GPIO_B0_12_ALT3, pg 875

I'll update my 8x8 board (CS5343 for the final two input channels) with balanced ins and outs, to fit the new data transfer scheme and put the gerbers up for general use.


Richard
 
Talking to myself here...

Looking at Paul's layout for his updated CS42448 board https://hackaday.io/project/2984/logs, it doesn't appear that the 4-channel SAI (TDM) is implemented on the board.

teensy cs42448.jpg

The pins at the bottom right corner (CS pins 11-17), clearly show only SDOUT1 (pin 13) and SDIN1 (pin 17) connected, the spare SDOUT pins NC, and SDIN pins grounded.

Yet the doco in the Audio System Design Tool says:

Code:
INPUT: 

Teensy
4.x Pin	Signal	Direction
21	BCLK	Output
23	MCLK	Output
8	RX (ch 1+2)	Input
6	RX (ch 3+4)	Input
9	RX (ch 5+6)	Input
32	RX (ch 7+8)	Input
20	LRCLK	Output

OUTPUT

Teensy
4.x Pin	Signal	Direction
21	BCLK	Output
23	MCLK	Output
7	TX (ch 1+2)	Output
32	TX (ch 3+4)	Output
9	TX (ch 5+6)	Output
6	TX (ch 7+8)	Output
20	LRCLK	Output


This all makes sense, but I still can't reconcile the board layout with the code and doco!
 
Last edited:
Yet the doco in the Audio System Design Tool says ...

You're looking at the wrong documentation. That's the 8 channel I2S. But this board uses TDM protocol, not I2S protocol.

These are the documentation:

https://www.pjrc.com/teensy/gui/?info=AudioInputTDM

https://www.pjrc.com/teensy/gui/?info=AudioOutputTDM

The CS42448 chip does support both I2S and TDM protocol. If you really wanted to use it in I2S mode, you could (designing a different PCB, of course). But you'd also need to write your own code to configure the chip using I2C.

This control code in the audio library configures it with TDM.

https://www.pjrc.com/teensy/gui/?info=AudioControlCS42448
 
Status
Not open for further replies.
Back
Top