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

Thread: SGTL5000 for DC control voltage output

  1. #1

    SGTL5000 for DC control voltage output

    Can the SGTL5000 be used like a regular DAC with regards to just staying at a certain voltage if desired? I would like to use it for modular synth control voltage (CV). Just want to make sure it's not necessary for it to constantly receive a stream of data. I'm not familiar with I2S.

    I'm going to revisit my Teensy 3.x synth project, but this time around I'm going with an SSI2144 VCF and an analog VCA. So I'll need a bunch of control voltages in addition to the DCO from the Teensy.

  2. #2
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    5,670
    I2S is a continous stream of data. And i'd say the SGTL5000 is not a good choice.. i'm sure there are better (non-i2s) chips to do this. But if you really want to use an I2S-Audio-DAC, maybe try the cheap Pt8211??

    ..but..really, if I were you, i'd try to find an other, non-I2S chip.

    https://de.rs-online.com/web/c/halbl...ort-order=desc

  3. #3
    I'm trying to keep the analog output under control of the Audio Library. I guess I'll have to hook the SGTL5000 up to a DC source in the designer and see what it does. Certain things like resonance CV can probably just use a heavily filtered PWM. 3db point there could be 1 KHz.

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,174
    To use the SGTL5000 chip for DC coupled control voltage (CV) you'll need to access the pins directly. The audio shield has 2.2uF capacitors in series with the signals.

    Click image for larger version. 

Name:	schematic_audio2.jpg 
Views:	57 
Size:	69.6 KB 
ID:	13485

    You might also find the pin 10 (VAG) on the SGTL5000 useful. It's the DC offset voltage the chip uses for its signals. This pin is sensitive, so you probably want to use a JFET or CMOS input opamp to buffer it. Then you could use another opamp as a subtractor circuit to try to remove the DC offset, and then of course add gain to get the signal up to a +/- 5V range (or whatever you're using for CV).

    Both the offset and gain will probably need trimming. For a low volume product, this might be easiest to do with analog circuitry, if the PCB space and extra time for a calibration step to adjust them is acceptable. Of course the more modern approach would involve characterizing the hardware, which still requires a calibration step but perhaps with a fancy PC-interfaced multimeter. Then you could store the DC offset and gain adjustment in your code and apply them with DC synth & mixer objects. A few times I've considered making a 4-channel DC coupled version of the audio shield for modular synth folks, where we'd do this here at PJRC and store the 8 calibration values in an EEPROM chip. Maybe someday....

    Hopefully this helps?

  5. #5
    Thanks Paul. I plan on using a buffer-amp circuit found here in the forums (it's from a Mutable Instruments module) to get the CV to the +/- 10V range needed by the rest of the analog circuitry. Offset isn't that big of an issue as the VCF has an adjustment for that. I suppose in a real product you'd use an extra DAC/ADC pair to measure the offset and then tweak vRef through an op-amp summer until it zeros. I'm just buildinhg "modules" out of perma-proto boards for synth tinkering.

  6. #6
    I swapped the 2.2 uF caps with 1k resistors (they were the only 0603 parts I had). Here's the results:

    The 'dc' object is really just meant to provide evelope control inside the audio library. Yes it did change the DAC output, but it's inverted, and it swings around a rather small output range when fed with values between -1 and 1. Same deal on very low frequency square waves. High is about 1V and low is about 1.6V

    So, no, you can not use the audio library to produce external DC control voltages. But that's OK, it is not really hard to make linear slope envelopes driving external DAC with a state machine. You could keep the library to use as an audio waveform generator. I think making good waveforms without aliasing is the hard part.

  7. #7
    Junior Member
    Join Date
    Jan 2019
    Posts
    7
    Hello Paul,
    I really love the Audio Shield and am planning to use it, however what I first prototyped on the EuroShield does not translate well to the breadboard.
    I need DC current for one of my audio outputs (I use each channel of the stereo output as a mono output), as it is planned to be used as a gate signal.
    While the DC output works perfectly when using the EuroShield, when using the Audio Shield alone for a new project, the signal is attenuated over time (gate signal becomes like low-frequency saw) and not unipolar anymore (my strictly positive signal becomes negatively offset). What is the easiest way to fix this?
    Should I try to locate the 2.2F capacitor of this channel, unsolder it and replace it with solder?
    Should I leave it in place and solder a wire to the jack output before the capacitor?
    Regarding the offset, is it not possible, without using pin 10, to ask the SGTL5000 not to add any offset to its output?
    If not, can you quickly sketch the circuit that needs to be used?
    Thank in advance for your answer!
    Edouard

    Quote Originally Posted by PaulStoffregen View Post
    To use the SGTL5000 chip for DC coupled control voltage (CV) you'll need to access the pins directly. The audio shield has 2.2uF capacitors in series with the signals.

    Click image for larger version. 

Name:	schematic_audio2.jpg 
Views:	57 
Size:	69.6 KB 
ID:	13485

    You might also find the pin 10 (VAG) on the SGTL5000 useful. It's the DC offset voltage the chip uses for its signals. This pin is sensitive, so you probably want to use a JFET or CMOS input opamp to buffer it. Then you could use another opamp as a subtractor circuit to try to remove the DC offset, and then of course add gain to get the signal up to a +/- 5V range (or whatever you're using for CV).

  8. #8
    Why dont you just use the teensy's dac for dc? Codecs are designed for ac...you can use both at the same time in the audio library.
    Or if all you need is a gate why not use a digital pin instead?

  9. #9
    Junior Member
    Join Date
    Jan 2019
    Posts
    7
    Thank you so much for your suggestion. You're right these were options, to use the Teensy's DAC and a digital pin for the gate. I guess that even for my first project, I wanted to have a 16-bit output for the audio output, and have a slew option on the gate signal that allows it to be transformed into an envelope, which I don't think a digital pin can do, I think it only does HIGH or LOW. Maybe in analog mode it would work though, I'd have to test if it works and what is the resolution. But in any case, I don't think I can avoid to add op amps after my outputs, in order to be at Eurorack levels.

  10. #10
    Oh, so you want an envelope.
    I think you misunderstood me, you can use the audioshield for audio AND the teensy's DAC(s) for envelopes, lfos, dc voltages, etc... at the same time.
    The DAC is 12 bit i believe, more than adequate for what you want.
    And yes, you will need amplification for euro levels for sure

  11. #11
    Junior Member
    Join Date
    Jan 2019
    Posts
    7
    Yes you're right I could try to use the Teensy's 12-bit DAC at the same time. I'll investigate that. Thanks a lot!

  12. #12
    Junior Member
    Join Date
    Jan 2019
    Posts
    7
    Quote Originally Posted by fabuloso_mocoso View Post
    you can use the audioshield for audio AND the teensy's DAC(s) for envelopes, lfos, dc voltages, etc... at the same time.
    Thank you so much fabuloso_mocoso, it works fabulously and much better than a PWM digital output with a capacitor that slows the signal transients.

  13. #13
    No prob. Glad i could be of help

Posting Permissions

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