Powering Teensy LC via IO-Pin?

Status
Not open for further replies.

Joegi

Well-known member
Is it possible to power the Teensy LC (@24MHz) via an (20mA) IO-pin (which would be set to "output" and "high")?
It is a more complex scenario, but it is functional similar to a scenario where the power source would be connected to 3.3V and one IO-pin and if the connection to 3.3V would be lost the Teensy would be powered via the IO-pin!
Thanks for the answers in advance!
 
Last edited:
I don't think so, in some circumtances the LC may draw more than 20 mA.
I suggest using a FET circuit to switch and a second power supply.
 
Hm, a fet normally only "works in one direction", and as IO-pins are driven by fets it should not be possible to power the Teensy via an IO-pin!(?)
 
It's working! I always thought that all pins change to high impedance when power is off (regardless if there is voltage at any IO-pin)!
 
OOPS, I did this
Code:
pinMode(21, OUTPUT);
digitalWrite(21, HIGH);
to power the Teensy from the alternative power source (and afterwards removed the connection between the other source and Vin).
I forgot that the pin after the pinMode command is set to LOW and so there is a short until it is set to HIGH. As this short only lasts for a very short time it is working anyway, but would this
Code:
digitalWrite(21, HIGH);
pinMode(21, OUTPUT);
set the pin to HIGH immediately as it does on the AVRs?
 
It's not working with digitalWrite, but with digitalWriteFast:
Code:
digitalWriteFast(x, HIGH);
pinMode(x, OUTPUT);
 
Status
Not open for further replies.
Back
Top