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

Thread: Unwanted Noise: Teensy PT8211 Sine Test

  1. #1

    Unwanted Noise: Teensy PT8211 Sine Test

    Hello dear Teensy Lovers. I decided to put my hands on the Teensy's Audio capabilities, because what I saw on the PJRC website is absolutely amazing!
    So I put some parts together and wanted to make the Teensy PT8211 Sine Test provided from the Examples Library.

    I didn't changed the code at all, but for clarity I will post it 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.99);
    }
    
    void loop() {
    }
    I do not have a PT8211 Teensy Breakoutboard, so I build it up on a simple breadboard and connected all things together:
    The Button on the breadboard can be ignored. It has no effect.
    Click image for larger version. 

Name:	0f35xIfwSveN4wL9MhUfsQ_thumb_cb4.jpg 
Views:	33 
Size:	133.0 KB 
ID:	21544 Click image for larger version. 

Name:	UNADJUSTEDNONRAW_thumb_cb7.jpg 
Views:	28 
Size:	200.2 KB 
ID:	21547

    So now my problem: The recorded Waveform in Ableton is by all mean not a sine wave

    Click image for larger version. 

Name:	Image 31.08.20 at 11.18.jpg 
Views:	18 
Size:	39.6 KB 
ID:	21546

    However touching the caps will produce this waveform:
    Click image for larger version. 

Name:	Image 31.08.20 at 11.20.jpg 
Views:	23 
Size:	28.6 KB 
ID:	21548

    So I've no idea what's causing the problem and would be very helpful for any advice how to fix this
    THX Gruftgrabbler

    PS: Forgot to mention that I use a Teensy 3.2

    PS2: I already read the Thread: https://forum.pjrc.com/threads/45345...ack-Distortion, but this was not very helpful for me, so I decided to make a new one
    Last edited by Gruftgrabbler; 08-31-2020 at 11:33 AM.

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,985
    I'd remove battery and just connect PT8211's pin 5 directly to the 3.3V pin on Teensy. You don't need the 10 ohm resistor for testing.

    Can you get closer photos? Maybe it's just the camera angle, but hard to tell which wires really connect where. Looks like one of the white wires connects to PT8211 pin 7 but should connect to pin 8.

  3. #3
    In fact the RC Circuit for the power supply of the PT8211 causes the error! Uff I'm so stupid. I should just tested this before before wasting my and your time writing this post, haha. However After removing the Cap and the 10 Ohm resistor I get a clean sine wave. Hurra

    Thx for this response.

    PS: And yes LOL I connected the right channel to NC, but luckily I didn't used it at all, so it doesn't mattered

  4. #4
    Senior Member
    Join Date
    Jul 2020
    Posts
    459
    The 10 ohm resistor is in the wrong place, so the chip's not got proper decoupling, so there's no guarantee its able to function
    at all. The 100nF decoupling capacitor should be ceramic and be right on the Vdd pin with the shortest possible path to ground
    on the other side of the caps.

    Also the recommended output (reconstruction) filter circuit from the PT8211 datasheet is missing - it may be the Focusrite isn't
    set to 44.1kSPS too, which will produce beats if there's no reconstruction filter.

    So move that 10 ohm to where it should be, add some sort of output low-pass filter (even RC is better than nothing), check you are
    sampling at 44100.

  5. #5
    MarkT Thank you. Quickly learned something. And yes without a RC Filter at the end I will have problems with aliasing. I will fix that when I start to prototype a serious circuit with that. I am planning "big" things to make with the teensy

  6. #6
    Senior Member
    Join Date
    Jul 2020
    Posts
    459
    BTW when posting a graph please indicate the timescale - that would show immedately if the spurious variations were
    a beat-frequency (such as 3.9kHz) due to sampling 44.1kSPS at 48kSPS or whatever.

  7. #7
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,985
    Quote Originally Posted by Gruftgrabbler View Post
    I am planning "big" things to make with the teensy
    Hope you'll be able to share photos or video & info when you get these big things built.

Posting Permissions

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