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

Thread: Teensy 4.0 Can't program when using external power supply

  1. #1
    Junior Member
    Join Date
    Jan 2020
    Posts
    9

    Teensy 4.0 - Unable to program when VIN cut

    I'm moving a T3.6 project to T4 and am running into a strange issue. It's affected two T4 boards so far.
    Both boards respond normally and program successfully when plugged into a computer before the VIN trace is cut. However, once the trace is cut, I can no longer program the boards. They both power up fine and enter into program mode when the on-board button is pressed but they will not appear as a device on any of my computers.

    The bizarre issue is, if I solder the VIN pads closed, the boards appears on my computer as expected (but without the ability to power the board externally while connected to a computer).

    I'm using an MCP1826S 1A 3V3 LDO connected to the VUSB pin on the Teensy, so power and data require only one cable.
    The on-board regulator is too small for my project.

    Does anyone have any suggestions?
    Last edited by noodle; 01-02-2020 at 06:25 AM.

  2. #2
    Senior Member
    Join Date
    Feb 2016
    Location
    Australia
    Posts
    251
    I thought the point of cutting that track was to remove power to vusb.
    If your supplying 3.3v to vusb does that mean your computers usb 5v is pulled down to 3.3v?

    I donít know how this works though.

  3. #3
    Junior Member
    Join Date
    Jan 2020
    Posts
    9


    Wrong board but same concept. VUSB is the inner pin below GND at the top right of the image. Cutting the trace, as I understand, removes the connection between VUSB and VIN.
    I have VUSB connected to an external LDO and the trace between VUSB and VIN severed, so the on-board LDO should be inactive.

    At least, that's how it seemed to work on the T3.6 I used before these T4s.

  4. #4
    Senior Member
    Join Date
    Feb 2016
    Location
    Australia
    Posts
    251
    Connect your external 3.3v to the pin labeled as 3.3v. Vusb is connected to usb socket and doing what your doing will be pulling your USB low. I would expect a message to pop up in win10 saying something about it... anyway that’s my thoughts.
    Click image for larger version. 

Name:	359FE266-29BF-48A9-8846-F117604E7BD8.png 
Views:	22 
Size:	50.8 KB 
ID:	18603

  5. #5
    Senior Member
    Join Date
    Feb 2016
    Location
    Australia
    Posts
    251
    Actually looking at schematic your device would not be working if connected to vusb with the trace cut.Are you perhaps putting 3.3v into the vin side then you would be going though onboard 3.3v regulator and dropping a bit lower. Perhabs it’s too low for USB data.

  6. #6
    Junior Member
    Join Date
    Jan 2020
    Posts
    9


    Here's what it looks like. VIN has nothing connected to it.
    The board powers on perfectly and runs both my sketch and the blink sketch as it should. I checked the incoming USB voltage and it's a solid 5V. The LDO produces a stable 3.3V as well.

  7. #7
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    10,571
    @noodle:: Are the GND lines of the Two power sources common to the Teensy? Not sure why this wouldn't work as it has here if the power is good.

    The problem is it seems you are only supplying 3.3V to a Teensy 4.0? When I repeat the testing below that works with 5V on VIN - the Teensy will run with 3.3V from second Teensy ( as I am seeing the SSD1306 running ) - but as you are seeing it will not connect to USB for program or even SerMon data out when only 3.3 volts are applied to VIN with the VUSB<>VIN trace cut. **: I see now above that the 3.3V was applied to the 3.3V pin and I can't fully test that - but it appeared to work the same - though at some point the Teensy supplying the 3.3V shut down.

    Both the T_3.6 and the T_4.0 cards specify VIN minimum of 3.6V - and while the T_3.6 may work with 3.3V on VIN - it appears the T_4.0 will not as it is under spec and outside the operating range when USB is feeding 5V to the device but the T_4 only has 3.3V to run
    This may be something Paul can confirm that in this case when the T_4.0 VIN is getting 3.6V, that this works normally as exSPECted when the VIN<>VUSB trace is cut.
    > Perhaps Paul can also repeat this with 3.3V applied to a 3.3V pin as above and offer details.

    During T4 Beta I cut one of the traces on a PJRC supplied T4 unit and tested powering it with 5 volts from another source - another Teensy. I found that to work well and normal, using 5 volts.

    Just now with a TallDog Board with the VUSB<>VIN trace cut { and the switch to external power set it does not run when USB is connected - as expected }.
    > Then I pulled GND and 5V from a second T_4 for external VIN to that T_4 under test and it runs and programs normally.
    > For Test alternated between two sketches using TeensyDuino 1.49b4 using { one sketch runs i2c SSD1306 display and the other does a ram test on the unused ITCM upper area }:
    -- IDE 1.8.9 and TeensyLoader with the IDE to upload and IDE SerMon
    -- IDE 1.8.10 using TyCommander from SublimeTest where TyComm does upload and sermon

  8. #8
    Junior Member
    Join Date
    Jan 2020
    Posts
    9
    Quote Originally Posted by defragster View Post
    @noodle:: Are the GND lines of the Two power sources common to the Teensy? Not sure why this wouldn't work as it has here if the power is good.
    I would expect so. Unless USB GND becomes disconnected when the VUSB<>VIN trace is cut...? I don't understand how this would be so but I can't pretend there isn't plenty I don't understand.

    The problem is it seems you are only supplying 3.3V to a Teensy 4.0?
    Yes, I am supplying 3V3 via an external MCP1826S LDO. The only non-working part is the data/serial connection to my computer.

    ...you are seeing it will not connect to USB for program or even SerMon data out when only 3.3 volts are applied to VIN with the VUSB<>VIN trace cut. **: I see now above that the 3.3V was applied to the 3.3V pin...
    That is exactly what I am experiencing.

    Thanks for testing, defragster.

    Hopefully Paul can shed some more light.

  9. #9
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    21,288
    Did you connect a capacitor to the MCP1826? I don't see one in the picture on msg #6.

    From the MCP1826 datasheet:

    Click image for larger version. 

