Two blown Teensy 3.1's

Status
Not open for further replies.
I'm working on a project that uses a Teensy 3.1, TFT display and an si5351 breakout board.
Everything seems to work fine with the encoder changing the frequency and the button(switch) on the encoder changing the tuning steps. Originally, I had the display and the si5351 breakout board powered from the 3.3v pin of the Teensy 3.1. When the first Teensy died I changed this and powered both from an external 3.3v regulator, thinking this might have caused the problem. A week later the second Teensy 3.1 died. At this time both boards draw about 380ma and have no 3.3v output. I assume the processor is fried. I ordered two more but before I try them, I would like a little advise.
The wiring and code can be seen here. Any help would be appreciated.
Code:
#include <Adafruit_GFX.h>    // Core graphics library
#include <Adafruit_S6D02A1.h> // Hardware-specific library
#include <SPI.h>
#include <Wire.h>
#include <si5351.h>
//#include <Encoder.h>
#include <Rotary.h>
#include <Bounce2.h>

// This examples uses the hardware SPI only. Non-hardware SPI
// is just too slow (~8 times slower!)

#define  BACKLIGHT  0  // backlight control signal
#define sclk 13 // Don't change
#define mosi 11  // Don't change
#define cs   2
#define dc   3
#define rst  1  // you can also connect this to the Arduino reset
#define ENCODER_BTN  16  //I use this instead of TuneSW

Adafruit_S6D02A1 display = Adafruit_S6D02A1(cs, dc, mosi, sclk, rst);  // Invoke custom library

Rotary tune(15, 14); //pins 15 and 14 used for encoder
Si5351 si5351;
//const int8_t TuneSW =18;    // low for fast tune - encoder pushbutton(I don't use this)
volatile uint32_t vfo = 1420000000ULL / SI5351_FREQ_MULT; //start freq - change to suit
volatile uint32_t LSB = 899950000ULL;
volatile uint32_t USB = 900150000ULL;
volatile uint32_t bfo = 900150000ULL; //start in usb
volatile uint32_t radix = 100;
volatile uint32_t lastVFO;
int myOldList[9]= {0,0,0,0,0,0,0,0,0};
uint32_t Bands[] {
 1800000L, 3500000L, 7000000L, 10100000L, 14200000L, 18065000L, 21000000L, 24890000L, 28000000L
}; //not used at the moment
boolean changed_f = 0;
String tbfo = "USB";

void setup(void) {

  Serial.begin(9600); // debug console
  Wire.begin();
  pinMode(BACKLIGHT, INPUT_PULLUP); // yanks up display BackLight signal 
  pinMode(ENCODER_BTN, INPUT_PULLUP);  // tuning rate = high "radix"
  attachInterrupt(14, chk_encoder, CHANGE);  //I attach interrupts to encoder pins
  attachInterrupt(15, chk_encoder, CHANGE);  //but use the same Interrupt Service Routine                                                                                           //(chk_encoder())
  si5351.init(SI5351_CRYSTAL_LOAD_8PF,0);
  //si5351.set_correction(157);
  // Set CLK0 to output vfo plus IF frequency with a fixed PLL frequency
  si5351.set_pll(SI5351_PLL_FIXED, SI5351_PLLA);
  si5351.set_freq((vfo * SI5351_FREQ_MULT) + bfo, SI5351_PLL_FIXED, SI5351_CLK0); 
  //volatile uint32_t vfoT = (vfo * SI5351_FREQ_MULT) + bfo; //test stuff
  tbfo = "USB"; //for lower left display display
  // Set CLK2 to output bfo frequency
  si5351.set_freq( bfo, 0, SI5351_CLK2);

  display.initR(INITR_BLACKTAB);   // initialize a S6D02A1S chip, black tab
  SPI.setClockDivider(SPI_CLOCK_DIV2); // crank up the spi
  uint16_t time = millis();
  display.setRotation(1); // 0 - Portrait, 1 - Lanscape
  display.fillScreen(S6D02A1_BLACK);
  display.setTextWrap(true);
  delay(500);
  //testdrawrects(S6D02A1_GREEN);
  delay(500); 
  setUpDisplay();
  display_frequency();
  display_radix(); 
}

void loop() { 

 if(changed_f)     //this flag is changed to yes(1) when the encoder changes
 {   
    display_frequency();
    //synt.simple_set_frequency(CLK0, frequency*F_MULT); 
    si5351.set_freq((vfo * SI5351_FREQ_MULT) + bfo, SI5351_PLL_FIXED, SI5351_CLK0);
     si5351.drive_strength(SI5351_CLK0,SI5351_DRIVE_8MA);
    if (vfo >= 10000000ULL & tbfo != "USB")
    {
      bfo = USB;
      tbfo = "USB";
      si5351.set_freq( bfo, 0, SI5351_CLK2);
      Serial.println("We've switched from LSB to USB");
    }
    else if (vfo < 10000000ULL & tbfo != "LSB")
    {
      bfo = LSB;
      tbfo = "LSB";
      si5351.set_freq( bfo, 0, SI5351_CLK2);
      Serial.println("We've switched from USB to LSB");
    }
    changed_f = 0;        //and cleared back to no(0) after updates are made to the si5351
 }
 if (get_button())
  {
    switch (radix)
    {
      case 1:
        radix = 10;
        break;
      case 10:
        radix = 100;
        break;
      case 100:
        radix = 1000;
        break;
      case 1000:
        radix = 10000;
        break;
      case 10000:
        radix = 100000;
        break;
      case 100000:
        radix = 1;
        break;
    }
    display_radix();
  }
}

// show frequency
void display_frequency() {
    //lastVFO = vfo;
    char string[80];   // print format stuff  - I always have to look this up :)
    sprintf(string,"%d.%03d.%03d",vfo/1000000,(vfo-vfo/1000000*1000000)/1000,
          vfo%1000 );
    display.setCursor(35, 5);
    display.setTextColor(S6D02A1_GREEN,S6D02A1_BLUE); //full display blanking -
    display.setTextSize(2);                                                              //you really need the
    display.print(string);                                                                  //2nd parameter to keep the
}                                                                                                     //display from flickering

void set_frequency(short dir)
{                                         
  if(dir == 1)                 //This routine is called by the Interrupt Service Routine chk_encoder()
    vfo += radix;            //which sets the vfo to its new value up or down plus or minus the
  if(dir == -1)               //the step size(radix)   
    vfo -= radix;
  changed_f = 1;          //it also sets this yes/no flag to yes to tell the loop that there has been a
}                                  //a change in frequency

void chk_encoder(){                                               //This routine (ISR) is called by the Arduino
   //Serial.println("inside encoder");                       // every time the encoder changes. Interrupts
    unsigned char result = tune.process();               // tell microprocessors, "STOP WHAT YOU
    if (result) {                                                          // ARE DOING!....and take care of me before
    //Serial.println(result == DIR_CW ? 1 : -1);     //going any further"
    if (result == DIR_CW)                                      //calls set_frequency() with a +1 or -1
    set_frequency(1);
  else if (result == DIR_CCW)
    set_frequency(-1);   
  }
}
void setUpDisplay(){
    //display.fillRect(1,1,158,25,S6D02A1_BLUE);
    //display.Color565(245, 179, 190);
    display.fillScreen(S6D02A1_BLUE);
    //display.fillRect(0,5,158,23,S6D02A1_BLUE);
    display.fillRect(1,1,13,24,S6D02A1_RED);
    //display.fillRect(1,1,13,24,Color565);
    display.drawFastVLine(0, 0, 25, S6D02A1_WHITE);
    display.drawFastVLine(159, 0, 25, S6D02A1_WHITE);
    display.drawFastHLine(0,0,160,S6D02A1_WHITE);
    display.drawFastHLine(0,25,160,S6D02A1_WHITE);   
    display.setCursor(1, 5);
    display.setTextSize(2);
    display.setTextColor(S6D02A1_GREEN);
    display.println("A");
//    display.setCursor(1, 90);
//    display.setTextSize(1);
//    display.setTextColor(S6D02A1_GREEN);
//    display.println("USB     RIT off     100Hz");

}

/**************************************/
/* Read the button with debouncing    */
/**************************************/
boolean get_button()
{
  if(!digitalRead(ENCODER_BTN))
  {
    delay(20);
    if(!digitalRead(ENCODER_BTN))
    {
      while(!digitalRead(ENCODER_BTN));
      return 1;
    }
  }
  return 0;
}

void display_radix()
{
  //display.fillRect(0,90,158,24,S6D02A1_BLUE);
  display.setTextSize(1);
  display.setTextColor(S6D02A1_GREEN,S6D02A1_BLUE);
  display.setCursor(110, 85);   
  //display.println("USB     RIT off     100Hz");
  switch (radix)
  {
    case 1:
      display.print("    1");
      break;
    case 10:
      display.print("   10");
      break;
    case 100:
      display.print("  100");
      break;
    case 1000:
      display.print("   1k");
      break;
    case 10000:
      display.print("  10k");
      break;
    case 100000:
      //display.setCursor(10, 1);
      display.print(" 100k");
      break;
      //case 1000000:
      //display.setCursor(9, 1);
      //display.print("1000k"); //1MHz increments
      //break;
  }
  display.print("Hz");
}
 
