PT8211 ~2kHZ Noise On Output - Teensy 4.1

grinch

Well-known member
Hi, I am working on a project using the PT8211, and running into an issue where I am seeing a pronounced ~2kHz noise on the output of the chip. This happens even when I write super stripped down audio code that completely zeros the output, and disable all other electronic functionality on my PCB.

Any idea what might be causing this and how I can fix this?

Here is the relevant section of my schematic (all functionality outside the PT8211 is disabled for testing) and the noise I am seeing on my scope (measured at both PT8211 output pins, before and after decoupling caps), as well as the code snippet I am using to test:

ScopeNoise.jpg

Screen Shot 2023-02-18 at 7.30.10 PM.jpg

Code:
#include <Audio.h>

AudioSynthWaveformSine test_sine;
AudioOutputPT8211 pt8211;
AudioConnection pc1 (test_sine, 0, pt8211, 0);
AudioConnection pc2 (test_sine, 0, pt8211, 1);

void setup() {
  AudioMemory(256);
  test_sine.amplitude(0);
  test_sine.frequency(200);
}

void loop() {

}
 
Looking at this further on my scope, I am seeing an equivalent signal at the DIN pin (seems a little odd this is anything other than zero, since I am writing a zero output in code, but figure this might be some configuration or address bits). Seems like noise from the digital side of the chip is freely coupling to the analog side.

This is measured at the DIN pin:

DIN_Signal.jpg
 
I find this is also happening on a PT8211 breakout purchased from PJRC, with the audio library example code edited to zero the output. Definitely something wrong here...

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

// GUItool: begin automatically generated code
AudioSynthWaveform       waveform1;      //xy=110,75
AudioOutputPT8211        pt8211_1;          //xy=303,78
AudioConnection          patchCord1(waveform1, 0, pt8211_1, 0);
AudioConnection          patchCord2(waveform1, 0, pt8211_1, 1);
// GUItool: end automatically generated code

void setup() {
  AudioMemory(15);
  waveform1.begin(WAVEFORM_SINE);
  waveform1.frequency(440);
  waveform1.amplitude(0); //the only edit to the library example is changing the amplitude
}

void loop() {
}
 
What are VDD and VCC? They appear to be wired together via PWR_FLAG, and to +3.3V via a 10R. Looks like all sorts of mayhem could result, but you haven’t shown the whole schematic so hard to tell…
 
What are VDD and VCC? They appear to be wired together via PWR_FLAG, and to +3.3V via a 10R. Looks like all sorts of mayhem could result, but you haven’t shown the whole schematic so hard to tell…

PWR_FLAG is not a net, it's a marker that lets KiCAD know that the net it's connected to is a power plane. It's a design rules thing.

Don't worry about VDD or VCC, those are used for an analog portion of the circuit that is disabled at present.

In fact, don't worry about my design at all. As I mentioned in my follow up comments, this behavior happens on the PT8211 audio shield I got direct from PJRC.

This noise issue seems to be a problem with the PT8211 and Teensy Audio Library generally.
 
This noise issue seems to be a problem with the PT8211 and Teensy Audio Library generally.
Fairly sure it’s not a “general problem”, the PT8211 has been used successfully for some time - I don’t have a huge amount of experience with it but it certainly worked for me when I tried it.

Can you try switching the hardware to use the I2S2 pins, and changing the test code to suit? I know those are in use for other things on your design, but it’d serve to test all hardware bar the I2S1 pins. I’m already assuming the test you reported in post #3 is just using a bare Teensy 4.1 and PT8211 breakout, so your hardware is completely eliminated from the equation. And of course the latest Teensyduino…
 
Never seen these pulses when using the PT8211. How does the pulse look like when you zoom in on the pulse?
Did you check whether the pulses are also present on the power pins of the PT8211?
Furthermore, there are fake PT8211 around, see here, please check your chips.

Paul
 
Just another observation, not sure it’ll shake anything loose but … those bursts appear to be occurring at about the audio update interval of 2.9ms, or 344.5Hz frequency. Not sure what the scope is picking up as 2kHz … well, 1.924 or 1.333kHz, depending on which image you look at.
 
Fairly sure it’s not a “general problem”, the PT8211 has been used successfully for some time - I don’t have a huge amount of experience with it but it certainly worked for me when I tried it.

Can you try switching the hardware to use the I2S2 pins, and changing the test code to suit? I know those are in use for other things on your design, but it’d serve to test all hardware bar the I2S1 pins. I’m already assuming the test you reported in post #3 is just using a bare Teensy 4.1 and PT8211 breakout, so your hardware is completely eliminated from the equation. And of course the latest Teensyduino…

Never seen these pulses when using the PT8211. How does the pulse look like when you zoom in on the pulse?
Did you check whether the pulses are also present on the power pins of the PT8211?
Furthermore, there are fake PT8211 around, see here, please check your chips.

Paul

To be clear, this issue happens with the code I posted just using a Teensy 4.1 (powered via USB) and a breakout board I got directly from PJRC: https://www.pjrc.com/store/pt8211_kit.html. It's not related to my hardware. You can recreate this using the Teensy 4.1, a breakout kit, and the code I posted. Seems possible it's an edge case in the audio library code with writing out zero values to the PT8211.

Pulses are not present on the power pins. Can zoom in later when I'm back in the shop.
 
Last edited:
To be clear, this issue happens with the code I posted just using a Teensy 4.1 (powered via USB) and a breakout board I got directly from PJRC: https://www.pjrc.com/store/pt8211_kit.html. It's not related to my hardware. You can recreate this using the Teensy 4.1, a breakout kit, and the code I posted. Seems possible it's an edge case in the audio library code with writing out zero values to the PT8211.
Hooked up a Teensy 4.1 and PT8211 board from PJRC:

IMG_20230219_203058.jpg

Uploaded your code from message #3 and this is what the oscilloscope shows:

SDS00079.png

No pulses on left (or right) channel present...

Running Windows 10, Arduino 1.8.19, Teensyduino 1.57.

Paul
 
We have been checking PT8211 behavior fairly closely over the last week. Connected using the PJRC standard board-on-board style... No real surprises on the noise front.

Off topic... Has anyone verified that right/left channel signal outputs match the board's silkscreen labeling?
 
You can recreate this using the Teensy 4.1, a breakout kit, and the code I posted.

I'm running the code from msg #3 on a Teensy 4.1 with PT8211 audio shield. My scope is connected to 1 of the audio outputs, and digital pins 7, 20, 21.

I see LRCLK and BCLK. Data (pin 7) is staying low, and the analog output is a steady DC voltage approx half way between 0 and 3.3V.

Here's a screenshot as "audio" scale

file1.png

Here's zoomed in to see the "digital" clocks scale

file2.png
 
Back
Top