Name:	sc.png 
Views:	1 
Size:	36.0 KB 
ID:	18605

    Like all these LDO regulators, the output capacitor must be located physically close to the regulator with short wires. These types of regulators have unstable performance without the required capacitor, or if too much wire is used between the regulator and capacitor. It must be the specific type of capacitor they say, so don't substitute a different type like aluminum electrolytic or tantalum. You need a ceramic capacitor.

    Ceramic capacitors come in different material types with a 3 letter code. Use one that begins with "X" for this case. The "Y" and "Z" types like Y5V and Z5U are low quality parts. Avoid those.

  10. #10
    Senior Member
    Join Date
    Feb 2016
    Location
    Australia
    Posts
    251
    What does the vin voltage measure with this setup.
    I’m just curious (may not matter) what vusb1/2 bus is supplied with when like this.
    Thanks.

    Edit:
    Is usb1/2_vbus used for data line voltages or some other host mode peripheral I don’t understand?

    If it’s for data lines reference manual doesn’t mention using 3.3v internally for this. Looks like u need 4.5-5vdc on one of the 2 bus lines?
    Last edited by Gibbedy; 01-02-2020 at 11:41 AM.

  11. #11
    Junior Member
    Join Date
    Jan 2020
    Posts
    9
    Quote Originally Posted by PaulStoffregen View Post
    Did you connect a capacitor to the MCP1826?
    I had a 0.1 uF ceramic capacitor but I see I've misread the datasheet so I've ordered X7R 1uF ceramic caps that will be here in a few days.
    Until then it might be best to put this thread on hold.

  12. #12
    Junior Member
    Join Date
    Jan 2020
    Posts
    9
    I had time to solder the 1uF capacitor on today. The board powers up but still no USB.
    What's the next step in diagnosing this?

  13. #13
    You're not powering the teensy properly. If you look at the schematic, main chip, top left, N6 and M6 are Vusb inputs, expecting I assume 5V.
    Cutting the Vin-Vusb trace allows you to power the teensy with an external supply, but this should be 3.6-5.5V and applied to the Vin pin. By powering just the 3.3V pin, you're not properly feeding power to the chip, and the abscence of power to the Vusb pins would certainly explain why the USB no longer works.

    I'd also note that you're "schematic" shows that you've connected the input of the regulator the Vusb pin. As I understand this, your board is going to have some other supply supplying an input voltage to this regulator, so you're still connecting this voltge to the usb voltage and hence not getting anything out of cutting the trace. I'm going to assume the following
    - you want to power the teensy only from the board
    - you've got 3.6-5-5V available on the board
    - You need more than 250mA @ 3.3

    Cut the trace on the T4. Connect 3.6-5.5V to Vin. Power your 3.3V regulator however you see fit. Do not connect the regulator's 3.3V to the T4 3.3V pins.

    If you need to reprogram the T4 without powering the board, take it out and connect the Vusb and Vin pins using a jumper. If you want to be able to do this in situ, you could add a pair of pins that you can manually jump, or you can use a pair of doides to make it hot-swappable.

  14. #14
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    21,288
    Quote Originally Posted by noodle View Post
    What's the next step in diagnosing this?
    Show us photos. That's the next step!

    We can usually help better when we can see what you've actually done.

  15. #15
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    3,204
    This may be slightly off topic but i am using skpang's board and able to use both external and usb at same time, i havnt checked the datasheet or if the trace was cut as i ordered them together to be assured i wont have issues. Perhaps you can check the diagrams to see how he handles the dual power source

    http://www.skpang.co.uk/catalog/imag..._can_rev_A.pdf

  16. #16
    Junior Member
    Join Date
    Jan 2020
    Posts
    9
    Paul - Here are some photos https://imgur.com/a/uRIu2H9
    There will also be a BNO080 (I'm eagerly awaiting your findings/fixes in the other thread), ESP8266 and Quectel L76 GPS added after I have this resolved. The 20 pin header is for a TFT display. The code is written but I struck this issue and stopped soldering more things on.

    tonton81 - Thanks for that. It looks like it has a 5V reg. that is connected to VIN.

    Edward - If I'm understanding you correctly, you're telling me the Teensy 4.0 must be powered via its onboard regulator, it cannot be powered via external 3V3 while concurrently maintaining the ability to program?
    The issue I have with what you propose is I would like to be able to use the board and program without jumpers or other workarounds. If it can be avoided, I absolutely want to.
    This setup has worked for the last year with a Teensy 3.6. It's only now I've moved to a T4 I'm having this issue.

  17. #17
    Senior Member
    Join Date
    Feb 2016
    Location
    Australia
    Posts
    251
    Is leaving trace uncut and removing the regulator on the teensy an option?
    Your going to need 5v when using USB.

    Edit:
    Here is my full take in it.. vusb needs 4.5-5v according to a manual I read on the teensy website somewhere. The chip has internal regulator for USB purposes. So you could put 5v on vin and remove the onboard regulator and still use your external regulator for 3.3v stuff.

    I think it would be better to cut trace and power teensy from 5v on vin. Keep onboard regulator for your io and wire the external 3.3v stuff directly off your external regulator. I assume this is a wiring hassle preventing you going this way.

    Or as mentioned at the start of this post leave trace connected and remove the onboard regulator. Then you can put straight on your board and will work like the 3.6 did.

    Get a second opinion on this though. I’ve not done it this way. By the end off all this I should know how to though.
    Last edited by Gibbedy; 01-11-2020 at 06:19 AM.

  18. #18
    Junior Member
    Join Date
    Jan 2020
    Posts
    9
    Quote Originally Posted by Gibbedy View Post
    Is leaving trace uncut and removing the regulator on the teensy an option?
    I'd prefer not removing parts but that's just my preference right now. It's certainly an idea I'll tuck away for future use.

    I think it would be better to cut trace and power teensy from 5v on vin. Keep onboard regulator for your io and wire the external 3.3v stuff directly off your external regulator.
    I think this is the best solution at the moment. I had wanted to replicate my previous T3.6 setup but it must be incompatible with T4.

    Thanks for your help everyone.
    Last edited by noodle; 01-12-2020 at 03:43 AM.

  19. #19
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    21,288
    As a quick sanity check, I cut the VUSB-VIN pads on a Teensy 4.0 and connected it's 3.3V power line to my lab bench power supply. When I press the pushbutton, Teensy Loader does indeed load the code and reboot it. Communication also works to the Arduino Serial Monitor. I ran the Wire library Scanner example, and it's printing this (because nothing else is connected).

    Code:
    Scanning...
    No I2C devices found
    
    Scanning...
    No I2C devices found
    
    Scanning...
    No I2C devices found
    
    Scanning...
    No I2C devices found
    
    Scanning...
    No I2C devices found
    I can't say why it's not working for you, but I can show you some quick photos of how I tested just now.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	DSC_0680_web.jpg 
Views:	1 
Size:	131.6 KB 
ID:	18712   Click image for larger version. 

Name:	DSC_0681_web.jpg 
Views:	3 
Size:	142.5 KB 
ID:	18715  

    Click image for larger version. 

Name:	DSC_0677_web.jpg 
Views:	1 
Size:	160.0 KB 
ID:	18713   Click image for larger version. 

Name:	DSC_0676_web.jpg 
Views:	1 
Size:	177.3 KB 
ID:	18714  


  20. #20
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    21,288
    Quote Originally Posted by noodle View Post
    There will also be a BNO080 (I'm eagerly awaiting your findings/fixes in the other thread),
    I do have some good news for you on BNO080. I've rewritten the Wire library functions to much better manage the FIFOs and better recover from the strange things BNO080 does at startup.

    Install 1.49-beta5 to get the Wire lib updates.

    https://forum.pjrc.com/threads/59030...no-1-49-Beta-5

    I tested it here with BNO080. Kurt and Mike also ran tests just before I released this. Things are looking pretty good for BNO080 now.

  21. #21
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    21,288
    Ok, let's try this again with the photos....

    Click image for larger version. 

Name:	DSC_0681_web.jpg 
Views:	5 
Size:	142.5 KB 
ID:	18716

    Click image for larger version. 

Name:	DSC_0676_web.jpg 
Views:	3 
Size:	177.3 KB 
ID:	18717

    Click image for larger version. 

Name:	DSC_0677_web.jpg 
Views:	1 
Size:	160.0 KB 
ID:	18718

    Click image for larger version. 

Name:	DSC_0680_web.jpg 
Views:	2 
Size:	131.6 KB 
ID:	18719

    (click each image for full size)

  22. #22
    Junior Member
    Join Date
    Jan 2020
    Posts
    9
    Thanks for checking, Paul. I'm not sure what the problem is then. The only thing we're doing differently is I'm using the bottom row pin as opposed to the side pin you're using.
    If I can work anything out, I'll post it here.

    Re: BNO080. Fantastic. Thank you. I'll test it out later tonight.

  23. #23
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    21,288
    Not visible in the photos are the length of wire... (and the clutter on my workbench). Those clip leads are each 24 inches long. There's no extra capacitor or anything else between Teensy and the BK Precision 1474 power supply, just those 2 leads that are each 2 feet long.

  24. #24
    Senior Member
    Join Date
    Feb 2016
    Location
    Australia
    Posts
    251
    I tested my teensy 4.0 powered by 3.3V at 3.3V pin and it does indeed work for me.
    I think it may be significant that the high level on usb data line is about 1.5vdc when powered this way. If powered from usb 5Vdc I get a bit over 3V.

    Powering a teensy 3.6 gives the same 3VDC high level if powered from 3.3v or 5v.

    I've read the protocol requres 3.3Vdc pulled high on d+ or d- for speed identification.

    Perhaps try another computer.

    i'm getting my info from here:
    https://www.beyondlogic.org/usbnutshell/usb2.shtml

  25. #25
    I've just looked a bit deeper into the datasheet and it says the USB_VBUS inputs are "not part of the power-on sequence and may be powered at any time". So I was wrong, you can (as other's have shown) power the 3V3 pin externally and expect the teensy to run.
    At first, I looked at paul's set up where the USB was running without powering these inputs and frankly was tremendously confused. Unless I'm really missing something, cutting the Vin-Vusb trace should disconnect pin N6 and P6 from the USB, and without power to the Vin pin, the USB should be unpowered.
    I would guess, and I stress the use of guess, that there's some kind of path for powering the USB circuity. Clamping diodes on USB D+/- that allow enough power to be drawn from the data lines could do it. This would be the sort of thing that doesn't work every time. Again, the datasheet recommends 4.5V or more to VBUS, so if this condition isn't met you can't expect consistent results.

Posting Permissions

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