MizzardEntertainment97
Member
Hello everyone!
I encountered a particular problem when I connected Teensy 4.1 to the PC (via USB).
The problem occurs when I apply a digital signal to a GPIO pin declared as an input.
I have made a simple example program:
A button is connected to GPIO pin 2 (the pin has a 3300 Ohm pulldown resistor).
The button sets GPIO pin 2 to HIGH (3.3V)
As output I used the LED mounted on the board (e.g. GPIO pin 13).
The program reads GPIO pin 2 and writes the value to GPIO pin 13.
In addition to writing the value to GPIO pin 13, I write the digital value of GPIO pin 2 to the serial port (USB).
The problem occurs when I connect Teensy 4.1 to my PC.
By pressing the button quickly, the LED connected to pin 13 of the GPIO flashes but for a short time it stops (half a second, even less) and then starts again and everything stabilizes.
In addition to writing the value to GPIO pin 13, I write the digital value of GPIO pin 2 to the serial port (USB).
The loaded program is indifferent.
I tried to load a more complex program in which the Teensy 4.1 has an address bus to control the multiplexers and I noticed that when I connect it to the PC and try to activate an input from the multiplexers the bus freezes for a moment (always half a second, even less) and then starts again and everything stabilizes.
I tried to load various projects (programs) in which there are GPIO pins declared as input and serial enabled, and all of them have this block at startup if Teensy 4.1 is connected to the PC (USB)
I tried powering Teensy 4.1 with an external power supply and the blockage problem did not occur.
The program starts and does not crash.
The problem occurs with all 5 Teensy 4.1. I have both version MIMXRT1062DVJA and version MIMXRT1062DVJB (final A&B)
Has anyone had this problem?
I'm very curious to understand why it happens and how to fix it, if you can...
Because if I have to connect Teensy 4.1 via USB to transmit MIDI data but then it freezes for a moment at startup, I don't like it...
Sample program:
The settings in the drop-down menu (Arduino IDE 2.3.3):
Factsheet: Teensy 4.1
Port: USB:10003/0/0/8 (COM25 Serial (Teensy 4.1)
Keyboard layout: American English
Optimize: Faster
CPU Speed: 600Mhz
USB Type: Serial
Thank you all in advance for your help!!
I encountered a particular problem when I connected Teensy 4.1 to the PC (via USB).
The problem occurs when I apply a digital signal to a GPIO pin declared as an input.
I have made a simple example program:
A button is connected to GPIO pin 2 (the pin has a 3300 Ohm pulldown resistor).
The button sets GPIO pin 2 to HIGH (3.3V)
As output I used the LED mounted on the board (e.g. GPIO pin 13).
The program reads GPIO pin 2 and writes the value to GPIO pin 13.
In addition to writing the value to GPIO pin 13, I write the digital value of GPIO pin 2 to the serial port (USB).
The problem occurs when I connect Teensy 4.1 to my PC.
By pressing the button quickly, the LED connected to pin 13 of the GPIO flashes but for a short time it stops (half a second, even less) and then starts again and everything stabilizes.
In addition to writing the value to GPIO pin 13, I write the digital value of GPIO pin 2 to the serial port (USB).
The loaded program is indifferent.
I tried to load a more complex program in which the Teensy 4.1 has an address bus to control the multiplexers and I noticed that when I connect it to the PC and try to activate an input from the multiplexers the bus freezes for a moment (always half a second, even less) and then starts again and everything stabilizes.
I tried to load various projects (programs) in which there are GPIO pins declared as input and serial enabled, and all of them have this block at startup if Teensy 4.1 is connected to the PC (USB)
I tried powering Teensy 4.1 with an external power supply and the blockage problem did not occur.
The program starts and does not crash.
The problem occurs with all 5 Teensy 4.1. I have both version MIMXRT1062DVJA and version MIMXRT1062DVJB (final A&B)
Has anyone had this problem?
I'm very curious to understand why it happens and how to fix it, if you can...
Because if I have to connect Teensy 4.1 via USB to transmit MIDI data but then it freezes for a moment at startup, I don't like it...
Sample program:
Code:
#define Pin_In 2
#define Pin_Out 13
bool Input, Last_Input;
bool Output;
void setup() {
delay(10);
pinMode(Pin_In, INPUT);
pinMode(Pin_Out, OUTPUT);
Serial.begin(115200);
delay(100);
digitalWrite(Pin_Out, 1);
delay(500);
digitalWrite(Pin_Out, 0);
delay(500);
delay(100);
}
void loop() {
Input = digitalRead(Pin_In);
Output = Input;
digitalWrite(Pin_Out, Output);
if(Input != Last_Input){
Serial.print("Input > ");
Serial.println(Input);
Last_Input = Input;
}
}
The settings in the drop-down menu (Arduino IDE 2.3.3):
Factsheet: Teensy 4.1
Port: USB:10003/0/0/8 (COM25 Serial (Teensy 4.1)
Keyboard layout: American English
Optimize: Faster
CPU Speed: 600Mhz
USB Type: Serial
Thank you all in advance for your help!!
Last edited: