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

Thread: Issue Teensy 3.2 + audio shield on USB power adapter

  1. #1
    Junior Member
    Join Date
    Jul 2021
    Posts
    14

    Issue Teensy 3.2 + audio shield on USB power adapter

    Hi,

    I have a question on using my Teensy 3.2 with audio shield on an external power USB adapter. Basically my code is working fine when connected to the computer but the moment I connect my Teensy to an external adapter nothing happens. I used different USB cables and different adapters (e.g. a large Iphone adapter 5V 2,1A or a 2,5A adapter used for my RPI). I also connected an external power supply to the Vin (5V) directly, but the same thing, nothing works.

    What do I do wrong?

    Background infor: I developed and tested succesfully my code (based on library code) where I can read and write my voice audio on a SDcard. Next to that I included a LED on port 18 (to test if my Teensy is working on a external adapter) and an external hardware serial1 to send some bytes to an ESP board. This ESP board is not yet connected, so I connected the RX and TX together. During development I, did had some issues with the pin selection for the 4 buttons, led and potential meter (for example, I used pin 7, that is used for i2s1 Tx and I used pin 10 that is occupied for the SDcard) but after switching pins the code is working.

    Any suggestions?

    Menne
    Attached Files Attached Files

  2. #2
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    4,088
    This might be a case where you would need to post pictures of your setup to help people identify what the issue might be.

  3. #3
    Junior Member
    Join Date
    Jul 2021
    Posts
    14
    Thanks Michael for your response. I created some pictures in the hope you can find a possible reason?
    Click image for larger version. 

Name:	IMG_4760.jpg 
Views:	18 
Size:	102.2 KB 
ID:	25424Click image for larger version. 

Name:	IMG_4761.jpg 
Views:	16 
Size:	107.2 KB 
ID:	25425Click image for larger version. 

Name:	IMG_4762.jpg 
Views:	22 
Size:	105.5 KB 
ID:	25426Click image for larger version. 

Name:	IMG_4763.jpg 
Views:	22 
Size:	97.8 KB 
ID:	25427Click image for larger version. 

Name:	IMG_4764.jpg 
Views:	12 
Size:	78.9 KB 
ID:	25428

  4. #4
    Junior Member
    Join Date
    Jul 2021
    Posts
    14
    Hi Michael, I took to Teensy out of the breadboard and measured the voltage on the Vin and Ground pin on the Teensyboard and Audio shield. In all cases I measured 5V, so no soldering issues.

  5. #5
    Junior Member
    Join Date
    Jul 2021
    Posts
    14
    Hi Michael, I used some new code from the Tutorial "Blink_When _Playing" and that code worked on computer USB and USB adapter. Any idea how software can create this issue?

  6. #6
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    4,088
    The reason nothing happens is this line in the code (in the setup function):

    Code:
      while (!Serial) {  ;  }
    The Teensy will hang forever waiting for the USB Serial to be connected. A better way to do this is limit the timeout to something like 3 seconds:

    Code:
      // Wait for up to 3 seconds for the USB serial to be connected
      while (!Serial () && (mills () < 3000))
        ;

  7. #7
    Junior Member
    Join Date
    Jul 2021
    Posts
    14
    Hi Michael, thanks for the time and finding my error in the code. Really appriciated.

  8. #8
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    4,088
    Quote Originally Posted by Menne View Post
    Hi Michael, thanks for the time and finding my error in the code. Really appriciated.
    You are welcome. It is a thing (waiting until the USB serial connects) all of us have done from time to time.

Posting Permissions

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