While working on the project for my Bachelor's Degree in Mechanical Engineering I've come along a strange little problem and i'd like to ask if the following behaviour is happening to anyone else and how to deal with it.
Whenever I'm uploading code onto my Teensy 4.1, there obviously is a kind of reset. When trying to use the Teensy in the following circuit, I could hear some of the relays switch.

That means that there has to be some kind of voltage applied on those pins during the reset. This results in a short lasting but unwanted connection over the NO-pins of the relay.
When testing which relays had switched, I found out that only relay1 and relay2, which are connected to Teensy 4.1 pins 24 and 25, got their switching voltage applied.
The other relays remained in their non-switched-state, eventhough they're wired up in the exact same way and handled by the code in the same way.
While trying to locate the problem, I decided to remove all of my developed switching circuit and also started up a new code.
I measured the output voltage directly on the Teensy Pins with an oscilloscope while uploading code which only function was to define all digitalpins and to put them on LOW.
There are no other electronics connected than the external 5 V, the USB-connection and the oscilloscope.
The following code is the code I used to analyse the voltages given out while resetting. When this code is uploaded to any of my Teensys, this behaviour occurrs.
I iterated this test by measuring every single Pin on the Teensy with the oscilloscope and registered that only Pin 24 and 25 apply a voltage of 3,3 V on their outputs while resetting.
No other pin applied voltage during the process. On a second Teensy 4.1 the exact same problem occurred.
The only thing I changed on the Teensys is cutting the PCB-bridge that connects the external 5 V input and the voltage of the USB-input, as the Teensy needs the usb serial port for communication while being powered externally
As I can't change the usable pin due to an ordered pcb, I had to implement another small extension-pcb.
This pcb contains even more relays that are used as a first stage switch, to prevent the unwanted connection over the relay.
The relays are activated as the first stage, after the teensy has finished resetting.
As this is not a perfect solution to my problem, i'd like to ask if this has been registered by anyone else and whether there is a code-ish way to solve this problem.
I hope I didn't miss to give any information - if so - feel free to ask.
Unfortunately I can't give any information on the circuit the relay switches, but as it's completely seperate from the Teensy itself, there should be no interference.
I hope that we can solve this problem and a big thank you in advance.
Whenever I'm uploading code onto my Teensy 4.1, there obviously is a kind of reset. When trying to use the Teensy in the following circuit, I could hear some of the relays switch.

That means that there has to be some kind of voltage applied on those pins during the reset. This results in a short lasting but unwanted connection over the NO-pins of the relay.
When testing which relays had switched, I found out that only relay1 and relay2, which are connected to Teensy 4.1 pins 24 and 25, got their switching voltage applied.
The other relays remained in their non-switched-state, eventhough they're wired up in the exact same way and handled by the code in the same way.
While trying to locate the problem, I decided to remove all of my developed switching circuit and also started up a new code.
I measured the output voltage directly on the Teensy Pins with an oscilloscope while uploading code which only function was to define all digitalpins and to put them on LOW.
There are no other electronics connected than the external 5 V, the USB-connection and the oscilloscope.
The following code is the code I used to analyse the voltages given out while resetting. When this code is uploaded to any of my Teensys, this behaviour occurrs.
Code:
#define testpin0 0
#define testpin1 1
#define testpin2 2
#define testpin3 3
...
...
...
#define testpin38 38
#define testpin39 39
#define testpin40 40
#define testpin41 41
void setup() {
pinMode(testpin0, OUTPUT);
digitalWrite(testpin0, LOW);
pinMode(testpin1, OUTPUT);
digitalWrite(testpin1, LOW);
...
...
...
pinMode(testpin40, OUTPUT);
digitalWrite(testpin40, LOW);
pinMode(testpin41, OUTPUT);
digitalWrite(testpin41, LOW);
}
void loop() {
}
I iterated this test by measuring every single Pin on the Teensy with the oscilloscope and registered that only Pin 24 and 25 apply a voltage of 3,3 V on their outputs while resetting.
No other pin applied voltage during the process. On a second Teensy 4.1 the exact same problem occurred.
The only thing I changed on the Teensys is cutting the PCB-bridge that connects the external 5 V input and the voltage of the USB-input, as the Teensy needs the usb serial port for communication while being powered externally
As I can't change the usable pin due to an ordered pcb, I had to implement another small extension-pcb.
This pcb contains even more relays that are used as a first stage switch, to prevent the unwanted connection over the relay.
The relays are activated as the first stage, after the teensy has finished resetting.
As this is not a perfect solution to my problem, i'd like to ask if this has been registered by anyone else and whether there is a code-ish way to solve this problem.
I hope I didn't miss to give any information - if so - feel free to ask.
Unfortunately I can't give any information on the circuit the relay switches, but as it's completely seperate from the Teensy itself, there should be no interference.
I hope that we can solve this problem and a big thank you in advance.