16F1826 cannot get MCLR to act as an INPUT


Closed Thread
Results 1 to 10 of 10

Hybrid View

  1. #1
    Join Date
    Jan 2009
    Posts
    50


    Did you find this post helpful? Yes | No

    Default Re: 16F1826 cannot get MCLR to act as an INPUT

    The LED is working if I set PortB.1=1 manually in code.
    I have an external 4MHz crystal.

    DEFINE OSC 4 should set the frequency. All other code commands work fine like the ADCIN.

    If I short out PortA.5 and hold it LOW, then the code should read a LOW on the port and turn on the LED.

    Mind boggling.

  2. #2
    Join Date
    Jan 2011
    Location
    Sydney, Australia
    Posts
    172


    Did you find this post helpful? Yes | No

    Default Re: 16F1826 cannot get MCLR to act as an INPUT

    I am not sure if this is the cause of your problem but 100k for a pull up resistor seems a bit too high.
    Try using the weak pull up associated with RA5 instead of the external pull up resistor - see page 123 of the datasheet for details.

    Cheers
    Barry
    VK2XBP

  3. #3
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,170


    Did you find this post helpful? Yes | No

    Default Re: 16F1826 cannot get MCLR to act as an INPUT

    Maybe stupid question, but are counting the pins correctly? Does seem strange... Also try 1K resistor, or directly Vdd/Vss connection.

    Are you programming the chip with ICSP or do you move the chip to a programmer and the move it back to your test board?

    Ioannis

  4. #4
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default Re: 16F1826 cannot get MCLR to act as an INPUT

    Code:
    mainloop:
    Pause 10
    if PortA.5= 1 then PortB.1 = 1 'turn ON an LED
    if PortA.5= 0 then PortB.1= 0 'turn OFF an LED
    goto mainloop
    Reduce the value of your pullup resistor from 100k to 10k and add a delay in the loop as per the above example.

    Then it should work as you expected.

    Cheers

    Al.
    All progress began with an idea

  5. #5
    Join Date
    Nov 2007
    Location
    West Covina, CA
    Posts
    219


    Did you find this post helpful? Yes | No

    Default Re: 16F1826 cannot get MCLR to act as an INPUT

    I think a write to the latch register might do it:

    Code:
    mainloop:
    Pause 10
    if PortA.5= 1 then LATB.1 = 1 'turn ON an LED
    if PortA.5= 0 then LATB.1= 0 'turn OFF an LED
    goto mainloop
    Louie

  6. #6
    Join Date
    Jan 2009
    Posts
    50


    Did you find this post helpful? Yes | No

    Default Re: 16F1826 cannot get MCLR to act as an INPUT

    SOLVED!! I had a bad LED. All is working now. Sorry for the confusion.

  7. #7
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default Re: 16F1826 cannot get MCLR to act as an INPUT

    In post # 3 you wrote:
    The LED is working if I set PortB.1=1 manually in code...........
    Which is in contradiction with your last post.

    Regards

    Al.
    All progress began with an idea

Similar Threads

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

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