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

Thread: PT8211 ~2kHZ Noise On Output - Teensy 4.1

  1. #1
    Senior Member
    Join Date
    Mar 2019
    Posts
    116

    PT8211 ~2kHZ Noise On Output - Teensy 4.1

    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:

    Click image for larger version. 

Name:	ScopeNoise.jpg 
Views:	15 
Size:	109.6 KB 
ID:	30441

    Click image for larger version. 

Name:	Screen Shot 2023-02-18 at 7.30.10 PM.jpg 
Views:	22 
Size:	141.1 KB 
ID:	30440

    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() {
    
    }

  2. #2
    Senior Member
    Join Date
    Mar 2019
    Posts
    116
    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:

    Click image for larger version. 

Name:	DIN_Signal.jpg 
Views:	16 
Size:	120.1 KB 
ID:	30442

  3. #3
    Senior Member
    Join Date
    Mar 2019
    Posts
    116
    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() {
    }

  4. #4
    Senior Member h4yn0nnym0u5e's Avatar
    Join Date
    Apr 2021
    Location
    Cambridgeshire, UK
    Posts
    738
    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…

  5. #5
    Senior Member
    Join Date
    Mar 2019
    Posts
    116
    Quote Originally Posted by h4yn0nnym0u5e View Post
    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.

  6. #6
    Senior Member h4yn0nnym0u5e's Avatar
    Join Date
    Apr 2021
    Location
    Cambridgeshire, UK
    Posts
    738
    Quote Originally Posted by grinch View Post
    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…

  7. #7
    Senior Member PaulS's Avatar
    Join Date
    Apr 2015
    Location
    Netherlands
    Posts
    1,096
    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

  8. #8
    Senior Member h4yn0nnym0u5e's Avatar
    Join Date
    Apr 2021
    Location
    Cambridgeshire, UK
    Posts
    738
    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.

  9. #9
    Senior Member
    Join Date
    Mar 2019
    Posts
    116
    Quote Originally Posted by h4yn0nnym0u5e View Post
    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…
    Quote Originally Posted by PaulS View Post
    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 by grinch; 02-19-2023 at 06:13 PM.

  10. #10
    Senior Member PaulS's Avatar
    Join Date
    Apr 2015
    Location
    Netherlands
    Posts
    1,096
    Quote Originally Posted by grinch View Post
    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:

    Click image for larger version. 

Name:	IMG_20230219_203058.jpg 
Views:	8 
Size:	78.9 KB 
ID:	30444

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

    Click image for larger version. 

Name:	SDS00079.png 
Views:	11 
Size:	15.7 KB 
ID:	30445

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

    Running Windows 10, Arduino 1.8.19, Teensyduino 1.57.

    Paul

  11. #11
    Senior Member
    Join Date
    Aug 2013
    Location
    Ohio
    Posts
    128
    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?

  12. #12
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    28,000
    Quote Originally Posted by grinch View Post
    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

    Click image for larger version. 

Name:	file1.png 
Views:	13 
Size:	40.0 KB 
ID:	30472

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

    Click image for larger version. 

Name:	file2.png 
Views:	10 
Size:	43.0 KB 
ID:	30473

Posting Permissions

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