Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 11 of 11

Thread: [queued] kxmx_kaugummi - A CS42448 Breakout Board

  1. #1

    [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 TDM signalling. 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):

    Click image for larger version. 

Name:	115c8b6eac1b4623a333d799f9b05749.png 
Views:	55 
Size:	32.1 KB 
ID:	18621

    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:

    Click image for larger version. 

Name:	IMG_20200102_224745.jpg 
Views:	71 
Size:	149.7 KB 
ID:	18622

    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.

    Click image for larger version. 

Name:	Screenshot from 2020-01-02 22-02-26.png 
Views:	55 
Size:	135.3 KB 
ID:	18623

    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.

    Click image for larger version. 

Name:	Screenshot from 2020-01-02 22-26-37.png 
Views:	49 
Size:	113.5 KB 
ID:	18625

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

    Click image for larger version. 

Name:	IMG_20200102_224319.jpg 
Views:	55 
Size:	156.0 KB 
ID:	18624

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

    Click image for larger version. 

Name:	Screenshot from 2020-01-02 22-26-44.png 
Views:	44 
Size:	138.4 KB 
ID:	18626

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

    Click image for larger version. 

Name:	Screenshot from 2020-01-02 21-55-30.png 
Views:	64 
Size:	34.7 KB 
ID:	18627

    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!

  2. #2
    Senior Member
    Join Date
    Feb 2015
    Posts
    217
    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.
    Last edited by wcalvert; 01-28-2020 at 03:44 PM.

  3. #3
    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.

  4. #4
    Senior Member
    Join Date
    Feb 2015
    Posts
    217
    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.

  5. #5
    can this be like a homemade expert sleepers audio interface ?

  6. #6
    Senior Member
    Join Date
    Feb 2015
    Posts
    217
    Not without significant upgrades to the Teensy Audio library. It can only handle stereo, not multichannel.

  7. #7
    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

    Click image for larger version. 

Name:	Screenshot from 2020-02-07 10-54-13.png 
Views:	42 
Size:	139.3 KB 
ID:	18979

    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.

  8. #8
    Senior Member
    Join Date
    Feb 2015
    Posts
    217
    That is really promising, thank you for taking the time to share the data. Great job.

  9. #9
    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!

  10. #10
    also - has it been alright to use the inverted VQ as a bias for inputs? e.g. have you noticed problems with this as of yet?

  11. #11
    You can disable the high pass filters by altering the default config struct at register 0x05 to be 0xDC instead of 0x1C. Setting it to 0xC0 disables the single ended flags as well.

    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:

    Click image for larger version. 

Name:	Screenshot from 2020-02-10 08-40-49.png 
Views:	92 
Size:	54.3 KB 
ID:	19013

    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:

    Click image for larger version. 

Name:	Screenshot from 2020-02-10 08-46-33.png 
Views:	36 
Size:	48.0 KB 
ID:	19014

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •