Strange power problem with T4

JihoonLee

Member
I met the BLE pairing problem on T4 with HM-10 to an Android APP.

If I input +5v to T4's vin and measure the power consumption, I get the following two results.

Result 1. Maintain more than 100mah continuously.
Result 2. The first 100mah is reached, and 1sec later it drops to a value of 70~80mah.

When I tried BLE pairing HM-10 with an APP , I found that result 1 is always succeeds, and 2 is fails.

It will be 1 or 2 depending on what the power source is used.

If the result is 1.
When using a commonly used smartphone charger (5v 1A or 5v 2A) (100% result is 1)
(+5v Group A.)

If the result is 2.
+5v converted from a higher voltage value battery (LM2596, ams1117, lm7805) is used as a power source, the power consumption value drops to 70~80mah.
(+5v Group B.)

My guess is that the dynamic clock scaling function of T4 is works when the T4 boots up...? And in low clock mode, it seems to apply some limit to BLE channels(sereal 5) maybe..

The strange thing is that when supply +5v Group A to T4 vin, if connect PC via USB, the result is 2.

Also, when I supply +5v Group B to T4, I connect my oscilloscope's(Agilent 54622D) probe GND to T4's GND and I get result 1.

And testing with only the T4 without the HM-10 connection will not make any difference.

could you please advise me on this matter?
Thank you.

I'm sorry the code source is too long and unorganized to attach. (I hope trying to solve it in hardware if I possible.)
 

Attachments

  • schemetic.gif
    schemetic.gif
    40.2 KB · Views: 31
  • results.jpg
    results.jpg
    103.2 KB · Views: 28
  • extbat7.4v.jpg
    extbat7.4v.jpg
    71.7 KB · Views: 27
  • extchar5v1a.jpg
    extchar5v1a.jpg
    66.1 KB · Views: 32
Last edited:
Can you check the output voltage of the smartphone charger with no load and then when it is connected to the T4? It may be producing more than 5V. Chargers aren't power supplies.

Pete
 
Can you check the output voltage of the smartphone charger with no load and then when it is connected to the T4? It may be producing more than 5V. Chargers aren't power supplies.

Pete

The power source information has been added as an attachment. Thank you.
 
I seem to have forgotten the purpose of this question. I want to get the "result 1" with T4 frome a 7.4v battery power source.
I don't know what kind of regulator to use to board.
How can I get result 1 with battery?
 
T_4 only stays in the hardware required boot speed 396 MHz for a short few ms (<20 expected) time and goes to build requested speed ( 600 MHz >> set_arm_clock(F_CPU); ) many ms before entering setup() at 300+ ms.

Result 2. The first 100mah is reached, and 1sec later it drops to a value of 70~80mah.
> This is long after the speed switch and entry to setup() for sure at ~300ms.

When the current drops to #2 <80 mA it seems the Teensy is running and ready? Has that been Confirmed with pin/led toggle or Serial output? Not shown/indicated how that HM-10 is powered.

Perhaps the problem is the HM-10 not powering up properly and being responsive? Maybe watch the current draw on that device?
 
When the current drops to #2 <80 mA it seems the Teensy is running and ready?

> When the result is #2(<80 mA), obviously seral 5 doesn't seem to work.

Not shown/indicated how that HM-10 is powered.

> I supplied separate 3.3v through the ams1117 to HM-10.
I also tried the 3.3v inside the T4. But the result is the same.
Even if the result is 1 without HM-10, then pairing will be success connect the power of HM-10 later.
 
Meant to ask about: "And testing with only the T4 without the HM-10 connection will not make any difference."
- so the code fails even with just the T_4.0 and no HM-10 or other devices connected?
- doesn't seem to be 'faulting' since ther eis no delay and restart and "if (CrashReport) Serial.print(CrashReport);" would show anything.
- assuming USB is never connected given external power?
- If so, and the VUSB<>VIN trace were cut (?), or a USB cable with the 5V line cut: USB to host computer could present debug status output

> When the result is #2(<80 mA), obviously seral 5 doesn't seem to work.

