Digital Pin State being always high after powerup

Status
Not open for further replies.

WS2812B

Member
I am currently building a project which involves a Teensy 3.2. One of its jobs is to always keep a digitalPin after powerup HIGH to later at some time pull it down to GND. I tried that:

-Teensy 3.6 (I cannot use my 3.2 on a breadboard)
-3K6 Pullup to 3.3V
- Pin 14
Code:
void setup()
{
  delay(1000);
  digitalWrite(14, HIGH);
  pinMode(14, OUTPUT);
  digitalWrite(14, HIGH);

}

void loop()
{

}

This is the result:

Teensy_Pin State.png

The pin goes LOW for about 237nS. For this application I could solve that by adding a low pass filter to the pin but in my opinion this is an ugly solution and this would only work for this particular case.
Is it somehow possible to let it stay HIGH all the time?
 
You might look at the source code for pinMode() in the Teensyduino core files and try to optimize that code which initializes the GPIO port. 237ns on a T3.6 means less than only 50 CPU cycles, not sure if you can beat that, though.
 
Status
Not open for further replies.
Back
Top