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

Thread: Teensy 3.2 not starting in very particular circumstances

  1. #1

    Teensy 3.2 not starting in very particular circumstances

    Something strange is happening and I'm hoping you can help me.

    There are two boards -- one with an MCP2551 and other with a SN65 and Teensy 3.2, they are connected by a 4 wire cable.

    Click image for larger version. 

Name:	Blank Diagram (1).jpg 
Views:	17 
Size:	28.3 KB 
ID:	17920

    Normally Teensy 3.2 and SN65 have a serial between them, but for this example it is disconnected. They only connections between the Teensy and the outside world are: Vin (5V), GND, 3V to SN65.

    When power is connected to the 48V connector, Teensy 3.2 fails to boot up... Unless any of the following are true:
    1. MCP 2551 is off when Teensy 3.2 is just booting up
    2. 3.3V pin of the Teensy is disconnected from SN65
    3. Both CAN_H and CAN_L are disconnected between MCP2551 and SN65
    4. While 48V is connected, GND between the two boards is disconnected! CAN_H/L is somehow acting as ground?
    5. Using Teensy LC instead of 3.2 (I know LC doesn't have a CAN module)

    Other facts:
    - 48V, 5V and 3.3V rails come on smoothly without any spikes, the rise time is around 4ms
    - SN65 is drawing 8-14mA from the Teensy
    - There are current spikes on the 48V line during startup (because of input capacitance on the second PCB)

    To summarize, if MCP 2551 and SN65 are booting up at the same time, Teensy doesn't boot up. Even though there is nothing suspicious on either 5V or 3.3V buses.

  2. #2
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,913
    Was a particular SN65 device purchased - or wired directly to a chip?

    Scanning the SN65 chip doc it seems there are ways to start the device in lower power mode - where it won't try activating on power up perhaps preventing a surge beyond the expected: 'SN65 is drawing 8-14mA from the Teensy'

  3. #3
    Not sure what you mean about the SN65. It was bought from digikey?

    The current surge happens just on the 48V line and doesn't go beyond the DC-DC converter.

    Here's a snapshot of the power buses (48V, 5V and 3.3V). Teensy failed to boot here.

    Click image for larger version. 

Name:	IMG_0184.jpg 
Views:	6 
Size:	107.3 KB 
ID:	17927

    Current on the 5V line. Measuring over a 33Ohm resistor. The peak is 40mA, settles at 18mA. Teensy failed to boot here.

    Click image for larger version. 

Name:	IMG_0185.jpg 
Views:	6 
Size:	110.4 KB 
ID:	17928

    Current on the 3.3V line. Measuring over a 33Ohm resistor. Immediately goes to 9mA. Teensy has booted successfully here (!).
    It will also boot successfully if there's a 10Ohm resistor between SN65 and Teensy, but not with a 2.2Ohm resistor.

    Click image for larger version. 

Name:	IMG_0186.jpg 
Views:	4 
Size:	104.0 KB 
ID:	17929
    Last edited by idontwantausername; 10-16-2019 at 07:51 PM.

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,673
    I'm not familiar with "SN65". Is that a CAN transceiver chip, maybe SN65HVD230, SN65HVD231, or SN65HVD232?

    How do you observe whether or not Teensy booted successfully?

    I ask because (long ago) we had regular reports that Teensy was not retaining a program after a cold boot. People who experienced this problem where so sure Teensy was storing their program in RAM, because it would work when they uploaded from Arduino, but then fail to boot up when the power cycled the board. Regular Arduino boards would always work. After many such reports, we ultimately figured out the cause was Teensy booting too quickly when used together with motion sensor chips, which happen to take about 100 to 150 ms to boot up. Programs which tried to init the sensor once at startup, and didn't check for errors (nearly all Arduino libs for those sensors take this approach) would then never get any data, and of course those programs weren't designed to report any error conditions or do anything at all if the sensor didn't respond. Regular Arduino boards have a lengthy delay at startup while the bootloader waits (but Teensy uses a different approach to enter bootloader mode, so your code can run right away). So every indication, to someone not understanding the true nature of the problem, was an appearance that Teensy has lost their program due to the power cycle.

    Perhaps your application is much better, but still I would urge you to test with Teensy programmed to run only the LED blink example. If you can reproduce the problem, where the orange LED never lights up, that would be a much better sign this really is a hardware issue. I'm sure you're already convinced of that, but from many prior painful experiences (we had dozens of those threads about Teensy not retaining code before the real problem was understood) subtle software issues can appear to be a hardware startup problem. It's important to test with the simplest possible program that gives easily observable startup indication before reaching that sort of conclusion.

  5. #5
    SN65HVD230DR.

    I am indeed using a blink example in this case.

  6. #6
    @PaulStoffregen Do you have any pointers on diagnosing this? What reasons could there be for Teensy not to boot up?

  7. #7
    I've tried putting SN65 into stand-by mode, didn't work. What did work was putting a MOSFET between 3.3V and SN65 and controlling it's gate with a GPIO pin that's activated after a boot-up. I'll roll with this for now.

    I'm still curious about the root cause of this problem. The only other clue I got is that the oscillator doesn't seem to be on when Teensy fails to boot up.

  8. #8
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,673
    Quote Originally Posted by idontwantausername View Post
    Do you have any pointers on diagnosing this?
    The next things to try is putting some code in the earliest startup to turn on the LED. It's quite possible the hardware is starting up, but then crashing for some reason. Issues with VBAT and crystal startup are the things to suspect first, if the LED lights.

  9. #9
    Senior Member crees's Avatar
    Join Date
    Dec 2016
    Location
    Utah
    Posts
    174
    Could also be a ground loop issue. I have seen similar issues in the rs485 stuff. On the rs485 project I am working on I ended up using a DC / DC power isolator and opto isolators to prevent potential ground loops.

    As I understand it if you interface different modules together and their power sources are different you run the risk of ground loops.


    crees

  10. #10
    Quote Originally Posted by PaulStoffregen View Post
    The next things to try is putting some code in the earliest startup to turn on the LED. It's quite possible the hardware is starting up, but then crashing for some reason. Issues with VBAT and crystal startup are the things to suspect first, if the LED lights.
    The LED never lights up and the crystal never starts. VBAT is steady 3.3V.

    Quote Originally Posted by crees View Post
    Could also be a ground loop issue. I have seen similar issues in the rs485 stuff. On the rs485 project I am working on I ended up using a DC / DC power isolator and opto isolators to prevent potential ground loops.

    As I understand it if you interface different modules together and their power sources are different you run the risk of ground loops.
    I'm also suspecting a ground loop issue. Especially since I don't seem to need the GND connected between the boards for them to work. But my cables are not shielded, so it has got to be CAN lines acting as ground?

    Resistance from CAN to GND: @MCP2551 -- ~25MOhms, @SN65 -- 130kOhm-300kOhm. Quite a disparity. Could this be an issue?

  11. #11
    Works after implementing a soft-starter based on LM5069.
    Not 100% -- restarting while there's some voltage on the 48V line leads to some Teensys not starting, but with a clean start, everything works.

Posting Permissions

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