I purchased a couple of Teensy 4.1's several months back for a project that ended up delayed; lacking an unused FTDI adapter I used the pair as 3v3 UARTs for a pair of routers using the following code:
Code:
unsigned long baud = 19200;
const int reset_pin = 4;
const int led_pin = 13; // 11=Teensy 2.0, 6=Teensy 1.0, 16=Benito
const int led_on = HIGH;
const int led_off = LOW;
void setup()
{
pinMode(led_pin, OUTPUT);
digitalWrite(led_pin, led_off);
digitalWrite(reset_pin, HIGH);
pinMode(reset_pin, OUTPUT);
Serial.begin(baud); // USB, communication to PC or Mac
Serial1.begin(baud); // UART, communication to teensy
}
long led_on_time=0;
void loop()
{
unsigned char c, dtr;
static unsigned char prev_dtr = 0;
if (Serial.available()) {
c = Serial.read();
Serial1.write(c);
digitalWrite(led_pin, led_on);
led_on_time = millis();
return;
}
if (Serial1.available()) {
c = Serial1.read();
Serial.write(c);
digitalWrite(led_pin, led_on);
led_on_time = millis();
return;
}
dtr = Serial.dtr();
if (dtr && !prev_dtr) {
digitalWrite(reset_pin, LOW);
delayMicroseconds(250);
digitalWrite(reset_pin, HIGH);
}
prev_dtr = dtr;
if (millis() - led_on_time > 3) {
digitalWrite(led_pin, led_off);
}
if (Serial.baud() != baud) {
baud = Serial.baud();
Serial1.begin(baud);
}
}
I only hooked up the ground and RX/TX pairs and it worked fine for several days. I went to manage one of them a few days ago and one of the Teensy 4.1's was dead. It would not button reset to blinky, and the programming light never even flashed when the button was held down. What appears to be the LDO (u4) was too hot to touch (though the CPU never even gets warm), and it appears the 3v3 is shorted to ground (0.06 volts between 3v3 and GND when powered over USB, 26ish ohms between 3v3 and ground when disconnected and left probing for several second). There are no solder bridges or metal flakes anywhere because I never soldered any of the pins, I just wrapped thin wire through the holes and ran some heat shrink and then hot glue over them to hold it all in place well enough for UART work (was hoping to keep them unsoldered so I could use them for the previously mentioned project). I checked the second Teensy and determined that one was dead too, same 3v3 to GND issue. I have verified the routers were at 3v3 signaling level, and I have never connected any voltage sources other than a USB cable to the Teensy (e.g. no 3v3 after power off from the router to damage it). I checked the forums here for similar issues and it seems that the LDO has been the issue in the past, but I have no idea how it might have rx'd backcurrent as I never connected 3v3 or 5v, unless it was somehow being driven by the voltage on the UART pins when disconnected from USB (though I thought all the pullups/downs were disconnected when powered off), and the UART is coming from the SOC on the router which had no issues, so I don't know how many amps that could realistically deliver before dying itself if it was trying to drive the Teensy.
I'm happy to send the units back in if it would help, but I'm guessing that's not going to be very useful in diagnosing the cause of the failures. I'm also assuming I'm now out $63, as it doesn't make much business sense to send replacements for this kind of hardware.
If anyone has any ideas on how to get the units back up and running (or any idea what could have caused this) that would be amazing, thanks.