Reset Teensy 3.6 from PC side (Windows)

Status
Not open for further replies.

maelh

Member
Hi,

An Arduino UNO can be reset by just opening a serial connection to it and setting the DTR pin appropriately.
Windows code to achieve this looks like this:
Code:
//Setting the DTR to Control_Enable ensures that the Arduino is properly
//reset upon establishing a connection
dcbSerialParams.fDtrControl = DTR_CONTROL_ENABLE;
See Serial::Serial(const char *portName) in the following link for details:
https://playground.arduino.cc/Interfacing/CPPWindows

This works even if the micro is not responding to other serial communication, is busy or in an endless loop.

I saw there is the hardware solution of pulling PROG to GND.
And solutions that work with code running on the Teensy itself:
https://forum.pjrc.com/threads/30567-Hardware-reset-on-Teensy-LC
https://forum.pjrc.com/threads/44857-How-to-Reset-Restart-Teensy-3-5-using-sotware

But is there something that can reset the Teensy when it is not responding (and therefore not able to process Serial messages), just by setting some Serial or USB connection options, such as the DTR pin for Arduino UNO?
 
Since the USB on teensy is software driven anything that hangs it badly enough to not service USB interrupts will prevent reset. Uno has the FTDI chip which electrically sets the reset for the Atmega IC so is reliable as long as nothing happens to the FTDI chip (pretty much never other than when FTDI decided to remotely brick all clones). There is a special baud rate setting that drops a teensy that is still active on USB into programing mode but that will also hang it unless you are actually ready to load new code to it. Executing a reboot of a system in a failed condition is always a tricky proposition without adding peripheral hardware.
 
Status
Not open for further replies.
Back
Top