I may be wrong but the pin on the Teesny 3.1 that you have connected your 3.3V power supply to is a 3.3V (100mA) output from the onboard LDO on the Teesny. It's NOT a 3.3V input.
That may well be the reason something on the Teensy is fried.
 
I may be wrong but the pin on the Teesny 3.1 that you have connected your 3.3V power supply to is a 3.3V (100mA) output from the onboard LDO on the Teesny. It's NOT a 3.3V input.
That may well be the reason something on the Teensy is fried.
That drawing is from before when I was powering the TFT and the si5351 board from the Teensy 3.1. After the first Teensy 3.1 mishap, I supplied them with an external 3.3V.
Tom
 
Ok. so in that case we need to see an updated diagram how you supply power to the Teensy. Any specs on the power supply ?
The vast majority of cases that deal with dead/hot Teensy boards have one or another problem with supplying power.
 
I may be wrong but the pin on the Teesny 3.1 that you have connected your 3.3V power supply to is a 3.3V (100mA) output from the onboard LDO on the Teesny. It's NOT a 3.3V input.
That may well be the reason something on the Teensy is fried.

Provided you're not powering the Teensy via Vin as-well, powering the T3.1 via the 3.3v pin is fine.

Trying to power the display from the 3.3v regulator output would quite possibly have killed the first teensy. To confirm, you weren't supplying power to the teensy (via usb?) in addition to supplying 3.3v to the 3.3v pin on the second teensy?
 
Provided you're not powering the Teensy via Vin as-well, powering the T3.1 via the 3.3v pin is fine.

Trying to power the display from the 3.3v regulator output would quite possibly have killed the first teensy. To confirm, you weren't supplying power to the teensy (via usb?) in addition to supplying 3.3v to the 3.3v pin on the second teensy?

The Teensy was never powered by anything other than the usb port. According to Adafruit "Current draw is based on LED backlight usage: with full backlight draw is ~50mA". The si5351 with 3 outputs enabled is 35ma. This may have been cutting it a little close which is why on the second Teensy 3.1 I used a separate 3.3V supply to power the TFT display and the si5351 breakout board. At no time was the Teensy supplied power by anything other than the usb port from the computer.
Tom
 
The thing that caught my eye this morning are pins 14 & 15 I can't see where they are initialized and what mode. could they potentially be undefined & default to output and is there a case they could be shorted to ground through the encoder? Just a thought.
 
My recollection is that all pins are, by default, in high-Z mode.

D33 on the Teensy 3.x is trouble if held low during reboot. But it wouldn't fry the teensy.
 
However, if you at any time had the USB cable attached while the vin-vusb trace was not cut AND you supplied power externally, then that could kill the Teensy.

Anytime you want to supply power externally AND want to attach Teensy to a computer for debugging, VIN-VUSB has to be cut.
 
I may be wrong but the pin on the Teesny 3.1 that you have connected your 3.3V power supply to is a 3.3V (100mA) output from the onboard LDO on the Teesny. It's NOT a 3.3V input.
That may well be the reason something on the Teensy is fried.

I don't follow. According to the schematic, vout3v3 is attached to all VCC pins on board and the 3.3v pinholes as well. 3.3v can be supplied to these externally. Provided that the VIN-VUSB trace has been cut, you can even attach a USB cable and debug on you computer of choice.

What I would do as a next step is to isolate the power supplies. Use the teensy as shipped (ie leaving the VIN-VUSB trace intact), power the external stuff with the external power supply, and merely share the ground. If that works intended, investigate cutting the VUSB-VIN trace and powering it all from the external power supply.
 
Last edited:
Actually I think I see my folly. I connected the back light pin (BL) to D0 and according to my own comment made above, the back light can draw as much as 50ma. Although the drawing is not updated, supplying VCC on both the TFT and the breakout board with an external 3.3v supply doesn't solve the problem of the Teensy not being able source the current needed from the back light. I have 2 new boards arriving today from Amazon and will try it again w/o supplying the back light from the Teensy 3.1 and see how it works out. This might explain why it took a week or two for the boards to fry - it was just cooking.
Tom
 
Yes, that would do it. IIRC, recommended draw is < 9mA, going up to 20mA max for short periods.

You could just feed that pin into a mosfet or transistor to switch the backlight on and off. (potentially using PWM).
 
