Joining GND and VGND for latency test

Status
Not open for further replies.

joaotragtenberg

Active member
Hello,
I want to run a test to measure in a logic analyser or oscilloscope the latency of the teensy+audio board. My test consists of a simple code with one button that when pressed inputs a 3.3V HIGH value to the digital port 0 of the teensy, which triggers in the SGTL5000 a simple dc value "1" to the sound output for 3 seconds. The code I used is at the bottom.
I then measure in a oscilloscope or logic analyser the time difference between the HIGH value inputted in Teensy and the dc value outputted by the audio board. Since the sound output gives a 1.7 V It is good enough for me, but the issue I'm having is that the GND value of the input is different than the VGND of the sound output. And it is written that I can't join both... If I measure them in the same oscilloscope or logic analyser the GNDs will inevitably join, so what can I do?
What is the issue of joining both GND and VGND?
I noticed that when I do so all the values fall to half of the tension, how can I work around this problem?

Thank you.

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

// GUItool: begin automatically generated code
AudioSynthWaveformDc dc1; //xy=226,198
AudioMixer4 mixer1; //xy=433,198
AudioOutputI2S i2s1; //xy=616,194
AudioConnection patchCord1(dc1, 0, mixer1, 0);
AudioConnection patchCord3(mixer1, 0, i2s1, 0);
AudioConnection patchCord4(mixer1, 0, i2s1, 1);
AudioControlSGTL5000 sgtl5000_1; //xy=77,24
// GUItool: end automatically generated code

int button0 = 0;
int button0Pin = 0;

void setup() {
pinMode(button0Pin, INPUT);
AudioMemory(10);
sgtl5000_1.enable();
sgtl5000_1.volume(1);
mixer1.gain(0, 10);
mixer1.gain(1, 1);
mixer1.gain(2, 1);
mixer1.gain(3, 1);
}

void loop() {
button0 = digitalRead(button0Pin);
if (button0 == 1) {
dc1.amplitude(1);
delay(3000);
dc1.amplitude(0,500);
}


}
 
And one onther issue:
how can I make those five pins of the Audio Board Of Line out (2 left, 2 right, 1 gnd) work? Is there an option to activate them?
I get sound from the 3.5mm but not from these pins...

thank you
 
If I measure them in the same oscilloscope or logic analyser the GNDs will inevitably join, so what can I do?
What is the issue of joining both GND and VGND?

Connect your oscilloscope to GND. Do not make any connection at all to VGND. The headphone outputs will be DC biased at approx 1.6 volts, which you'll see on your scope screen.
 
Nice, Thank you.
hope this works.
And what about the alternative line out pins?
how can I use them?

Are the line out pins also biased in 1.6V? Is there a way to have the sound output to go from 0V to 3.3V and back to 0V?

I already got a pretty good measurement about latency which read 4.6 ms (which is great!) but with a 2.8ms jitter... do you have any idea why there is such a huge jitter?
 
Are the line out pins also biased in 1.6V?

No, they're connected through series 2.2 uF capacitors. A schematic is on the audio shield page:

http://www.pjrc.com/store/teensy3_audio.html


Is there a way to have the sound output to go from 0V to 3.3V and back to 0V?

Like any capacitively coupled signal, apply the DC bias you want. Since your scope probe is basically a 10M resistor to ground (or only 1M if not using a 10X probe), you want an impedance that's much less than 10M, but not so low that the audio outputs and 2.2 uF capacitors can't drive it.

A 47K resistor to ground and a 47K resistor to 3.3V ought to work nicely. Or a 10K or 22K resistor connected to a lab bench power supply set at 1.6V could do.
 
Status
Not open for further replies.
Back
Top