Teensy 3.6 Reset Pin

Status
Not open for further replies.

Geomancer

Active member
Simple question. Is the reset pin an active low signal?

Does it behave as a simple reset, meaning rebooting the processor the same as at power on?


I have an external watchdog & power supervisory chip (ADM8321WAX30) that I plan to use. My project has several high power solenoids that I have to be absolutely sure don't get 'stuck' on or they'd melt/catch fire.

So, since I need something external to the processor to kill those drivers, I might as well have it reset the processor too.

If it's just a typical active low reset, I can throw a pullup resistor on the open drain output of the watchdog and connect it up.

The other question would be, can it be held in reset until the 3.3V comes up? I'd assume yes ... but better to ask! I've read some other threads were some say you can put a cap on reset to ground, which would work if reset has an internal pullup. But then another thread said the Teensy wouldn't boot when they had an external pull up to 3.3V and cap to ground so....
 
yes you just need to ground the reset pin to reset teensy or hold it down to hold it reset, but do not hold it down for exactly 15 seconds before releasing, or else the bootloader would reflash teensy with a blank sketch. The issue with most of those boot issues is due to the powersupply, the capacitor method is more like a bandaid fix. Ideally you’d either use a better PSU, or put on a POR (power on reset) chip that would do exactly what you said, hold reset until voltage stabilizes.
 
If it's just a typical active low reset, I can throw a pullup resistor on the open drain output of the watchdog and connect it up.

Yes, that's exactly how it's meant to be used.

There's already a weak pullup resistor built inside the chip. It's fine to add another really pullup. Recommend between 2.2K to 10K.

Also be aware your watchdog chip isn't the only thing that can pull the pin low. The bootloader also pulls the reset low. The reset pin pulls itself low when the chip initiates its own reset (eg, vis the AIRCR register or the internal watchdog).


The other question would be, can it be held in reset until the 3.3V comes up?

Yes, you can do this.


I've read some other threads were some say you can put a cap on reset to ground

That's correct. Do not use capacitor. Use a chip that only pulls the pin low at startup, and make sure it's open collector/drain, not a push-pull type.

A capacitor will play havoc when the bootloader chip needs to reboot the main processor. Remember the reset is open collector, so more than 1 source can pull it low. Your external circuit isn't the only actor here.
 
A capacitor will play havoc when the bootloader chip needs to reboot the main processor. Remember the reset is open collector, so more than 1 source can pull it low. Your external circuit isn't the only actor here.
I’ve got a project where I’ve only just realised (newbi 🙄) I need to delay the MCU at boot up. I’ve made 50 units using the teensy 35 and realised about half of them have a boot up issue.
Is it a definite no go to add a small RC network to the reset pin.
Do I have any other options?
 
I’ve got a project where I’ve only just realised (newbi ��) I need to delay the MCU at boot up. I’ve made 50 units using the teensy 35 and realised about half of them have a boot up issue.
Is it a definite no go to add a small RC network to the reset pin.
Do I have any other options?

A power supervisor chip may do that, just get one that has an open drain or open collector. Depends how much delay you need and what the delay is for.

Or you could build your own by using an open collector comparator, putting a resistor divider on one input to set the threshold, and an RC on the other to get your delay.
 
Thanks for the response.
I tried a basic RC network and while this does resolve the boot up issue it does stop you from updating the code via the USB.

I ordered some MIC803 supervisors (20ms with open drain) at the weekend and they came today. They seem to work well and I can still use the USB to update code. I've also created a small PCB that I can mount over the top of the teensy that should allow me to mount the supervisor on all the 50 units...

Cheers
 
Do I have any other options?

This might be a long shot, but you could try adding a delay in the startup code in mk20dx128.c.

For a bit of background, a couple years ago we had issues where Teensy 3.6 would work with USB power but would fail to start up with certain types of external power supplies. While at first it seemed Teensy 3.6 wasn't booting at all, in fact it was starting up but crashing early in the startup code when it tried to turn on the RTC's oscillator. With slowly rising power, the extremely fast startup of the hardware would result in the code running before VBAT had stabilized, because it is one diode "behind" the main 3.3V power. Turns out the startup begins when the power is only about 1.6 volts! As you can see from the comments in mk20dx128.c, we delayed the RTC init until later, which gives time for VBAT to reach enough voltage.

I did say this is sort of a long shot, because I have absolutely no idea whether the problem you're seeing with Teensy 3.5 is related, or if it's something completely different. But adding a delay should be pretty easy, so it might be worth a try. You can't call any of the normal functions very early in the startup code, because pretty much all of the hardware is not yet initialized. But you can try adding something simple like this:

Code:
  volatile uint32_t n = 0;
  for (n=0; n < 29000000; n++) { /* simple delay */ };

If you add this, find this place in mk20ds128.c where the RTC is first initialized and add it just before.

Code:
#if defined(KINETISK) && !defined(__MK66FX1M0__)
        // If the RTC oscillator isn't enabled, get it started early.
        // But don't do this early on Teensy 3.6 - RTC_CR depends on 3.3V+VBAT
        // which may be ~0.4V "behind" 3.3V if the power ramps up slowly.
        if (!(RTC_CR & RTC_CR_OSCE)) {
                RTC_SR = 0;
                RTC_CR = RTC_CR_SC16P | RTC_CR_SC4P | RTC_CR_OSCE;
        }
#endif
 
Hi Paul, thanks for the response. It is odd that I'm not seeing this on all the Teensy 35 unit, but about 60% of them.

I'm using platformIO on "Visual Studio Code", do you happen to know where i would find the file "mk20dx128.c" to carry out these edits. I've done a file search on my laptop and can't find it.
 
I'm using linux and on my machine the file is located at
Code:
~/.platformio/packages/framework-arduinoteensy/cores/teensy3/mk20dx128.c
 
Status
Not open for further replies.
Back
Top