16F1823 - Can't get RA3 (MCLR) to be a switch input (attached switch resets PIC).


Results 1 to 7 of 7

Threaded View

  1. #2
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Make sure you include _LVP_OFF in CONFIG2 and test/clear IOCAF.3 and IOCAF.5 in your interrupt handler. The IOCAF bits will indicate which switch was pressed so you don't need to have a switch being held down or test for it.

    The /MCLR bit in CONFIG1 is ignored when LVP is enabled so it remains the reset input. LVP is enabled by default when you don't specifically clear it in CONFIG2.

    It never exits your interrupt because you're not clearing the IOCAF int flags in your int handler, so it's a continuous loop until reset by SW1 on /MCLR.
    Last edited by Bruce; - 9th January 2011 at 14:15.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

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