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

Thread: Audio Adapter Board not work?

  1. #1

    Audio Adapter Board not work?

    Hi

    I mounted the Teensy 3.2 on the Audio Board and tried to run the Hardware Test but I didn't hear any beeping and I also didn't see any thing on the Serial Monitor. I also tried to run the WavFilePlayer example as well but I still didn't see anything on the Monitor (totally blank).

    Im pretty sure I mount the teensy properly. I don't know what happened

    I am using Teensyduino 1.30. Since on the workshop video here https://www.pjrc.com/store/audio_tutorial_kit.html, Paul and Alysia used Teenyduino 1.26. Is it a problem ?

    Click image for larger version. 

Name:	20161026_091244.jpg 
Views:	50 
Size:	70.3 KB 
ID:	8625
    Last edited by tranha; 10-26-2016 at 02:29 PM.

  2. #2
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    7,133
    What is your setup? Are you using the tutorial hardware, that has the buttons and the like? What do you have plugged into the headphone jack? I assume either a headphone or a speaker with amp... I assume you checked the obvious, like the speaker is working and volume not turned down to 0 and ...

    You might try a slight mod to the Hardware_Test, which is to add something like:
    Code:
        while (!Serial && (millis() < 5000)) ;
        Serial.begin(115200);
        delay(250):
        Serial.println("Start");
    To give time for the Serial terminal to start, and then print a simple message to see if that comes through. Then if you don't see any outputs later like: Beep #1
    You know that something is probably hanging.

    Yesterday when I was playing with DAC0 and DAC1, I made a real simple version, that was modified from the above program
    Which removed all of the buttons and the like, just to test hardware code. Something like:
    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>
    
    AudioSynthWaveform    waveform1;
    AudioOutputI2S        i2s1;
    AudioConnection       patchCord1(waveform1, 0, i2s1, 0);
    AudioConnection       patchCord2(waveform1, 0, i2s1, 1);
    AudioControlSGTL5000  sgtl5000_1;
    int count=1;
    int a1history=0, a2history=0, a3history=0;
    
    void setup() {
      AudioMemory(10);
      while (!Serial && (millis() < 5000)) ;
      Serial.begin(115200);
      delay(250);
      Serial.println("Begin");
      sgtl5000_1.enable();
      sgtl5000_1.volume(0.3);
      waveform1.begin(WAVEFORM_SINE);
      delay(1000);
    }
    
    
    
    
    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) {
        ;
      }
    }
    Warning, this updated version was done on the fly, so could be issues. But it removed all other stuff like buttons and the like and simply did a beep every 2 seconds or something like that.

  3. #3
    I tried to upload your code and I receive this error message.
    Error opening serial port 'COM9'. (Port busy)
    I think it's something hanging...

  4. #4
    Oh nevermind, it's ok now but the Monitor only displays "Begin". It didn't display "Beep #" or something...

  5. #5
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    7,133
    Simplest thing to try is to reboot your machine. Else look for something else open, like TYQT or some other window that is using COM9. Assuming Com9 is the comm port associated with your Teensy.

  6. #6
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    7,133
    I would then suggest adding print statements, like one after the .enable statement, then one after the .volume command and maybe one after the .begin line, except that is probably redundant as only a pause left before it should get to the print in loop.

    Also probably not going to gain you much more, but in cases like this I also add a flush...
    That is I write a line like: Serial.println("After Enable"); Serial.flush();

    Why, if the system is crashing or hard hanging, the flush will make sure the data is sent before that happens...

    Other things to check is double check the soldering. Are all the pins soldered in and are there any solder bridges...

    EDIT: Also I would always try with the most latest version of things.

    Like Arduino 1.6.12 with Teensyduino 1.31.beta2 As no use debugging stuff that may have already been fixed... Also make sure that you don't have another version of the Audio library sitting around...
    Last edited by KurtE; 10-26-2016 at 03:38 PM.

  7. #7
    Great! It seems to work, I can see the Monitor displays "Beep#" now. But I plugged my headphone in the jack and I still didn't hear any beep even though the display keeps going

  8. #8
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    7,133
    Try changing the volume line from .3 to something like .9 and see if that makes a difference...

  9. #9
    hmm....it's still the same... I feel like the headphone is not connected to the Jack at all

    At first, I thought it was my mistake when I de-soldered the jack and re-soldered it again. But I tried with the second brand new board and the problem still persists

  10. #10
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,283
    Do you have a voltmeter handy? One simple check is the DC voltage on the headphone "virtual ground". When the headphone amp is active and working, you should see about 1.5V between the headphone ground and the actual ground on Teensy.

  11. #11
    Senior Member
    Join Date
    Nov 2012
    Posts
    1,376
    @tranha. In your first post, is that a photo of the completed project? If so, it doesn't look like you have soldered any of the Teensy pins to the audio board.

    Pete

  12. #12
    it seems the DMM didn't read anything. I attached a picture showing the 2 pins I measured in order to make sure Im doing this correctly.

    Click image for larger version. 

Name:	20161026_115510.jpg 
Views:	64 
Size:	82.1 KB 
ID:	8627

  13. #13
    Quote Originally Posted by el_supremo View Post
    @tranha. In your first post, is that a photo of the completed project? If so, it doesn't look like you have soldered any of the Teensy pins to the audio board.

    Pete
    it's not a complete project but I want to test the Audio Board first. That's why I don't want to solder the Teensy yet, I just used the headers to mount the Teensy on the Audio Board temporarily

  14. #14
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,283
    You need to solder the pins. They don't make reliable electrical contact my merely sitting within the holes!

  15. #15
    Oh yes you are right! Everything is perfect now

    Thank you so much Paul and KurtE! I really do appreciate it

  16. #16
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    7,133
    Glad you have it working now. That is why I asked about the soldering in posting #6...

Posting Permissions

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