If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

[queued] kxmx_kaugummi - A CS42448 Breakout Board

The Cirrus Logic CS42448 [datasheet] is a 6 input, 8 output audio codec supported by the Teensy Audio library using TDMsignalling. Although there is a board design already available for this codec, I was interested in getting it to work with my Eurorack modular synth gear. This requires scaling the input and output voltage ranges differently than the existing board does, and I wanted to see how well this audio codec (which is designed for AC signals) can deal with DC.

This motivated me to create a breakout board which simply gives breadboard access to the differential input and output pins of the codec. There is a version for the Teensy 3.5/6 which I've built and tested, and a version for the Teensy 4.0, which I've not yet built. I decided on a form factor which extends beyond the Teensy lengthwise (hence the chewing gum):

This allows the breakout to fit in a breadboard, and if the Teensy is mounted using stackable headers, access to all of the side Teensy pins as well. Here is the Teensy 3.6 version:

To test the outputs, I configured eight sine objects to output at 1kHz to all eight TDM channels using the Audio Library GUI tool. I measured all 8 differential outputs and got the expected result, as documented in the datasheet.

To test the inputs, I simply routed the TDM input directly to the TDM outputs (1-6) using the Audio Library GUI tool, I then used my function generator to produce a differential sine wave at 1kHz, biased to 2.43V (the value I measured at pin VQ) and applied it to the inputs.

I then attached my scope to the corresponding outputs...

...and verified the sine wave was indeed being passed through from input to output.

A quick spectral analysis of the passed-through signal shows a reasonable noise floor and no noticeable distortion (@10kHz).

The projects for the (Teensy 3.5/6) and (Teensy 4.0) are open source and available under the CC-BY-NC-SA 3.0 to make yourself and modify if you feel so inclined. I made an effort to select well stocked parts from LCSC, so it should be possible to have the boards made by JLCPCB and order the BOM from LCSC for under 20$ shipped (excluding the Teensy and the codec of course). Hope someone can make use of this!

Would you be able to comment on the usability with DC-ish signals, let's say under 5Hz? Looking closer at the datasheet, I see there is a high pass filter on the ADCs which can be disabled, but it doesn't look like the output filters can be disabled.

Signals 5Hz and under are definitely attenuated on the ADC side. I haven't found the time to extend the API of the control_cs42448 object in the audio library to manipulate those additional registers, which will be necessary to disable the ADC high pass filters.

I didn't see any particular mention of high pass filters on the DAC side in the data sheet, how did you come to that conclusion?

So far, I've only tested low frequency/DC signals from input to output, ie. ADC in, through the Audio library, and DAC out. It's hard to say from that test whether the attenuation I saw comes from the ADC high pass filters, DAC high pass filters, or both. If I get a chance, I could try and output a synthesized low frequency or DC signal to see if the DACs attenuate it at all. I'll update here when I get a chance to sit down and test that.

On page 17 of the datasheet (https://www.mouser.com/datasheet/2/7...F5-1141475.pdf) it mentions "Frequency Response 10 Hz to 20 kHz" and gives some attenuation values, which made me think the onboard DAC output filters are high pass filters with the cutoff frequency set less than 10Hz. Admittedly, that is a guess... because I didn't see the datasheet say it explicitly.

Anyway, I would be interested to see any additional data that you collect about the DAC's capability with DC.

Just a quick update, I checked for the presence of high pass filters on the output of the codec, there are none. I was able to synthesize low frequency to DC signals and output them without a problem. I also disabled the ADCs high pass filters and was able to pass DC signals through the Audio library without a problem.

Green trace = input
Yellow trace = output

I also disabled the "single ended mode" registers for two reasons:

1.) Single ended mode applies a 6dB digital gain.
2.) Things get wonky if input voltage approaches full scale. According to the datasheet: "For single-ended inputs, the analog input level must remain at or below full scale to avoid wraparound of the resulting ADC codes." which explains this.

Disabling the high pass filters and the single ended inputs caused the codec to behave according to the data sheet with DC signals. I wasn't able to test how much DC error is present, that task is for another day.

fantastic work and thanks for sharing.
do you mind outlining how you disabled the HP filters in control_cs42448?
also - did the DC signals pass with single-ended inputs below the full-scale input levels? were the problems specifically as they approached maximum levels, and is that something that could be optimized with a lower-gain input amplifier?
i'm planning a six-input board for modular levels and it seems like a shame to double the parts count on the inputs to generate differential signals : (
following your project and curious how the T4.0 works! thanks!

This is just a temporary workaround of course, as manipulating these registers should be exposed as methods.

I did not attempt to pass DC signals in single ended mode with a single ended input. I assume this would possible by driving the negative leg of the differential input to the common mode.

When in single ended mode, the ADC overflow occurs a bit below full scale, perhaps 6dB below (which would be weird...). When accurately measured, it should definitely be possible to scale the gain of an input stage to accommodate. on the other hand, the overflow itself works like a digital wave folder. which might be desirable depending on how it actually sounds.

I assume you mention inverted VQ in reference to the input stage I posted in another thread. In simulation this seemed to work, I did not test it, so, caveat emptor. I'm also working on a 6x8 Eurorack module (in 4hp with the coming Teensy 4.1 if possible), but after experimenting with the codec I decided to interface with it in differential mode because it behaves more predictably. I've got a low part count input and output stage simulated. I'm no EE but it seems to behave well under the ideal conditions of a simulation (I've not yet breadboarded them). Here is what I have so far:

This circuit scales 20VPP to the codec full scale input, and the full scale output back to 20VPP. The input stage will require either a buffered VQ, or VA/2 for the bias. The part count is about as low as I could get it per channel in differential mode. The input stage has a single pole filter which should cover what the datasheet recommends, The output has a two pole filter. Here is a plot of the cutoff/slope:

This circuit is not optimal as it contains no protection from overdriven signals, ESD, or other transients, but I'm willing to risk it to keep the cost/complexity down.

I don't have high hopes that the codec will handle DC signals very accurately, it is an audio codec after all. I wouldn't expect V/Oct tracking without multi-point calibration. That being said, there are a myriad of DC/LF use cases that don't require V/Oct accuracy, and the DSP capabilities of the 1062 are better than almost anything else Eurorack at the moment.