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

Thread: Disconnect Pin in Software

  1. #1
    Junior Member
    Join Date
    Dec 2018
    Posts
    3

    Disconnect Pin in Software

    Is there any way to have a pin disconnected via software?

    I've built a PCB for a LED strip project but realised I may need to use a serial port pin for the strip's data signal due to interrupt issues. If I simply add a jumper wire from the new pin over to the old, is there a way (via software) to stop the original pin interfering with the signal? Ultimately, I could probably just cut out the original pin's connector but I'm just trying a less destructive approach first.

    Thanks!

  2. #2
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,329
    Possible. Depends a little from which pin. The chapter 10 of the Teensy 3.2 and 3.5 processor reference manuals and chapter 11 for the T 3.6 explains the pin signal multiplexing and gives hints on how to set the corresponding pin multiplexer register to the Alt0 function which in most cases is a passive high-z mode.

  3. #3
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    8,032
    Is this the right answer?

    Quote Originally Posted by PaulStoffregen View Post
    ... use INPUT_DISABLE to put the pin back to a mode where the digital circuitry (with slight leakage current) is turned off.
    ...

  4. #4
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,329
    That’s probably a right answer but the OP wouldn’t learn as much from that as if he had studied the reference manual...

  5. #5
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    8,032
    Quote Originally Posted by Theremingenieur View Post
    That’s probably a right answer but the OP wouldn’t learn as much from that as if he had studied the reference manual...
    Quite right on learning … though so many manuals I find it easier to read the forum and the code. _DISABLE probably isn't in the manual but something PJRC codified to restore the power up 'passive high-z' state.

    For inquiring minds look at :: ...\hardware\teensy\avr\cores\teensy3\pins_teensy. c for void pinMode(uint8_t pin, uint8_t mode) where this happens:
    Code:
    else { // INPUT_DISABLE
    			*config = 0;
    		}

  6. #6
    Junior Member
    Join Date
    Dec 2018
    Posts
    3
    Thanks for the answers, I appreciate the help.

    Even I agree on the learning - Having an answer with an explanation is always preferred as the problem is often not knowing where to start looking. In this case, I wasn't sure if it was a question primarly about Teensy, MCUs or basic electronics.

  7. #7
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    2,964
    why would you jump a wire? some pins have multiple capabilities, like using the same pin for the led strip and serial
    by changing it’s MUX config

  8. #8
    Junior Member
    Join Date
    Dec 2018
    Posts
    3
    It's because the Non-Blocking WS2812 LED Library requires using a HW serial port.

  9. #9
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    2,964
    ahh ok reread custom pcb with bad pin location, makes sense
    by default all pins are in a low power disabled state (hi-z) so don’t need to configure the “dummy pin”. just a wire jumper should do it and run library as normal

Posting Permissions

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