Sorry, not clear what is obvious - except some problem not understood or seen. And no pictures or code provided to see the execution path. Wanting to confirm if the Teensy executing code? And up to what point. With Serial USB prints to host computer, or can a pin (LED) be set HIGH entering setup(), perhaps dropped low exiting setup then toggled in loop()? With a scope or other watching pin(s) it could be confirmed to be booting and working.
> With the current looking like 100 mA for a second or longer ( depending on meter update rate ) it is well past the void ResetHandler() code in startup.c (where clock rate changes) and should be into user code setup() and perhaps beyond

One test for clock speed adjust and lower current could be to build with CPU Speed to run at 396 MHz - it would never change speed and should be more than fast enough to see it work for Result #1 and look for change in #2 behavior.

> I supplied separate 3.3v through the ams1117 to HM-10.
I also tried the 3.3v inside the T4. But the result is the same.
Even if the result is 1 without HM-10, then pairing will be success connect the power of HM-10 later.

Knowing if the Teensy is executing even in case of result #2, versus locked up or hung for some reason would give a better idea of which way to go: CODE versus supplied POWER
 
Meant to ask about: "And testing with only the T4 without the HM-10 connection will not make any difference."
- so the code fails even with just the T_4.0 and no HM-10 or other devices connected?

> Yes, when running T4 alone I got a result of #1 or #2 depending on the power source.


- doesn't seem to be 'faulting' since ther eis no delay and restart and "if (CrashReport) Serial.print(CrashReport);" would show anything.
- assuming USB is never connected given external power?

>I think so, it's not Teensy's fault. It's a source code issue I guess.

- If so, and the VUSB<>VIN trace were cut (?), or a USB cable with the 5V line cut: USB to host computer could present debug status output

>I already cuted the USB to Vin. I would like to try to debug, but I feel difficult to analyze all this code with my skills. (ref of the reason next below)

Sorry, not clear what is obvious - except some problem not understood or seen. And no pictures or code provided to see the execution path. Wanting to confirm if the Teensy executing code? And up to what point. With Serial USB prints to host computer, or can a pin (LED) be set HIGH entering setup(), perhaps dropped low exiting setup then toggled in loop()?

>Actually, I'm making a stepper motion controller based on Puremoco, which is provided as open source. source code here https://www.puremoco.com/firmware.html#undefined2 Download https://downloads.puremoco.com/firmware/2020-04-18_purecontrol_v100_teensy36.zip

I'm sorry for not posting the source code in this article.
Because I knew, that amount of code is not small, so I must be feel very sorry to you if I posted it.
Originally this source code was for the T36. But it works fine on T4 (with +5v smartphone charger).
*what's really weird, Even with a power source that always results in #2 If connect the oscilloscope's GND to T4 GND, it will change to result #1.

With a scope or other watching pin(s) it could be confirmed to be booting and working.
> With the current looking like 100 mA for a second or longer ( depending on meter update rate ) it is well past the void ResetHandler() code in startup.c (where clock rate changes) and should be into user code setup() and perhaps beyond

>The state of T4 when the result is #2 has not been checked in detail. I'll try it based on your advice.

One test for clock speed adjust and lower current could be to build with CPU Speed to run at 396 MHz - it would never change speed and should be more than fast enough to see it work for Result #1 and look for change in #2 behavior.

>I've tried different CPU Speed modes on the Arduino IDE.
The result is the same (except for the smartphone charger), with a constant amount of current decreasing relatively, resulting in Result #2. If choose 450MHz for example, it will reach 800mA on boot and drop to 600mA after 1 second.

Knowing if the Teensy is executing even in case of result #2, versus locked up or hung for some reason would give a better idea of which way to go: CODE versus supplied POWER

>I will try to testing again detaily at the state of result #2. My debugging skills are very lacking.
Despite the lack of explanation of the problem, I really appreciate your detailed answers and advice for solve the problem.
I always feel gratitude in this forum.
 
Indications are it is running especially seeing this note again:
with a power source that always results in #2 If connect the oscilloscope's GND to T4 GND, it will change to result #1.
That makes it seem like 'adding GND' helps.

Since the VIN<>VUSB trace is cut the USB cable may or may not be connected even with external power.
> does the #2 result change when the state of the USB cable 'Connected or not' change the result to #1 in any case?

