Unused pins


Closed Thread
Results 1 to 14 of 14

Thread: Unused pins

  1. #1
    Join Date
    Feb 2006
    Location
    Isle of Man
    Posts
    32

    Cool Unused pins

    Sorry to go over old ground but I would appreciate some clarification. Various threads on this forum advise that all unused PIC pins should be configured as inputs and tied to ground to improve immunity to noise. However, can these pins be connected directly to ground or should it be via a (100K ?) resistor on each (unused) pin?

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Straight to ground is fine.
    Dave
    Always wear safety glasses while programming.

  3. #3
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    Straight to ground is fine.
    At the risk of starting another argument/discussion...
    I don't know if I'd go straight to ground without a series resistor limiting the current to at least the pins current carrying capability, 25mA give or take. I'd throw at least a 200ohm resistor inline with it. I know the pin is set up as an input...but what happens if the program gets changed and the pin gets set up as an output with a logic high on it?
    Assuming the program stays the way it should, then, yes, straight to ground on an input pin...I'm just thinking a bit out in left field...

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Pull-down/Up may also be useful as test point or for future modification.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #5


    Did you find this post helpful? Yes | No

    Default

    I have had port pins actually toggle their state from high to low, inputs to outputs, outputs to inputs and disable the HPWM because of spikes generated from a small hobby motor. NO, additional power conditioning did not help as the motor was completely isolated with it's own battery supply. All the PIC did was activate a relay. However, the PIC was only 1/2 inch from the case of the motor. Seems my problems went away by making all unused ports output low & leave them floating. I also repeated the tris command repeatedly in case a spike toggels it into an input to prevent a floating input situation.

  6. #6
    Join Date
    Feb 2006
    Location
    Isle of Man
    Posts
    32


    Did you find this post helpful? Yes | No

    Smile Unused PIC pins

    So it seems the average answer is YES XOR NO! Yup, if I accidentally re-assign an unused grounded pin as output and make it high then we have a problem. To be safe I'll tie all unused pins low via 10K resistors.

    Thanks guys.

  7. #7
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    it's not a bad idea to refresh at least TRIS register while your program is running. ... at least for safety sake.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  8. #8
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    At the risk of starting another argument/discussion...
    An argument is a statement (premise) or group of statements (premises) offered in support of another statement (conclusion).

    I was not thinking about the pin changing to an output. A resistor is good insurance.
    Dave
    Always wear safety glasses while programming.

  9. #9
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    An argument is a statement (premise) or group of statements (premises) offered in support of another statement (conclusion).
    Good point...let me rephrase myself...

    At the risk of sounding like a complete idiot..............................

  10. #10


    Did you find this post helpful? Yes | No

    Default Thank you John

    Thank you for the suggestion John. At the time of the problem I tried EVERYTHING - caps, grounding the motor casing, separate battery supplies for PIC circuit and motor, etc. Seemed the the PIC was just too close to the motor itself (I had no control over this). But by repeating the commands constantly (especially the TRIS commands to keep inputs as inputs and outs as outs) and the HIGHs as HIGHs, etc., the problem vanished. I also had another motor problem where the HPWM was set to a specific duty cycle and intermittently become an output HIGH or output LOW. Again, after setting the HPWM, I constantly repeated the command in other parts where the program would go and that fixed it. Of course the program took more memory, but that wasn't an issue.

  11. #11
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Wink

    Who's John?
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  12. #12
    Join Date
    Mar 2007
    Location
    Boston, MA USA
    Posts
    12


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e View Post
    Who's John?
    That was me..

    I sent peterdeco1 a private message regarding motor noise effecting A/D. My problem was solved by using .1uf caps from each motor lead to the motor's metal case. It seems to work with the small (noisy) hobby motors. I used shielded cable to the A/D inputs.


    --John
    Last edited by JohnH; - 4th May 2007 at 00:36.

  13. #13
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Welcome on the forum, and thanks to share your tips on the public area
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  14. #14
    Join Date
    Mar 2007
    Location
    Boston, MA USA
    Posts
    12


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e View Post
    Welcome on the forum, and thanks to share your tips on the public area
    Thanks Steve! I have learned a lot about Pic's from some of your posts and others here.

    --John

Similar Threads

  1. 16f877 Unused Pins
    By DavyJones in forum General
    Replies: 8
    Last Post: - 25th September 2009, 04:12
  2. 16F877A Pullups/Pulldowns and unused pins
    By DavyJones in forum General
    Replies: 6
    Last Post: - 17th April 2009, 01:39
  3. Change On Interrupt, PIC16F884
    By elec_mech in forum mel PIC BASIC Pro
    Replies: 17
    Last Post: - 14th November 2008, 17:25
  4. Five unused pins and one resistor
    By Cabomba in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 27th May 2007, 18:07
  5. PIC PORT 'special' pins
    By barkerben in forum General
    Replies: 1
    Last Post: - 18th January 2005, 21:40

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

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