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

Thread: Problems setting up Teensy D Audio board on Teensy 4.0

Hybrid View

  1. #1

    Problems setting up Teensy D Audio board on Teensy 4.0

    I have connected my Teensy 4.0 to an Audio shield Revision D
    and I get no headphone output using the recommended guitar test.

    The Audio shield is mounted on top of the Teensy 4 using female headers
    pointing down onto the pins soldered to the Teensy 4 . I have checked the
    continuity from below the pins on the Teensy to the top surface of the
    Audio shield and all conduct. (This way if more connections are required then using
    the female headers it allows me to separate the 2 boards and connect extra pins.)
    N.B. Only the 16 pins given in the diagram below have been implemented.
    Is that correct ?
    Without the Audio shield the Teensy works perfectly accepting many
    of my previous C programs and the examples e.g. Blink and uses the
    serial channel.
    With the shield the guitar sketch downloads but when I open the
    serial channel in Tools it fails not recognising the serial channel.

    I believe my soldering to be ok and I have resoldered any junctions that
    could be dry.

    Can any one help ?

    Click image for larger version. 

Name:	teensy4_audio_pins.jpg 
Views:	11 
Size:	69.4 KB 
ID:	17907
    Click image for larger version. 

Name:	0[2].jpg 
Views:	26 
Size:	125.8 KB 
ID:	17906Click image for larger version. 

Name:	0[3].jpg 
Views:	34 
Size:	62.4 KB 
ID:	17908Click image for larger version. 

