Weak pull-ups, WPU, and 12F683


Closed Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2006
    Location
    Omaha, Nebraska USA
    Posts
    263

    Default Weak pull-ups, WPU, and 12F683

    I'm running into a screwy problem:

    Using PBP and a 12F683 in a breadboard configuration, I've enabled the internal weak pull-ups on two pins, GPIO.2 and GPIO.1 (WPU=%00000110). These pins have simple NO pushbuttons to ground. I've reduced the essential parts of the circuit and program to one switch and a blinky.

    The results are flaky.

    Often, on power-up, the circuit behaves as if the switch is closed and held closed. Other times it starts normally, then jumps into the switch closed routine. (It doesn't behave much differently with the internal pull-ups disabled!)

    This goes away and everything is hunky-dory if I put external 10K pull-ups on the switches.

    ESD? Transients? A consequence of breadboarding? I'm nearing wits' end.
    Russ
    N0EVC, xWB6ONT, xWN6ONT

    "Easy to use" is easy to say.

  2. #2
    Join Date
    Jul 2008
    Location
    Vancouver, WA
    Posts
    8


    Did you find this post helpful? Yes | No

    Default

    Hi Russ,

    I would lean towards an order of operations issue. When the chip does a power on reset, it comes up in analog mode and the WPU's are turned off. The pins could still be floating when the program looks at them for the first time???
    Light travels faster than sound. That's why some people seem bright until you hear them speak.

  3. #3
    Join Date
    Jan 2008
    Location
    Sweden
    Posts
    187


    Did you find this post helpful? Yes | No

    Default

    Can you post the code you are using?

  4. #4
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    I would actually check...

    1. That you have DISABLED the ANALOG ADC on those pins...

    ANSEL=%00000000

    2. That you have DISABLED the COMPARATORS on those pins...

    CMCON0=%00000111

    3. That you have set TRISIO to INPUT on those pins...

    TRISIO=%00001110

    4. And that you have enabled the Weak Pull-UP's properly...

    WPU=%00000110
    OPTION_REG.7=0 ' <<< Bet you forgot this one!!!!

    And now you can do your Buttons from this point onwards... but just in case, I'd give it a few mS timeout first...

  5. #5
    Join Date
    Aug 2006
    Location
    Omaha, Nebraska USA
    Posts
    263


    Did you find this post helpful? Yes | No

    Default

    Melanie!

    ANSEL, yes.
    CMCON0, yes.
    TRSIO, yes.
    WPU, yes.

    OPTION_REG.7=0 . . . Oh, s**t! (And you win that bet!)

    DUH!

    Everything is now both hunky and dory.

    Thanks!
    Last edited by RussMartin; - 2nd February 2009 at 22:17.
    Russ
    N0EVC, xWB6ONT, xWN6ONT

    "Easy to use" is easy to say.

Similar Threads

  1. 12F683 internal pull up
    By hvacrtech in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 27th July 2008, 02:35

Members who have read this thread : 0

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