pinMode disabled USB Serial - Teensy 3.6

Status
Not open for further replies.

ksafin

Member
Hi all,

I've baked in a Teensy 3.6, and I'm having a weird problem right now.

I'm setting the pinMode for pin 40 to OUTPUT, and after doing so, the Teensy no longer appears in USB Serial -- and I can't hear from it.

If I remove the pinMode(40, OUTPUT) statement, then it continues to work and output Serial.

Setting pinMode to INPUT and INPUT_PULLUP work just fine, but OUTPUT kills Serial.

The pin goes from the MCU to the gate of a PFET, which has a 30k pullup to +3.3V -- but that's it.

Any idea what might be causing the problem?
 
Is the Teensy working at all when pin 40 is an output? From the description most likely cause is outright failure of the MCU, most likely from excess current through pin 40. Apologies if you've already tested and proven it to just be USB coms that fails but running blink with and without pin 40 as an output would be a possible step.

First though would be using a multimeter to check pin 40 really is 30k to 3.3 and OC to gnd, along with checks to adjacent pins since if this is what is happening sooner or later the MCU will probably die from abuse.
 
I tried to reproduce this problem by running this on a Teensy 3.6 here:

Code:
void setup() {
  pinMode(40, OUTPUT);
}

void loop() {
  static int count;
  Serial.printf("count = %d\n", count++);
  delay(100);
}

It's printing properly in the Arduino Serial Monitor.

count = 776
count = 777
count = 778
count = 779
count = 780
count = 781
count = 782
count = 783
count = 784
count = 785
count = 786
count = 787
count = 788
count = 789
count = 790
count = 791
count = 792

Whatever's wrong with your setup, I didn't manage to reproduce it by this simple test on a Teensy 3.6 without any hardware connected.

Any idea what might be causing the problem?

Good question. Obviously something is different between your hardware & code than what I just tried here. Usually I don't investigate an issue unless there's complete code posted, but in this case it looked so simple that I just guessed a small program. As usually happens, I didn't guess right to reproduce the problem.

If you'd like me to look into this, you're going to need to post a complete program and details of *exactly* what hardware to test.
 
Status
Not open for further replies.
Back
Top