16f688 and MCLR (ra3) as input


Closed Thread
Results 1 to 3 of 3
  1. #1
    kitcat's Avatar
    kitcat Guest

    Default 16f688 and MCLR (ra3) as input

    Ok so I know that I have to set RA3 as an input and disable the MCLR function. I see that it also has a weak pull up which can be disabled. How can I set RA3 as an input, i.e. disable the MCLR and weak pull up. I have tried looking everywherre. Can I do it in code?

    Thanks

    Matt

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


    Did you find this post helpful? Yes | No

    Default

    everything will be done with config fuses. See the end of your .Inc files in the MPLAb directory

    it looks like this

    Code:
    ;==========================================================================
    ;
    ;       Configuration Bits
    ;
    ;==========================================================================
    
    _FCMEN_ON                    EQU     H'3FFF'
    _FCMEN_OFF                   EQU     H'37FF'
    _IESO_ON                     EQU     H'3FFF'
    _IESO_OFF                    EQU     H'3BFF'
    _BOD_ON                      EQU     H'3FFF'
    _BOD_NSLEEP                  EQU     H'3EFF'
    _BOD_SBODEN                  EQU     H'3DFF'
    _BOD_OFF                     EQU     H'3CFF'
    _CPD_ON                      EQU     H'3F7F'
    _CPD_OFF                     EQU     H'3FFF'
    _CP_ON                       EQU     H'3FBF'
    _CP_OFF                      EQU     H'3FFF'
    _MCLRE_ON                    EQU     H'3FFF'
    _MCLRE_OFF                   EQU     H'3FDF'
    _PWRTE_OFF                   EQU     H'3FFF'
    _PWRTE_ON                    EQU     H'3FEF'
    _WDT_ON                      EQU     H'3FFF'
    _WDT_OFF                     EQU     H'3FF7'
    _LP_OSC                      EQU     H'3FF8'
    _XT_OSC                      EQU     H'3FF9'
    _HS_OSC                      EQU     H'3FFA'
    _EC_OSC                      EQU     H'3FFB'
    _INTRC_OSC_NOCLKOUT          EQU     H'3FFC'
    _INTRC_OSC_CLKOUT            EQU     H'3FFD'
    _EXTRC_OSC_NOCLKOUT          EQU     H'3FFE'
    _EXTRC_OSC_CLKOUT            EQU     H'3FFF'
    _INTOSCIO                    EQU     H'3FFC'
    _INTOSC                      EQU     H'3FFD'
    _EXTRCIO                     EQU     H'3FFE'
    _EXTRC                       EQU     H'3FFF'
    you'll have to write a line to define your config fuse. Choose _MCLRE_OFF

    How to do that? click here

    Probably you'll have this message 'overwriting previous content....'
    use notepad, open 16F688.inc in your PBP directory. looks like this
    Code:
    ;****************************************************************
    ;*  16F688.INC                                                  *
    ;*                                                              *
    ;*  By        : Leonard Zerman, Jeff Schmoyer                   *
    ;*  Notice    : Copyright (c) 2003 microEngineering Labs, Inc.  *
    ;*              All Rights Reserved                             *
    ;*  Date      : 11/06/03                                        *
    ;*  Version   : 2.45                                            *
    ;*  Notes     :                                                 *
    ;****************************************************************
            NOLIST
        ifdef PM_USED
            LIST
            include 'M16F688.INC'	; PM header
            device  pic16F688, intrc_osc, wdt_on, mclr_on, protect_off
            XALL
            NOLIST
        else
            LIST
            LIST p = 16F688, r = dec, w = -302
            INCLUDE "P16F688.INC"	; MPASM  Header
            __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_ON & _CP_OFF
            NOLIST
        endif
            LIST
    cooment the 'device' or 'config' line and you're i business.

    OR modify within this file and forget the define in your code... i
    Steve

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

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Hello Matt. I just did the exact thing with a PIC16F819. I'm sure it works for them all. At the top of your code put:

    @ DEVICE MCLR_OFF

    Or you can manually turn it off on the programming software. Hope this helps.

Similar Threads

  1. 16f688 LCD what have I done wrong
    By spitfiredriver in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 8th August 2009, 19:54
  2. DS1820 with 16f688
    By jessey in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 23rd May 2009, 05:07
  3. 16F688 problem
    By Tobias in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 9th May 2009, 23:09
  4. 16F688 Internal clock and MCLR
    By manxman in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 18th August 2007, 18:38
  5. Help with 16f688
    By jessey in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 20th October 2006, 23:12

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