Communicating with CS4360-KS DAC from Teensy LC for MIDI to CV

seren

Member
Hi folks!

I'm working on a project that requires a small element to convert 6 variable MIDI pitch values to high-res, CV voltage output. I've had quite a bit of wiring experience and know my way around building PCBs, but I'm a total newbie when it comes to writing the actual code.

All I need is 6 channels of straight pitch CV, no gate, no clock, no trigger. I do need this to be high-resolution and buffered, and preferably to come from a single DAC for space concerns.

I'm using an array of 12 capacitive touch sensors routed through the Adafruit MPR121 essentially as selector switches. These are sent into a Teensy LC to control 6 variable MIDI values. For ease-of-use/cost, I want to use the Teensy simply to channel these MIDI values through an i2c output to communicate with Cirrus Logic's CS4360-KS DAC, which supports 6 channels of analog data out, with a 0-5v range.

I'll link the datasheet for the CS4360-KS here:

https://rocelec.widen.net/view/pdf/zjzdsivdkg/CIRRS00248-1.pdf?t.download=true&u=5oefqw

I appreciate any guidance you all can give me!

Thanks,
-Sean
 
CS4360 probably isn't going to give you a satisfying synth Control Voltage (CV) output, even if you could output 3 stereo I2S channels (a capability Teensy 4.0 & 4.1 have, but Teensy LC does not). CS4360 has plenty of resolution, but like most DACs meant for audio it's quite lacking in DC accuracy.

cs4360_full_scale_voltage.png

Generally speaking, for CV you would usually want a DAC that lets you provide an accurate VREF voltage to define the full scale output. And of course you'd use a voltage reference chip to create that voltage.
 
Ah I see, thank you for your help! With the number of outputs and the expense of DACs, do you think filtering 6 variable PWM frequencies from a Teensy 4.1 would give a better/cheaper end result? Looking into a 2nd order lowpass filter or an appropriate buffer opamp, I see some pretty good results that might give a less complicated and smooth-ish signal for me!
 
The main problem with PWM is a trade-off between resolution and speed. On Teensy LC, to get 16 bit PWM resolution you need PWM carrier frequency no higher than 732.4218 Hz. Details here: (scroll down to "PWM Resolution")

https://www.pjrc.com/teensy/td_pulse.html

For a 2nd order filter to (mostly) remove the PWM carrier, you're going to need a very low corner frequency. Low bandwidth = frustratingly slow response.

A secondary issue with PWM is the filtered signal level is defined by the 3.3V power supply. So if you have noise or fluctuation on the power line, it will couple right to the output signal. This can be solved by creating a clean and precise power supply for a buffer chip, and then the signal level will be defined by the special clean power.

But there is no easy solution to the PWM speed vs resolution trade-off. Using Teensy 4.0 which runs its PWM peripherals at 150 MHz rather than 24 MHz will give you a 6X speedup. But six times faster than something painfully slow probably still isn't very satisfying. Likewise, a more complex low-pass filter can help only somewhat.
 
I think I understand what you mean.

I want to run a set-up by you, if you don't mind!

Let's say I sever the VUSB from VIN to allow me to use a 5v, 250mA external power supply. From what I understand, the Teensy has a pretty reliable/stable voltage regulator, so I'm thinking the extra amperage would help avoid fluctuation and give clearer power, even when other sensors are running/drawing power.

I would then use the USB Speed tool to raise the clock speed to the middle-zone 528Mhz, allowing me to use a higher carrier frequency of 8056.64hz at 14bits without sacrificing that much resolution. The highest note I want to be using is C7, which would be 2093.00hz. Then, would I be able to use the 2nd order lowpass filter at a much higher corner/cutoff frequency, bringing the speed back? I'm thinking around 6/7,000hz.

I also may be mixing a bit too much of my speaker-building knowledge into this, I'm not sure how much crossover there is!

Let me know what you think.

Best,
-Sean
 
I'm just trying to wrap my head around the impact on "resolution" filtered PWM signals have. I'm referencing a document from Texas Instruments here: https://www.ti.com/lit/an/spraa88a/...26491&ref_url=https%3A%2F%2Fwww.google.com%2F

It looks like with two 2nd order filters in series, they avoided using an op-amp altogether and managed to fake a 12bit resolution with extremely low clock and low carrier frequency. I'm wondering if this data could be used in this application! Maybe using two 2nd order filters in series will allow a steep rolloff to get rid of the ugly frequencies while using a relatively low PWM bit-resolution from the teensy, especially in combination with my stable external power supply.
 
Back
Top