For debugging having the cable connected and building with 'USB Serial' type allows use of: Serial.print() or Serial.printf() to display status and feedback of code location or variable values.

As noted, this doesn't seem to be a boot speed change issue - especially with the same result showing at that power up speed of 396 MHz.
 
Sorry,

Sort of hard to see/know what is going on... Note I am software guy so probably disregard, but will throw a few darts in case one helps.

For example are you sure the software is running? In cases like this I might make sure I have the LED blinking and/or some other pin, which I can check with a logic analyzer or scope.

If different behavior when plugged into USB, I might direct debug output to a Hardware Serial port, and then hook up some form of USB to serial connection to the hardware port. Sometimes I just use another teensy with the example USB Serial example for this.

I know there have been different external VRs which have issues starting up a teensy. That is they might have a slow voltage ramp up... I had issues with an external BEC by Castle Creations which I purchased about several years ago. Which a T4 would not startup with. I have had good luck with DC/DC converters from POLOLU..

Could there be an issue with heat? That is if you are dropping voltage from 3s lipo, that might be 13+v down to 5v, it might be producing heat. Not sure if they will limit themself? Or if it close to the T4, might it be heating up the Teensy?

Again sorry I know a lot of this is probably not the issue, but who knows.
 
Sorry,

Sort of hard to see/know what is going on... Note I am software guy so probably disregard, but will throw a few darts in case one helps.

For example are you sure the software is running? In cases like this I might make sure I have the LED blinking and/or some other pin, which I can check with a logic analyzer or scope.

If different behavior when plugged into USB, I might direct debug output to a Hardware Serial port, and then hook up some form of USB to serial connection to the hardware port. Sometimes I just use another teensy with the example USB Serial example for this.

>Thank you very much for your thoughtful advice.

Honest be Couldn't figure out what's going on with result #2.
Unfortunately I'm not very familiar with how to debugging on Teensy.

I'll try it again follow your advice by scope and serial monitor or possibly other methods.

I know there have been different external VRs which have issues starting up a teensy. That is they might have a slow voltage ramp up... I had issues with an external BEC by Castle Creations which I purchased about several years ago. Which a T4 would not startup with. I have had good luck with DC/DC converters from POLOLU..

>I tried a combination of different types of buck converter, LDO and capacitors, but couldn't find a clear cause. However, I belive the solution will be found from the power supply or noise problem.

Could there be an issue with heat? That is if you are dropping voltage from 3s lipo, that might be 13+v down to 5v, it might be producing heat. Not sure if they will limit themself? Or if it close to the T4, might it be heating up the Teensy?

>There doesn't seem to be any heat issues. My T4 looks very normal.
I think the root cause of the problem is the source code problem.

Again sorry I know a lot of this is probably not the issue, but who knows.

Not at all, Actually I just posted here to get some help if anyone has had the same experience as me. but it seems not simple than my thought.

I apologize for posting a question without detailed information.
I linked to a video that I made today about this problem. If you have time, I would appreciate you could take a look.
https://youtu.be/Re96ywoYwrY

Thanks again for your kind help.
 
Indications are it is running especially seeing this note again:

That makes it seem like 'adding GND' helps.

Since the VIN<>VUSB trace is cut the USB cable may or may not be connected even with external power.
> does the #2 result change when the state of the USB cable 'Connected or not' change the result to #1 in any case?

>Once I get a #1 or #2 result, the result doesn't change without a reboot.
>USB <-> VIN is definitely cut.

For debugging having the cable connected and building with 'USB Serial' type allows use of: Serial.print() or Serial.printf() to display status and feedback of code location or variable values.

>I'm not familiar with it, but I'll try to debug it following your advice.

As noted, this doesn't seem to be a boot speed change issue - especially with the same result showing at that power up speed of 396 MHz.

Yes I agree. Perhaps this is not a boot speed change issue.
After hearing your opinion, I thought..
Sorry for the lack of detailed information. Late, but I made a video about this issue(including the "Add GND" issue as well). If you have time, could you please refer to it? https://youtu.be/Re96ywoYwrY

Thank you for your kindness.
 
Back
Top