I don't follow. According to the schematic, vout3v3 is attached to all VCC pins on board and the 3.3v pinholes as well. 3.3v can be supplied to these externally.
Thanks for the clarification!

As my projects all require 5V anyway I usually supply 5V externally with the trace cut.
 
Last edited:
my teensy 3.1 outputs 5v on both 3.3v terminals. starts out at about 3 and after about 5 minutes reaches around 5v
 
Yes, that would do it. IIRC, recommended draw is < 9mA, going up to 20mA max for short periods.

You could just feed that pin into a mosfet or transistor to switch the backlight on and off. (potentially using PWM).

I cannot find that specification anywhere. All I could find was from http://cdn.sparkfun.com/datasheets/Dev/Arduino/Boards/K20P64M72SF1.pdf on page 10 which states:
"ID Maximum current single pin limit (applies to all digital pins) –25 25 mA" (min and max)
I measured the current draw from the TFT back light and it turned out to be about 19ma. The display itself (w/o back light) plus the breakout board only draws about 25ma. Can you tell me where I might find information that states the limits of the i/o pins other than what I found?
Thanks,
Tom
 
Have a look at page 13. I think by default the Teensy core defaults the pins to high drive strength, which gives you 9mA to play with.
But as you say, I think you can drive higher loads (possibly up to 25mA as you've pointed out for short periods. Note, 'Maximum' current single pin limit).
 
My issues are not directly related to the same conditions as mentioned in the thread, but the title reflects it best. Recent convert to a Teensy, and have already blown up the second one. Hopefully, the next two that I have coming will arrive shortly. I am not new to electronics or microprocessors, I have been playing in the guts of this stuff since the C-64, and programming micros, and building hardware for years. If I am having these kinds of issues, then someone will less experience surely has to be.
I have been reading for a couple of days and am finally convinced I have it nailed down, but it caught me by suprise. A search (once I figured out the right combination of keywords) listed 377 other posts regarding powering from USB and externally, or blowing up the Teensy.

I guess the request is this: Could there be a sticky or could PJRC consider beefing up the explanation (and warning) for dual powering? Maybe just adding some expanded whats and whys, or pictorial examples of what is right and what is wrong to prevent this all too often pitfall. My specifics were that I was thinking in a 5v world and still getting used to 3.3v, so that's on me. I was working on the second on a proto board https://www.tindie.com/products/pico/rfx-teensy-3x-nrf24l01-carrier-board-w-prototyping-area-/?pt=ac_prod_search and installed the diode on that, but overlooked cutting the USB trace and adding a diode on that side. Simple mistakes, but deflating, none the less. I understand how cramped the Teensy is and the challenge of adding protection to the board, so I'm not slamming Paul. This is a bit more advanced board, and if you want to play, you have to accept that. As more new comers are coming from a software background, a bit more hand holding might be helpful.

All that said, I am really having a great time with these. Wonderfully executed and incredibly powerful. Bumps? sure, but really glad you build them, Paul, and really thankful that the community is supporting them.

Mark
 
I agree with it being a good subject for the wiki, and I look forward to it. I guess my concern in the short term is to emphasize somewhere just how easy it is to breeze past this important step. Maybe i'm just sore at myself for making a dumb mistake twice, but the pain of waiting for new ones to arrive is frustrating. I came from different brand micro to Arduino. I still like the other ones, but for some things, an Arduino makes things go together pretty fast. After some learning on a UNO, I started to bump up on size and speed limits that I look to solve with the Teensy (oh, and more features!). Blazing from my original platform, to the UNO, then to Teensy, I just got sloppy concentrating on code more than hardware and missed it. Spoiled, I guess, with the childproof platforms. (we all know ANY platform is less than childproof, I was just used to them and already paid my tuition to the school of hard knocks). I remember how much frustration I had when I first got into them, and how many times I just threw up my hands for months when I got stuck. I'd hate to see others make common mistakes and give up when it could be avoided.

Thanks for listening to my rant. Back to your regularly scheduled programming...
Bo
 
Hey this might also be a good suggestion to develop a ruggeduino like shield for the teensy that incorporates the myriad of protection devices that keep inputs happy, provide external power, etc. would make Teensy tougher to kill but the VUSB-VIN connection would still likely have to be cut.
 
Actually in the middle of a board layout for something along those lines. Got a ways to go and I don't want to make a coaster, so a bit more testing (and learning) before I commit.
 
#include <Adafruit_S6D02A1.h> // Hardware-specific library

Can someone point me to a link where I can download the #include Adafruit_S6D02A1.h library used in the above sketch? Dont seem to be able to find it.

Thanks in advance.
 
Status
Not open for further replies.
Back
Top