Name:	0[1].jpg 
Views:	28 
Size:	137.4 KB 
ID:	17909

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    21,139
    This really looks like it should work. At least in these photos, I can't see anything wrong.

    I can at least answer this:

    Only the 16 pins given in the diagram below have been implemented.
    Is that correct ?
    Yes, that is correct.

    In fact, the Synthesis > Guitar example should play sound on the headphones using only pins 7, 18, 19, 20, 21, 23, GND, & 3.3V. The other pins aren't needed for that example to run. Pins 6, 8, 10, 11, 12, 13, 15 aren't used in any way by that example, which is why it's recommended as a first test.

    This is really getting into wild guesswork... but have you tried running the example without it plugged into the breadboard? I recall we've had at least 1 case before where a breadboard had some hidden internal problem (many of them are very cheaply made) and things magically worked when it wasn't plugged in.

  3. #3
    Paul, I've bought 2 audio boards, 3 Teensy 4.0 's and numerous headers from both Cool Components and PJRC Nothing works - even removed from the breadboard. Is there anyway that I could make a final purchase of a soldered and tested pair of Teensy + Audio shield from PJRC. My interest lies in programming not construction.
    Brian Fish

  4. #4
    Member houtson's Avatar
    Join Date
    Aug 2015
    Location
    Scotland
    Posts
    49
    Brian,

    I've had some unusual results with Teensy 4/Audioboard that I haven't got to the bottom of yet - some sketches run consistentley others do not. I've used the Audioboard with other Teensy 3.xs and this inconsistency is unusual.

    I know you are assuming a hardware fault but can I ask a question and ask you to try something with the software:
    - are you using the Arduino IDE and if so what version and is it PC or Mac.
    - can you try the example Audio/Tutorial/Part_01_02_Hardware_Test (you should get a beep and a message on the serial port if it works

    Cheers, Paul

  5. #5

    Reply from Brian 44

    Quote Originally Posted by houtson View Post
    Brian,

    I've had some unusual results with Teensy 4/Audioboard that I haven't got to the bottom of yet - some sketches run consistentley others do not. I've used the Audioboard with other Teensy 3.xs and this inconsistency is unusual.

    I know you are assuming a hardware fault but can I ask a question and ask you to try something with the software:
    - are you using the Arduino IDE and if so what version and is it PC or Mac.
    - can you try the example Audio/Tutorial/Part_01_02_Hardware_Test (you should get a beep and a message on the serial port if it works

    Cheers, Paul
    Houtson & Paul, I use a PC Win 10, 1.4.10 Version of Arduino overwritten with Teensyduino 1.48 for windows selecting ONLY the Audio library. The other libraries are unchecked.
    I tried the Part_01_02_ Hardware Test. No Beep.( My computer didn't recognise the USB serial line which is usual for running any sketch using the Audio shield)
    There was no DC voltage on the headphone pins but 3.3V was present on the audio chip.
    Hope this helps. I am returning Teensy+Audio board to Paul today for him to assess the hardware.
    Thanks, Brian Fish

  6. #6
    Member houtson's Avatar
    Join Date
    Aug 2015
    Location
    Scotland
    Posts
    49
    I'm still having some issues, I've tried it now with 2 T4 and Audioboard combo with same results which ends in no Audio and 0V between GND and headphones (Paul's test from above).

    A repeatable sequence for me that highlights the issue is:
    1. Load the beep test (Audio/Tutorial/Part_01_02_Hardware_Test and below) all is well - DC voltage at headphone, beeps and serial indicating running
    2. Unplug from USB and plug back in everything remains good, Teensy reboots and beeps away
    3. Load the second sketch which is a simple wave shape effect and again all is well - DC voltage at headphone, beeps and serial indicating running
    4. Unplug from USB and plug back in and I have the issue- no DC voltage, no tone, serial indicates it is running

    From that point the only way I get it running again is start at 1 (reload the beep test) which again runs fine

    Might be something wrong with the test sketch or my setup but if anyone can try or point out anything obvious that's be appreciated, strange that it works the first time until I pull the USB.

    For this I'm using Arduino 1.8.1, Teensy 1.48 on MacOS 10.13.

    Code and pictures below, thanks Paul



    Bleep test
    Code:
    // Advanced Microcontroller-based Audio Workshop
    //
    // http://www.pjrc.com/store/audio_tutorial_kit.html
    // https://hackaday.io/project/8292-microcontroller-audio-workshop-had-supercon-2015
    // 
    // Part 1-2: Test Hardware
    //
    // Simple beeping is pre-loaded on the Teensy, so
    // it will create sound and print info to the serial
    // monitor when plugged into a PC.
    //
    // This program is supposed to be pre-loaded before
    // the workshop, so Teensy+Audio will beep when
    // plugged in.
    
    #include <Audio.h>
    #include <Wire.h>
    #include <SD.h>
    #include <SPI.h>
    #include <SerialFlash.h>
    #include <Bounce.h>
    
    AudioSynthWaveform    waveform1;
    AudioOutputI2S        i2s1;
    AudioConnection       patchCord1(waveform1, 0, i2s1, 0);
    AudioConnection       patchCord2(waveform1, 0, i2s1, 1);
    AudioControlSGTL5000  sgtl5000_1;
    
    Bounce button0 = Bounce(0, 15);
    Bounce button1 = Bounce(1, 15);
    Bounce button2 = Bounce(2, 15);
    
    int count=1;
    int a1history=0, a2history=0, a3history=0;
    
    void setup() {
      AudioMemory(10);
      pinMode(0, INPUT_PULLUP);
      pinMode(1, INPUT_PULLUP);
      pinMode(2, INPUT_PULLUP);
      Serial.begin(115200);
      sgtl5000_1.enable();
      sgtl5000_1.volume(0.3);
      waveform1.begin(WAVEFORM_SINE);
      delay(1000);
      button0.update();
      button1.update();
      button2.update();
      a1history = analogRead(A1);
      a2history = analogRead(A2);
      a3history = analogRead(A3);
    }
    
    
    
    
    void loop() {
      Serial.print("Beep #");
      Serial.println(count);
      count = count + 1;
      waveform1.frequency(440);
      waveform1.amplitude(0.9);
      wait(250);
      waveform1.amplitude(0);
      wait(1750);
    }
    
    void wait(unsigned int milliseconds)
    {
      elapsedMillis msec=0;
    
      while (msec <= milliseconds) {
        button0.update();
        button1.update();
        button2.update();
        if (button0.fallingEdge()) Serial.println("Button (pin 0) Press");
        if (button1.fallingEdge()) Serial.println("Button (pin 1) Press");
        if (button2.fallingEdge()) Serial.println("Button (pin 2) Press");
        if (button0.risingEdge()) Serial.println("Button (pin 0) Release");
        if (button1.risingEdge()) Serial.println("Button (pin 1) Release");
        if (button2.risingEdge()) Serial.println("Button (pin 2) Release");
        int a1 = analogRead(A1);
        int a2 = analogRead(A2);
        int a3 = analogRead(A3);
        if (a1 > a1history + 50 || a1 < a1history - 50) {
          Serial.print("Knob (pin A1) = ");
          Serial.println(a1);
          a1history = a1;
        }
        if (a2 > a2history + 50 || a2 < a2history - 50) {
          Serial.print("Knob (pin A2) = ");
          Serial.println(a2);
          a2history = a2;
        }
        if (a3 > a3history + 50 || a3 < a3history - 50) {
          Serial.print("Knob (pin A3) = ");
          Serial.println(a3);
          a3history = a3;
        }
      }
    }

    Second Sketch that works to start then fails after USB removed
    Code:
    #include <Audio.h>
    
    
    AudioSynthWaveform       waveform;
    AudioEffectWaveshaper    waveshape1;
    AudioOutputI2S           i2s2;
    AudioConnection          patchCord1(waveform, 0, waveshape1, 0);
    AudioConnection          patchCord2(waveshape1, 0, i2s2, 0);
    AudioConnection          patchCord3(waveshape1, 0, i2s2, 1);
    AudioControlSGTL5000     sgtl5000_1;
    
    const float wave_shape_flat[2] = {
      -1.0,
      1.0
    };
    
    const float wave_shape_chebyshev_3rd [257] =
    { 
      -1.0,-0.9375,-0.8671875,-0.796875,-0.734375,-0.671875,-0.609375,-0.546875,-0.484375,-0.4296875,-0.375,-0.3203125,
      -0.265625,-0.2109375,-0.15625,-0.109375,-0.0546875,-0.0078125,0.0390625,0.078125,0.125,0.1640625,0.2109375,0.25,
      0.2890625,0.328125,0.359375,0.3984375,0.4296875,0.46875,0.5,0.53125,0.5546875,0.5859375,0.6171875,0.640625,0.6640625,
      0.6953125,0.71875,0.734375,0.7578125,0.78125,0.796875,0.8203125,0.8359375,0.8515625,0.8671875,0.8828125,0.890625,
      0.90625,0.921875,0.9296875,0.9375,0.953125,0.9609375,0.96875,0.96875,0.9765625,0.984375,0.984375,0.9921875,0.9921875,
      0.9921875,0.9921875,0.9921875,0.9921875,0.9921875,0.9921875,0.9921875,0.984375,0.984375,0.9765625,0.9765625,0.96875,
      0.9609375,0.953125,0.9453125,0.9375,0.9296875,0.921875,0.90625,0.8984375,0.890625,0.875,0.8671875,0.8515625,0.8359375,
      0.828125,0.8125,0.796875,0.78125,0.765625,0.75,0.734375,0.71875,0.703125,0.6796875,0.6640625,0.6484375,0.6328125,0.609375,
      0.59375,0.5703125,0.5546875,0.53125,0.515625,0.4921875,0.46875,0.453125,0.4296875,0.40625,0.3828125,0.359375,0.34375,0.3203125,
      0.296875,0.2734375,0.25,0.2265625,0.203125,0.1796875,0.15625,0.1328125,0.109375,0.0859375,0.0625,0.0390625,0.015625,0,
      -0.0234375,-0.046875,-0.0703125,-0.09375,-0.1171875,-0.140625,-0.1640625,-0.1875,-0.2109375,-0.234375,-0.2578125,-0.28125,
      -0.3046875,-0.328125,-0.3515625,-0.3671875,-0.390625,-0.4140625,-0.4375,-0.4609375,-0.4765625,-0.5,-0.5234375,-0.5390625,
      -0.5625,-0.578125,-0.6015625,-0.6171875,-0.640625,-0.65625,-0.671875,-0.6875,-0.7109375,-0.7265625,-0.7421875,-0.7578125,
      -0.7734375,-0.7890625,-0.8046875,-0.8203125,-0.8359375,-0.84375,-0.859375,-0.875,-0.8828125,-0.8984375,-0.90625,-0.9140625,
      -0.9296875,-0.9375,-0.9453125,-0.953125,-0.9609375,-0.96875,-0.9765625,-0.984375,-0.984375,-0.9921875,-0.9921875,-1,-1,-1,-1,
      -1,-1,-1,-1,-1,-0.9921875,-0.9921875,-0.984375,-0.9765625,-0.9765625,-0.96875,-0.9609375,-0.9453125,-0.9375,-0.9296875,-0.9140625,
      -0.8984375,-0.890625,-0.875,-0.859375,-0.84375,-0.828125,-0.8046875,-0.7890625,-0.765625,-0.7421875,-0.7265625,-0.703125,
      -0.671875,-0.6484375,-0.625,-0.59375,-0.5625,-0.5390625,-0.5078125,-0.4765625,-0.4375,-0.40625,-0.3671875,-0.3359375,-0.296875,
      -0.2578125,-0.21875,-0.171875,-0.1328125,-0.0859375,-0.046875,0,0.046875,0.1015625,0.1484375,0.203125,0.2578125,0.3125,0.3671875,
      0.421875,0.4765625,0.5390625,0.6015625,0.6640625,0.7265625,0.7890625,0.859375,0.9296875,0.9996875
    };
    
    const float wave_shape_chebyshev_6th [257] =
    {
      0.490693441,0.270855938,0.072669375,-0.104991361,-0.263216483,-0.403061926,-0.525549963,-0.631669818,-0.722378276,
      -0.79860028,-0.861229534,-0.911129093,-0.949131951,-0.976041622,-0.992632719,-0.999651527,-0.997816569,-0.987819169,
      -0.970324009,-0.945969683,-0.915369243,-0.879110741,-0.837757768,-0.791849987,-0.741903658,-0.688412162,-0.631846518,
      -0.572655896,-0.511268125,-0.448090193,-0.383508747,-0.317890586,-0.251583144,-0.184914977,-0.118196241,-0.05171916,
      0.014241505,0.079427988,0.143599071,0.206529621,0.268010148,0.327846365,0.385858743,0.441882084,0.495765094,0.547369957,
      0.59657192,0.643258879,0.687330973,0.728700181,0.767289925,0.803034675,0.835879566,0.86578001,0.892701325,0.916618355,
      0.93751511,0.955384399,0.970227472,0.982053671,0.990880081,0.996731184,0.999638529,0.999640393,0.996781454,0.991112473,
      0.982689972,0.971575925,0.957837447,0.941546494,0.922779566,0.90161741,0.87814474,0.852449947,0.824624828,0.794764306,
      0.762966172,0.729330814,0.693960964,0.656961444,0.61843892,0.578501658,0.537259286,0.494822565,0.451303155,0.406813401,
      0.361466108,0.315374332,0.268651175,0.221409575,0.173762116,0.125820832,0.077697021,0.029501059,-0.018657772,-0.066671461,
      -0.114433432,-0.161838711,-0.208784079,-0.255168227,-0.300891902,-0.345858051,-0.389971958,-0.433141375,-0.475276652,
      -0.516290858,-0.556099899,-0.594622629,-0.63178096,-0.667499963,-0.701707965,-0.734336644,-0.765321112,-0.794600003,
      -0.822115545,-0.847813638,-0.871643916,-0.893559814,-0.913518623,-0.931481545,-0.947413734,-0.961284349,-0.973066581,
      -0.982737693,-0.990279043,-0.99567611,-0.998918508,-1,-0.998918508,-0.99567611,-0.990279043,-0.982737693,-0.973066581,
      -0.961284349,-0.947413734,-0.931481545,-0.913518623,-0.893559814,-0.871643916,-0.847813638,-0.822115545,-0.794600003,
      -0.765321112,-0.734336644,-0.701707965,-0.667499963,-0.63178096,-0.594622629,-0.556099899,-0.516290858,-0.475276652,
      -0.433141375,-0.389971958,-0.345858051,-0.300891902,-0.255168227,-0.208784079,-0.161838711,-0.114433432,-0.066671461,
      -0.018657772,0.029501059,0.077697021,0.125820832,0.173762116,0.221409575,0.268651175,0.315374332,0.361466108,0.406813401,
      0.451303155,0.494822565,0.537259286,0.578501658,0.61843892,0.656961444,0.693960964,0.729330814,0.762966172,0.794764306,
      0.824624828,0.852449947,0.87814474,0.90161741,0.922779566,0.941546494,0.957837447,0.971575925,0.982689972,0.991112473,
      0.996781454,0.999640393,0.999638529,0.996731184,0.990880081,0.982053671,0.970227472,0.955384399,0.93751511,0.916618355,
      0.892701325,0.86578001,0.835879566,0.803034675,0.767289925,0.728700181,0.687330973,0.643258879,0.59657192,0.547369957,
      0.495765094,0.441882084,0.385858743,0.327846365,0.268010148,0.206529621,0.143599071,0.079427988,0.014241505,-0.05171916,
      -0.118196241,-0.184914977,-0.251583144,-0.317890586,-0.383508747,-0.448090193,-0.511268125,-0.572655896,-0.631846518,
      -0.688412162,-0.741903658,-0.791849987,-0.837757768,-0.879110741,-0.915369243,-0.945969683,-0.970324009,-0.987819169,
      -0.997816569,-0.999651527,-0.992632719,-0.976041622,-0.949131951,-0.911129093,-0.861229534,-0.79860028,-0.722378276,
      -0.631669818,-0.525549963,-0.403061926,-0.263216483,-0.104991361,0.072669375,0.270855938,0.490693441,0.733342528,1
    };
    
     int i = 0;
    void setup() {
      Serial.begin(9600);
      AudioMemory(40);
      waveform.begin(1.0, 200.0, WAVEFORM_SINE);
     
    }
    
    void loop() {
      Serial.print("Running:");
      Serial.println(i++);
      waveshape1.shape((float *)wave_shape_flat, 2);
      delay (500);
      waveshape1.shape((float *)wave_shape_chebyshev_3rd, 257);
      delay(500);
      waveshape1.shape((float *)wave_shape_chebyshev_6th, 257);
      delay(500);
    }

    Click image for larger version. 

Name:	IMG_1966.jpg 
Views:	15 
Size:	118.1 KB 
ID:	17953

    Click image for larger version. 

Name:	IMG_1965.jpg 
Views:	15 
Size:	115.3 KB 
ID:	17955

  7. #7
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,479
    Quote Originally Posted by Brian44 View Post
    Houtson & Paul, I use a PC Win 10, 1.4.10 Version of Arduino overwritten with Teensyduino 1.48 for windows selecting ONLY the Audio library. The other libraries are unchecked.
    Strange that this compiled correctly. The audio library needs other libraries (e.g. Wire to talk to the SGTL5000). Try to install with ALL TD libraries.

  8. #8
    Member houtson's Avatar
    Join Date
    Aug 2015
    Location
    Scotland
    Posts
    49
    Quote Originally Posted by WMXZ View Post
    Strange that this compiled correctly. The audio library needs other libraries (e.g. Wire to talk to the SGTL5000). Try to install with ALL TD libraries.
    Thanks for having a look at this, I tried again with the second sketch including all the libs, same result - after remove from USB, serial indicates running but no tone.

    for completeness the updated second sketch
    Code:
    #include <Audio.h>
    #include <Wire.h>
    #include <SD.h>
    #include <SPI.h>
    #include <SerialFlash.h>
    
    
    AudioSynthWaveform       waveform;
    AudioEffectWaveshaper    waveshape1;
    AudioOutputI2S           i2s2;
    AudioConnection          patchCord1(waveform, 0, waveshape1, 0);
    AudioConnection          patchCord2(waveshape1, 0, i2s2, 0);
    AudioConnection          patchCord3(waveshape1, 0, i2s2, 1);
    AudioControlSGTL5000     sgtl5000_1;
    
    const float wave_shape_flat[2] = {
      -1.0,
      1.0
    };
    
    const float wave_shape_chebyshev_3rd [257] =
    { 
      -1.0,-0.9375,-0.8671875,-0.796875,-0.734375,-0.671875,-0.609375,-0.546875,-0.484375,-0.4296875,-0.375,-0.3203125,
      -0.265625,-0.2109375,-0.15625,-0.109375,-0.0546875,-0.0078125,0.0390625,0.078125,0.125,0.1640625,0.2109375,0.25,
      0.2890625,0.328125,0.359375,0.3984375,0.4296875,0.46875,0.5,0.53125,0.5546875,0.5859375,0.6171875,0.640625,0.6640625,
      0.6953125,0.71875,0.734375,0.7578125,0.78125,0.796875,0.8203125,0.8359375,0.8515625,0.8671875,0.8828125,0.890625,
      0.90625,0.921875,0.9296875,0.9375,0.953125,0.9609375,0.96875,0.96875,0.9765625,0.984375,0.984375,0.9921875,0.9921875,
      0.9921875,0.9921875,0.9921875,0.9921875,0.9921875,0.9921875,0.9921875,0.984375,0.984375,0.9765625,0.9765625,0.96875,
      0.9609375,0.953125,0.9453125,0.9375,0.9296875,0.921875,0.90625,0.8984375,0.890625,0.875,0.8671875,0.8515625,0.8359375,
      0.828125,0.8125,0.796875,0.78125,0.765625,0.75,0.734375,0.71875,0.703125,0.6796875,0.6640625,0.6484375,0.6328125,0.609375,
      0.59375,0.5703125,0.5546875,0.53125,0.515625,0.4921875,0.46875,0.453125,0.4296875,0.40625,0.3828125,0.359375,0.34375,0.3203125,
      0.296875,0.2734375,0.25,0.2265625,0.203125,0.1796875,0.15625,0.1328125,0.109375,0.0859375,0.0625,0.0390625,0.015625,0,
      -0.0234375,-0.046875,-0.0703125,-0.09375,-0.1171875,-0.140625,-0.1640625,-0.1875,-0.2109375,-0.234375,-0.2578125,-0.28125,
      -0.3046875,-0.328125,-0.3515625,-0.3671875,-0.390625,-0.4140625,-0.4375,-0.4609375,-0.4765625,-0.5,-0.5234375,-0.5390625,
      -0.5625,-0.578125,-0.6015625,-0.6171875,-0.640625,-0.65625,-0.671875,-0.6875,-0.7109375,-0.7265625,-0.7421875,-0.7578125,
      -0.7734375,-0.7890625,-0.8046875,-0.8203125,-0.8359375,-0.84375,-0.859375,-0.875,-0.8828125,-0.8984375,-0.90625,-0.9140625,
      -0.9296875,-0.9375,-0.9453125,-0.953125,-0.9609375,-0.96875,-0.9765625,-0.984375,-0.984375,-0.9921875,-0.9921875,-1,-1,-1,-1,
      -1,-1,-1,-1,-1,-0.9921875,-0.9921875,-0.984375,-0.9765625,-0.9765625,-0.96875,-0.9609375,-0.9453125,-0.9375,-0.9296875,-0.9140625,
      -0.8984375,-0.890625,-0.875,-0.859375,-0.84375,-0.828125,-0.8046875,-0.7890625,-0.765625,-0.7421875,-0.7265625,-0.703125,
      -0.671875,-0.6484375,-0.625,-0.59375,-0.5625,-0.5390625,-0.5078125,-0.4765625,-0.4375,-0.40625,-0.3671875,-0.3359375,-0.296875,
      -0.2578125,-0.21875,-0.171875,-0.1328125,-0.0859375,-0.046875,0,0.046875,0.1015625,0.1484375,0.203125,0.2578125,0.3125,0.3671875,
      0.421875,0.4765625,0.5390625,0.6015625,0.6640625,0.7265625,0.7890625,0.859375,0.9296875,0.9996875
    };
    
    const float wave_shape_chebyshev_6th [257] =
    {
      0.490693441,0.270855938,0.072669375,-0.104991361,-0.263216483,-0.403061926,-0.525549963,-0.631669818,-0.722378276,
      -0.79860028,-0.861229534,-0.911129093,-0.949131951,-0.976041622,-0.992632719,-0.999651527,-0.997816569,-0.987819169,
      -0.970324009,-0.945969683,-0.915369243,-0.879110741,-0.837757768,-0.791849987,-0.741903658,-0.688412162,-0.631846518,
      -0.572655896,-0.511268125,-0.448090193,-0.383508747,-0.317890586,-0.251583144,-0.184914977,-0.118196241,-0.05171916,
      0.014241505,0.079427988,0.143599071,0.206529621,0.268010148,0.327846365,0.385858743,0.441882084,0.495765094,0.547369957,
      0.59657192,0.643258879,0.687330973,0.728700181,0.767289925,0.803034675,0.835879566,0.86578001,0.892701325,0.916618355,
      0.93751511,0.955384399,0.970227472,0.982053671,0.990880081,0.996731184,0.999638529,0.999640393,0.996781454,0.991112473,
      0.982689972,0.971575925,0.957837447,0.941546494,0.922779566,0.90161741,0.87814474,0.852449947,0.824624828,0.794764306,
      0.762966172,0.729330814,0.693960964,0.656961444,0.61843892,0.578501658,0.537259286,0.494822565,0.451303155,0.406813401,
      0.361466108,0.315374332,0.268651175,0.221409575,0.173762116,0.125820832,0.077697021,0.029501059,-0.018657772,-0.066671461,
      -0.114433432,-0.161838711,-0.208784079,-0.255168227,-0.300891902,-0.345858051,-0.389971958,-0.433141375,-0.475276652,
      -0.516290858,-0.556099899,-0.594622629,-0.63178096,-0.667499963,-0.701707965,-0.734336644,-0.765321112,-0.794600003,
      -0.822115545,-0.847813638,-0.871643916,-0.893559814,-0.913518623,-0.931481545,-0.947413734,-0.961284349,-0.973066581,
      -0.982737693,-0.990279043,-0.99567611,-0.998918508,-1,-0.998918508,-0.99567611,-0.990279043,-0.982737693,-0.973066581,
      -0.961284349,-0.947413734,-0.931481545,-0.913518623,-0.893559814,-0.871643916,-0.847813638,-0.822115545,-0.794600003,
      -0.765321112,-0.734336644,-0.701707965,-0.667499963,-0.63178096,-0.594622629,-0.556099899,-0.516290858,-0.475276652,
      -0.433141375,-0.389971958,-0.345858051,-0.300891902,-0.255168227,-0.208784079,-0.161838711,-0.114433432,-0.066671461,
      -0.018657772,0.029501059,0.077697021,0.125820832,0.173762116,0.221409575,0.268651175,0.315374332,0.361466108,0.406813401,
      0.451303155,0.494822565,0.537259286,0.578501658,0.61843892,0.656961444,0.693960964,0.729330814,0.762966172,0.794764306,
      0.824624828,0.852449947,0.87814474,0.90161741,0.922779566,0.941546494,0.957837447,0.971575925,0.982689972,0.991112473,
      0.996781454,0.999640393,0.999638529,0.996731184,0.990880081,0.982053671,0.970227472,0.955384399,0.93751511,0.916618355,
      0.892701325,0.86578001,0.835879566,0.803034675,0.767289925,0.728700181,0.687330973,0.643258879,0.59657192,0.547369957,
      0.495765094,0.441882084,0.385858743,0.327846365,0.268010148,0.206529621,0.143599071,0.079427988,0.014241505,-0.05171916,
      -0.118196241,-0.184914977,-0.251583144,-0.317890586,-0.383508747,-0.448090193,-0.511268125,-0.572655896,-0.631846518,
      -0.688412162,-0.741903658,-0.791849987,-0.837757768,-0.879110741,-0.915369243,-0.945969683,-0.970324009,-0.987819169,
      -0.997816569,-0.999651527,-0.992632719,-0.976041622,-0.949131951,-0.911129093,-0.861229534,-0.79860028,-0.722378276,
      -0.631669818,-0.525549963,-0.403061926,-0.263216483,-0.104991361,0.072669375,0.270855938,0.490693441,0.733342528,1
    };
    
     int i = 0;
    void setup() {
      Serial.begin(9600);
      AudioMemory(40);
      waveform.begin(1.0, 200.0, WAVEFORM_SINE);
     
    }
    
    void loop() {
      Serial.print("Running:");
      Serial.println(i++);
      waveshape1.shape((float *)wave_shape_flat, 2);
      delay (500);
      waveshape1.shape((float *)wave_shape_chebyshev_3rd, 257);
      delay(500);
      waveshape1.shape((float *)wave_shape_chebyshev_6th, 257);
      delay(500);
    }

  9. #9
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    10,422
    Quote Originally Posted by houtson View Post
    Thanks for having a look at this, I tried again with the second sketch including all the libs, same result - after remove from USB, serial indicates running but no tone.

    for completeness the updated second sketch
    … p#10 code ...
    Running that sketch with my single bottom female header Rev D board it worked on the first Teensy_4 I tried - having run the to be noted sketch first ...

    Putting it on the second top pinned T4 did not make any sound until I ran this sketch :: "T:\arduino_1.8.10\hardware\teensy\avr\libraries\A udio\examples\Tutorial\Part_1_02_Hardware_Test\Par t_1_02_Hardware_Test.ino"

    That sketch worked to make TONE

    Then while still powered I uploaded p#10 sketch and it worked as well.

    I turned OFF the power to the T4 and it powered up 'Running:#' on Sermon - but no sound.

    There is something wrong with that code doing initialization of the Audio board it seems … like :: sgtl5000_1.enable();

    Adding these two BOLD lines in setup() gets sound:
    Code:
    void setup() {
      Serial.begin(9600);
      sgtl5000_1.enable();
      sgtl5000_1.volume(0.3);
      AudioMemory(40);
      waveform.begin(1.0, 200.0, WAVEFORM_SINE);
    }

  10. #10
    Paul at Houston and Paul at JPRC, Houston, Thanks for the loan of the board pair. They worked first time with both guitar and stereo passthro'.
    So the software worked ok and the fault was due finger trouble in my setup - not installing all libraries with teensyduino and possibly incorrect expansion of the Zip download file . I have already bought a replacement pair from Pimorini and will solder them when the female headers with the long pins arrive from the same company. Will return the pair v soon. What a relief ! The sound quality is impressive and I'm looking forward to slaving the boards from my guitar effects and FFT sketches. Will post the finished programs.

  11. #11
    Wmxz. Thanks for the advice to install ALL libraries. I will indeed do that. It did however compile. At this time, after trying all suggestions with no +be outcome, I have returned T4+Audio to pjrc for testing. The return time could be one month because I live in the uk.
    I am impressed with your soldering.

  12. #12
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,479
    Quote Originally Posted by Brian44 View Post
    It did however compile.
    It may have compiled to Arduino and not Teensy libraries, that are in a different folder and take precedence in compiling and linking.
    In the post I referred to, you were saying you installed ONLY Audio library when yo run Teensyduino. The includes in the sketch are not necessary and you may only include audio.h

  13. #13
    If my memory serves me correctly then Audio.h alone contains all the :
    #include <*.h> statements to bring in the relevant headers ?

  14. #14
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    10,422
    Quote Originally Posted by Brian44 View Post
    If my memory serves me correctly then Audio.h alone contains all the :
    #include <*.h> statements to bring in the relevant headers ?
    Look at the Audio examples - they seem to include a few libs. Any not included get brought in elsewhere.

    To experiment open and build an audio example - then comment them out in turn and see what happens?

    It was by code comparing to published example I found the issue in p#12.

  15. #15
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    21,139
    One more quick sanity check is the DC voltage on the 3 headphone pins, relative to GND on Teensy. If the SGTL5000 chip is running properly, you should see about 1.5V on each pin.

    Here's one running on my desk right now. My multimeter measures 1.54 volts between any of the pins and the shell of the USB connector (GND).

    Click image for larger version. 

Name:	DSC_0636_web.jpg 
Views:	8 
Size:	130.6 KB 
ID:	17947

  16. #16
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    10,422
    I have a T4 Audio board Rev D and the testing I've done has worked well - including hardware test with Beep on Two T4's.

    Post specifics for repro of other sketches examples and can give them a try.
    Click image for larger version. 

Name:	20191017_005614r.jpg 
Views:	5 
Size:	52.3 KB 
ID:	17948Click image for larger version. 

Name:	20191017_005637r.jpg 
Views:	6 
Size:	77.3 KB 
ID:	17949
    Just assembled this T4 into a castellated T_3.6 format board and female header Rev D audio seems to work.


    Quote Originally Posted by PaulStoffregen View Post
    One more quick sanity check is the DC voltage on the 3 headphone pins, relative to GND on Teensy. If the SGTL5000 chip is running properly, you should see about 1.5V on each pin.

    Here's one running on my desk right now. My multimeter measures 1.54 volts between any of the pins and the shell of the USB connector (GND).
    ...
    I get 1.58 volts on the three … it is running the hardware test sketch

  17. #17
    Member houtson's Avatar
    Join Date
    Aug 2015
    Location
    Scotland
    Posts
    49
    There is something wrong with that code doing initialization of the Audio board it seems like :: sgtl5000_1.enable();

    Adding these two BOLD lines in setup() gets sound:
    Code:
    void setup() {
    Serial.begin(9600);
    sgtl5000_1.enable();
    sgtl5000_1.volume(0.3);

    AudioMemory(40);
    waveform.begin(1.0, 200.0, WAVEFORM_SINE);
    }
    Thanks for looking at that @Defrafster that fixes it for me and makes sense (sgtl must have been enabled from first sketch then when power removed needs re-enabled). All good for me with T4+Audioboard.

  18. #18
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    21,139
    Quote Originally Posted by Brian44 View Post
    what I really need is to expunge all Arduino code and libs from my machine (not the sketches)
    On Windows, the Arduino stuff is located in 3 places.

    The software and everything Teensyduino installs is in the Arduino program folder. By default that's C:\Program Files (x86)\Arduino.

    Preferences and everything Arduino's boards & libs manager install are in %LocalAppData%/Arduino. Normally that's a hidden folder. There are lots of sites with instructions for accessing it.

    Your programs are stored in the "sketchbook" folder. It's default location is %Documents%/Arduino.


    Arduino also has a "portable" mode which makes a completely self-contained copy of Arduino. The Teensyduino installer automatically detects if you've selected a copy of Arduino configured this way and treats it accordingly.

    https://www.arduino.cc/en/Guide/PortableIDE

    Often this is the simplest way to try experimental stuff with Arduino that doesn't (or at least shouldn't) interact with any installed copy of Arduino.

  19. #19
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    10,422
    @Brian44 - that is odd output

    The portableIDE option got mention in this post : Teensyduino-1-48-Beta-2

    The following post I gave it a try and left some notes as it worked.

    Do make sure you save a copy of your sketches if they are in an Arduino controlled folder - just in case. And perhaps try to remove other installations.

  20. #20
    Member houtson's Avatar
    Join Date
    Aug 2015
    Location
    Scotland
    Posts
    49
    Good to hear you're up and running, have fun

Posting Permissions

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