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

Thread: Teensy 4 with TWO pcm5102 DAC ?

  1. #1
    Senior Member
    Join Date
    Dec 2018
    Posts
    171

    Teensy 4 with TWO pcm5102 DAC ?

    Hello,

    I have been using the PCM5102 for various projects. These DACs are cheap and deliver high quality audio.
    I am wondering if it is possible to use 2 of them to get 4 audio channel outputs ?

    Thank you
    Emmanuel

  2. #2
    Senior Member PaulS's Avatar
    Join Date
    Apr 2015
    Location
    Netherlands
    Posts
    697
    Hi Emmanuel,

    I guess it's possible, see the example at File > Examples > Audio > HardwareTesting > PassThroughQuad.
    Connect one PCM5102 board to pins 7, 20, 21 and the other board to pins 32, 20, 21.
    Code [not tested by me]:
    Code:
    #include <Audio.h>
    
    AudioSynthWaveformSine   sine1;
    AudioOutputI2SQuad       i2s_quad2;  
    AudioConnection          patchCord1(sine1, 0, i2s_quad2, 2);
    AudioConnection          patchCord2(sine1, 0, i2s_quad2, 3);
    AudioConnection          patchCord3(sine1, 0, i2s_quad2, 0);
    AudioConnection          patchCord4(sine1, 0, i2s_quad2, 1);
    
    void setup() {
      AudioMemory(12);
      sine1.frequency(1000);
      sine1.amplitude(0.5); // -6dB
    }
    
    void loop() {
    }
    Paul

  3. #3
    Senior Member
    Join Date
    Jul 2020
    Posts
    1,371
    Or I think you can use AudioOutputI2S and AudioOutputI2S2 together if on an Teensy 4.x

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    25,236
    Yes, either AudioOutputI2SQuad or AudioOutputI2S & AudioOutputI2S2 should work fine.

    You could connect up to 5 of those PCM5102 boards if you use AudioOutputI2SOct and AudioOutputI2S2. But one of the required pins is on the bottom side of Teensy 4.0, so the wiring is easier if using Teensy 4.1.

  5. #5
    Senior Member
    Join Date
    Dec 2018
    Posts
    171
    Thank you.
    It works !


    Emmanuel

Posting Permissions

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