16f1824 MCLR pin going low causes PIC to reset - what am I missing?


Closed Thread
Results 1 to 13 of 13

Hybrid View

  1. #1
    Join Date
    Mar 2009
    Posts
    653

    Default 16f1824 MCLR pin going low causes PIC to reset - what am I missing?

    So I want to use pin 4 (RA3) as a switch input pin, I've enabled weak pullups...I measure 5V on there - all seems as it should, but whenever I press a switch (which ground the pin), the PIC resets (I have an Hserout command at the top of my code, so I see the word "reset" only if erhm,....the PIC has reset!)

    So I have this as the config.....

    Code:
    @ __CONFIG _CONFIG1, _FCMEN_OFF & _FOSC_INTOSC & _WDTE_OFF & _MCLRE_OFF & _CP_ON & _IESO_OFF & _BOREN_OFF & _PWRTE_OFF
    @ __CONFIG _CONFIG2, _PLLEN_OFF & _STVREN_OFF
    I thought the bolded entry allowed me to use pin 4 (RA3) as a normal digital input.

    Is there anything else I have to do to stop the PIC barfing just for grounding the MCLR pin?

  2. #2
    Join Date
    Dec 2003
    Location
    Storrs, Ct.
    Posts
    91


    Did you find this post helpful? Yes | No

    Default Re: 16f1824 MCLR pin going low causes PIC to reset - what am I missing?

    That pic is new to me but it looks like you may also need to check the configuration word 1 bit 6.
    "It will never happen here!" just happened here.
    My thoughts and prayers for Sandy Hook victims and families.

  3. #3
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    699


    Did you find this post helpful? Yes | No

    Default Re: 16f1824 MCLR pin going low causes PIC to reset - what am I missing?

    Are you using an external pullup resistor for your switch configuration?
    "No one is completely worthless. They can always serve as a bad example."

    Anonymous

  4. #4
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default Re: 16f1824 MCLR pin going low causes PIC to reset - what am I missing?

    Quote Originally Posted by rsocor01 View Post
    Are you using an external pullup resistor for your switch configuration?

    no...if i'm reading the datasheet correctly, it is possible to use a weak pullup for that pin, which is what i've done...

    Code:
    OPTION_REG.7 = 0
    WPUA =  %00011000
    IOCAN = %00011000

  5. #5
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    699


    Did you find this post helpful? Yes | No

    Default Re: 16f1824 MCLR pin going low causes PIC to reset - what am I missing?

    Quote Originally Posted by HankMcSpank View Post
    no...if i'm reading the datasheet correctly, it is possible to use a weak pullup for that pin, which is what i've done...
    Hmmm, try using an external resistor (maybe 4.7K Ohms) and see if you have the same problem. You might be drawing too much current when closing the switch and that might be causing the problem.
    "No one is completely worthless. They can always serve as a bad example."

    Anonymous

  6. #6
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default Re: 16f1824 MCLR pin going low causes PIC to reset - what am I missing?

    just tried an external pullup resistor on RA3 (vs internal weak pullup)- same results.....if I ground RA3 (MCLR pin), the PIC resets

    ...aaaaaaarrrrgggHHHH

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