No announcement yet.

MCLR Screwup

  • Filter
  • Time
  • Show
Clear All
new posts

  • MCLR Screwup

    Well I've never seen me screw up a layout as I have this one. Have the boards already fab'd.
    So one track I'm having some problems modifying is of course the MCLR.
    My question is, if I don't put a pull-up resistor on that line (which would save my ***), will a POR take care of business? I also see there is a pull up internally.
    The PIC is the 16LF1823.

  • #2
    Hi Keith Could you set it to an input, then it takes care of MCLR internally AFAIK. The only problem I found with that is I couldn't get the PIC to reprogram again after the first time.
    Cheers Pete


    • #3
      Yes, I can do that but my concern is having it behave properly, reset wise.
      I also have no idea why you,\'d have trouble re-programming after doing that.


      • #4
        Never had a problem with it not functioning when MCLR is set to input but I`ve found with my MElabs programmer they wont reprogram after the initial programming. I think its more to do with the programmer than anything else.


        • #5
          If MCLR is set as an input and your program sets either the icsp clock or data pins to outputs, then the programmer has no way to communicate with the device and it can't reset to get the pins back. This can lock you out from in-circuit programming.

          If you're forced to do this, a 1000mS pause at the beginning of your program (before the icsp pins are set to outputs) can help because it allows you to cycle power and start the programming process during the pause.

          The chip should run fine with no reset function.
          Charles Leo
          ME Labs, Inc.


          • #6
            Hi Charles
            That explains it, I was wondering how to force the device to allow a reprogram that solves it.

            Cheers Pete


            • #7
              I'm reading now that for this chip (16(L)f1823), there is a "disable /MCLR":

              [I]7.3 MCLR
              The MCLR is an optional external input that can reset
              the device. The MCLR function is controlled by the
              MCLRE bit of Configuration Word 1 and the LVP bit of
              Configuration Word 2 (Table 7-2).
              7.3.1 MCLR ENABLED
              When MCLR is enabled and the pin is held low, the
              device is held in Reset. The MCLR pin is connected to
              VDD through an internal weak pull-up.
              The device has a noise filter in the MCLR Reset path.
              The filter will detect and ignore small pulses.
              7.3.2 MCLR DISABLED
              When MCLR is disabled, the pin functions as a general
              purpose input and the internal weak pull-up is under
              software control. See Section 12.2 “PORTA Registers”
              for more information.
              Attached Files


              • #8
                Charles when you say "the beginning of your program", do you mean the very first line of code?-Keith


                • #9
                  If you're using the internal oscillator and you set OSCCON in your code, the pause should be after the OSCCON setting. Otherwise, the pause time may not be calibrated.

                  So it should be after you set OSCCON and before you change the programming pins to outputs.
                  Charles Leo
                  ME Labs, Inc.


                  • #10
                    Thanks Charles. I think the PAUSE time won't be true on this chip (16LF1823) anyway but longer by 4 times. Can't recall where I had that issue before and Darryl straightened me out on that.-Keith