Using MCLR pin at Input


Closed Thread
Results 1 to 10 of 10

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,624


    Did you find this post helpful? Yes | No

    Default Re: Using MCLR pin at Input

    Hi,
    To me it looks like you're doing everything right though neither ANSEL nor CMCON should have any effect on GP3 operation.
    However, I don't know the details on how meProg works. Is it possible that what it's actually programming into the chip is STILL what the code says - the default config for the 12F683 is MCLR enabled?

    I guess you can always try that by changing the oscillator setting in meProg and program the chip, if it STILL runs then there's something going on with the CONFIG bits not being programmed to the settings showed in meProg.

    I'm sorry for not having a definitive answer.

    /Henrik.

  2. #2


    Did you find this post helpful? Yes | No

    Default Re: Using MCLR pin at Input

    I have this in my program (PBP2.60C) and am using GP3 as an input and it works fine.

    @ DEVICE PIC12F683, intrc_osc_noclkout, wdt_on, mclr_off, protect_off , bod_on

    INCLUDE "ALLDIGITAL.pbp"

    The ALLDIGITAL.pbp just makes sure I have everything set as digital.


    The problem is that the PBP assembler uses mclr and mpasm uses MCLRE , see the .inc file

    Code:
    ;****************************************************************
    ;*  12F683.INC                                                  *
    ;*                                                              *
    ;*  By        : Leonard Zerman, Jeff Schmoyer                   *
    ;*  Notice    : Copyright (c) 2005 microEngineering Labs, Inc.  *
    ;*              All Rights Reserved                             *
    ;*  Date      : 08/31/05                                        *
    ;*  Version   : 2.46a                                           *
    ;*  Notes     :                                                 *
    ;****************************************************************
            NOLIST
        ifdef PM_USED
            LIST
            include 'M12F683.INC'	; PM header
            device  pic12F683, intrc_osc_noclkout, wdt_on, mclr_on, protect_off
            XALL
            NOLIST
        else
            LIST
            LIST p = 12F683, r = dec, w = -302
            INCLUDE "P12F683.INC"	; MPASM  Header
            __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_ON & _CP_OFF
            NOLIST
        endif
            LIST

  3. #3
    Join Date
    Apr 2014
    Location
    OK
    Posts
    557


    Did you find this post helpful? Yes | No

    Default Re: Using MCLR pin at Input

    "device pic12F683, intrc_osc_noclkout, wdt_on, mclr_on, protect_off"
    "__config _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_ON & _CP_OFF"

    I believe to use the MCLRE pin as a digital input these 2 lines must read "mclr_off" and "_MCLRE_OFF"

    Mike

  4. #4


    Did you find this post helpful? Yes | No

    Default Re: Using MCLR pin at Input

    Quote Originally Posted by mpgmike View Post
    "device pic12F683, intrc_osc_noclkout, wdt_on, mclr_on, protect_off"
    "__config _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_ON & _CP_OFF"

    I believe to use the MCLRE pin as a digital input these 2 lines must read "mclr_off" and "_MCLRE_OFF"

    Mike
    But ONLY if you always want it OFF - and then have to remember to change it in the program, when you want it on.

    The inc file is for general use, and idealy should be left unchanged, - you use the config statements in your program to over ride, as per the statement at top of post 3

    @ DEVICE PIC12F683, intrc_osc_noclkout, wdt_on, mclr_off, protect_off , bod_on

Similar Threads

  1. MCLR Pin
    By Aussie Barry in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 26th July 2013, 09:58
  2. ICSP with MCLR as input
    By Luckyborg in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 13th June 2013, 17:40
  3. Q: using MCLR for Input on 12F683
    By picster in forum mel PIC BASIC Pro
    Replies: 46
    Last Post: - 31st January 2009, 16:25
  4. MCLR line input only
    By Squibcakes in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th April 2008, 00:14
  5. Mclr As Input Pin?
    By omid_juve in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 24th December 2007, 07:33

Members who have read this thread : 0

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

Tags for this Thread

Posting Permissions

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