PIC12F683 pin GP3 as output


Results 1 to 15 of 15

Threaded View

  1. #13


    Did you find this post helpful? Yes | No

    Default Re: PIC12F683 pin GP3 as output

    Hello,
    finally success. I grab one of my PICAXE 08M2, read it with pickit programmer (destroy the bootloader) and yes, it is a PIC12F1840 not a 12F683 which is a previous version of PICAXE 08M (Richard has good suggestion).

    OK, back to my question if it is possible to use the GP3 (MCLR) pin as digital output on this 12F1840 yes, it is!
    This method is suitable to switch simple devices like relays, LEDs, etc. The state is only 1 or 0 (on/off).
    All done with enabling or disabling the GP3 pin internal pull-up resistor. The circuit is the same as in my previous post, and the example code for PIC12F1840 LED blinking on GP3 is like:
    Code:
    ;PIC 12F1840
    #CONFIG
      __config _CONFIG1, _FOSC_INTOSC & _WDTE_OFF & _PWRTE_ON & _MCLRE_OFF & _CP_OFF & _CPD_OFF & _BOREN_ON & _CLKOUTEN_OFF & _IESO_ON & _FCMEN_ON
      __config _CONFIG2, _WRT_OFF & _PLLEN_ON & _STVREN_ON & _BORV_19 & _LVP_OFF
    #ENDCONFIG
    
    DEFINE OSC 32    ; Use internal clock 
    OSCCON = %01110000
    CLKRCON = 0
    
    TRISA = %000000
    ANSELA = 0  
    OPTION_REG.7=0  ; Enable internal pull-ups
    
    strt:
    wpua=%001000
    PAUSE 500
    wpua=%000000
    PAUSE 500
    goto strt
    The LED is on when pull-up is set ON, and the LED is OFF when the pull-up is set to OFF, that simple it is.

    I think, this method is usable for all PIC devices which allows to individual pull-up switching on MCLR pin.
    Last edited by louislouis; - 11th February 2018 at 10:47.

Similar Threads

  1. Question on using MCLR pin for interupt. (PIC12F683)
    By g-hoot in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 7th February 2009, 02:15
  2. Turn on output pin
    By savnik in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 11th March 2007, 11:49
  3. Input / output using same pin
    By leonel in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 4th March 2007, 21:19
  4. using TOCK pin as output?
    By droptail in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 8th November 2006, 17:15
  5. How to set analog pin to output 5V?
    By james in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 8th July 2004, 07:24

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