TDM Out sending data even if inputs not connected

Status
Not open for further replies.

newbie666

New member
Hello,

I've been trying to see how TDM in / outs work on Teensy 3.2 and I've stumbled upon something I don't quite understand.

tl;dr is that even if I don't connect anything to TDM output element's inputs I still see data being transmitted. Why?

Setup 1:
setup1.png

Code:
Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>

// GUItool: begin automatically generated code
AudioInputTDM            tdm1;           //xy=287,222
AudioSynthWaveformSine   sine1;          //xy=289,414
AudioOutputAnalog        dac1;           //xy=543,123
AudioOutputTDM           tdm2;           //xy=545,439
AudioConnection          patchCord1(tdm1, 0, dac1, 0);
AudioConnection          patchCord17(sine1, 0, tdm2, 0);
// GUItool: end automatically generated code

void setup() {
  sine1.amplitude(0.5);
  sine1.frequency(440);
  
  AudioMemory(80);
  delay(500);
}

void loop() {
}

So not only the first frame has data: this is what I see on TX line (green). Yellow channel is the frame sync.
setup1_scope.png


Setup 2:
When I attach "unused" inputs of TDM output to sine that has it's amplitude set to 0 I also see data being transmitted in those channels' frames. Here's the code:

Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>

// GUItool: begin automatically generated code
AudioInputTDM            tdm1;           //xy=287,222
AudioSynthWaveformSine   sine1;          //xy=289,414
AudioSynthWaveformSine   sine2;
AudioOutputAnalog        dac1;           //xy=543,123
AudioOutputTDM           tdm2;           //xy=545,439
AudioConnection          patchCord1(tdm1, 0, dac1, 0);
AudioConnection          patchCord2(sine2, 0, tdm2, 1);
AudioConnection          patchCord3(sine2, 0, tdm2, 2);
AudioConnection          patchCord4(sine2, 0, tdm2, 3);
AudioConnection          patchCord5(sine2, 0, tdm2, 4);
AudioConnection          patchCord6(sine2, 0, tdm2, 5);
AudioConnection          patchCord7(sine2, 0, tdm2, 6);
AudioConnection          patchCord8(sine2, 0, tdm2, 7);
AudioConnection          patchCord9(sine2, 0, tdm2, 8);
AudioConnection          patchCord10(sine2, 0, tdm2, 9);
AudioConnection          patchCord11(sine2, 0, tdm2, 10);
AudioConnection          patchCord12(sine2, 0, tdm2, 11);
AudioConnection          patchCord13(sine2, 0, tdm2, 12);
AudioConnection          patchCord14(sine2, 0, tdm2, 13);
AudioConnection          patchCord15(sine2, 0, tdm2, 14);
AudioConnection          patchCord16(sine2, 0, tdm2, 15);
AudioConnection          patchCord17(sine1, 0, tdm2, 0);
// GUItool: end automatically generated code

void setup() {
  sine1.amplitude(0.5);
  sine1.frequency(440);

  sine2.amplitude(0);
  sine2.frequency(440);
  
  AudioMemory(80);
  delay(500);
}

void loop() {
}

Won't paste the scope screen capture as it looks the same as in Setup 1.

Setup 3
Finally I've tried following setup:
setup3.png

Code:
Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>

// GUItool: begin automatically generated code
AudioInputTDM            tdm1;           //xy=287,222
AudioSynthWaveformSine   sine1;          //xy=289,414
AudioOutputAnalog        dac1;           //xy=543,123
AudioOutputTDM           tdm2;           //xy=545,439
AudioConnection          patchCord1(tdm1, 0, dac1, 0);
AudioConnection          patchCord2(tdm1, 1, tdm2, 1);
AudioConnection          patchCord3(tdm1, 2, tdm2, 2);
AudioConnection          patchCord4(tdm1, 3, tdm2, 3);
AudioConnection          patchCord5(tdm1, 4, tdm2, 4);
AudioConnection          patchCord6(tdm1, 5, tdm2, 5);
AudioConnection          patchCord7(tdm1, 6, tdm2, 6);
AudioConnection          patchCord8(tdm1, 7, tdm2, 7);
AudioConnection          patchCord9(tdm1, 8, tdm2, 8);
AudioConnection          patchCord10(tdm1, 9, tdm2, 9);
AudioConnection          patchCord11(tdm1, 10, tdm2, 10);
AudioConnection          patchCord12(tdm1, 11, tdm2, 11);
AudioConnection          patchCord13(tdm1, 12, tdm2, 12);
AudioConnection          patchCord14(tdm1, 13, tdm2, 13);
AudioConnection          patchCord15(tdm1, 14, tdm2, 14);
AudioConnection          patchCord16(tdm1, 15, tdm2, 15);
AudioConnection          patchCord17(sine1, 0, tdm2, 0);
// GUItool: end automatically generated code

void setup() {
  sine1.amplitude(0.5);
  sine1.frequency(440);
  
  AudioMemory(80);
  delay(500);
}

void loop() {
}

Now I see that TDM output produces "empty" frames that is data transmitted in all the frames but 0 (1?) is zeroes only. I'd expect that to happen in the previous two setups as well.
setup3_scope.png
 
Status
Not open for further replies.
Back
Top