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

Thread: Teensy 4.0 and I2S DAC

  1. #1
    Junior Member
    Join Date
    Nov 2019
    Posts
    3

    Teensy 4.0 and I2S DAC

    I am working on a DAC design using the PCM1794 with I2S support but it does not seem to work correctly.

    The design for the chip is based on the typical application in the datasheet using TL074 chips as op-amps in the I/V stage.

    How are you supposed to connect I2S to this chip if it looks like this on an oscilloscope? Measured directly from teensy. The frequencies measured are correct, according to the audio shield page. To me this does not really look like standard I2S, and these voltages seem really high particularly mclk. Is it even possible to use the teensy with the PCM1794, or have I missed something really obvious?

    The source for the test program:

    Code:
    #include <Arduino.h>
    #include <Audio.h>
    #include <Wire.h>
    #include <SPI.h>
    #include <SD.h>
    #include <SerialFlash.h>
    
    // GUItool: begin automatically generated code
    AudioSynthWaveformSine   sine1;          //xy=268,404
    AudioOutputI2S           i2s1;           //xy=568,403
    AudioConnection          patchCord1(sine1, 0, i2s1, 0);
    // GUItool: end automatically generated code
    
    void setup() {
      AudioMemory(2000);
      sine1.frequency(2000);
      sine1.amplitude(1);
    }
    
    void loop() {
    
    }
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	bclk.png 
Views:	11 
Size:	29.8 KB 
ID:	18240   Click image for larger version. 

Name:	tx.png 
Views:	12 
Size:	45.3 KB 
ID:	18241  

    Click image for larger version. 

Name:	mclk.png 
Views:	12 
Size:	36.9 KB 
ID:	18242   Click image for larger version. 

Name:	lrclk.png 
Views:	9 
Size:	23.3 KB 
ID:	18243  


  2. #2
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,398
    All Teensies generate 0 to 3.3V digital data.
    If you are measuring 13.1 Vpp then your measurements are not correct.

  3. #3
    Junior Member
    Join Date
    Nov 2019
    Posts
    3
    This is measured from the ground pin on the teensy and each individual I2S output pin, and tested on different oscilloscopes. Is it impossible to measure then, or how do I do it then?

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,825
    That's some pretty incredible ringing on that waveforms, almost look like your scope's probes may be defective. Or maybe you're using ordinary wires rather than proper scope probes? Or maybe an extra (and long) wire for the ground between Teensy and the scope probe?

    Without a photo I can't see how you're measuring, but I can tell you 2 things with certainty. 1: Teensy doesn't produce those sorts of waveforms. 2: Using ordinary wires instead of a proper probe, or an extra long ground lead with a probe, is a well known cause of that sort of waveform.

  5. #5
    Junior Member
    Join Date
    Nov 2019
    Posts
    3
    Quick update, got it working by not changing anything really. I2S out works just fine connecting it to the DAC, no need for any resistors. Turns out to be incorrect measurements, although I haven't been able to measure the I2S signals correctly still.

Posting Permissions

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