Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 3 of 3

Thread: I chose the wrong pin for PWM - now what?

  1. #1
    Junior Member
    Join Date
    Dec 2021
    Posts
    17

    I chose the wrong pin for PWM - now what?

    I'm sure this is a case of GPIO 101 (i.e. very obvious) but I just want to check.

    I accidentally chose Teensy pin 38 for a PWM output, had PCBs fabricated, assembled the board and soldered Teensy into place...

    ... then discovered that pin 38 is not an option for PWM.

    Rather than doing something unmentionable to the pin header that connects this pin to my board involving melting plastic with a soldering iron, can I short 38 and 37 together and set 37 as my PWM output instead? (assuming I make sure not to set pin 38 as an output or input)?

    NB the PWM output is sending 20MHz to a clock input for another IC on my board, with a 10R resistor in series...

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    25,524
    I'm guessing this is Teensy 4.1?

    Usually shorting an output pin to an unused pin is fine. On Teensy 4.1 the unused pins default to a weak "keeper" circuit. You might use pinMode(38, INPUT_DISABLE) to put the pin into its highest impedance mode.

  3. #3
    Junior Member
    Join Date
    Dec 2021
    Posts
    17
    Dear Paul, yes Teensy 4.1.

    Thanks for confirming. I'll use INPUT_DISABLE as suggested and short the pins.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •