Resetting a PIC with MCLR

Discussion in 'Embedded Systems and Microcontrollers' started by jj_alukkas, Aug 5, 2011.

  1. jj_alukkas

    Thread Starter Well-Known Member

    Jan 8, 2009
    751
    5
    I have my PIC16F628 on a breadboard connected to pickit2 on USB.. Sometimes I need to quick reset the PIC without going to pc and holding it in reset. I know this can be done with MCLR pin to ground, but is it safe to short MCLR to Gnd when PICKIT itself is holding it high, like when running a code?? I would like add a micro switch so that it can be quick reset when needed. Help please?
     
  2. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    You can control this from MPLAB. It is on the programmer toolbar. They are named "hold in reset" and "release from reset" I think. Then developing I use this method works fine.
     
  3. debjit625

    Well-Known Member

    Apr 17, 2010
    790
    186
    If your mcu is connected to PICKIT don't do it.
    In your own circuit you can do it to reset the mcu,but microchip suggest using a small resistor like 100 ohms from MCLR to Vss for reset.

    Good Luck
     
  4. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,386
    1,605
    AFAIK MCLR from a PicKit is an open collector drive, so yes it is safe to ground at your device for reset.

    This is based on my excellent yet occasionally quite fallible memory, I will be in the office in an hour or so the double check off the PicKit 2 users guide (it has a full schematic in the back ya know).

    Edit: Yep, it is just a pull down transistor thru a 100 ohm resistor. Obviously don't short for a reset when programming or you will blow some stuff inside the PicKit.
     
    Last edited: Aug 5, 2011
    jj_alukkas likes this.
  5. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    Also note that Microchip have some design guidelines regarding reset circuits connected to the MCLR pin. If not done correctly the PICKIT programmer may not work. You will find this in the PICKIT manual.
     
  6. jj_alukkas

    Thread Starter Well-Known Member

    Jan 8, 2009
    751
    5
    At present I am using this but sometimes while triggering input switches sitting at the test board, I feel it would be easier for a hardware micro switch in hand.

    Yes, its wired to the collectors of a 2N3904 and 2N3906, so it must be safe.

    Since its a collector drive as ErnieM said, I think its safe on the PICKIT side, and most PIC projects I have seen have a reset using MCLR pin, so I hope it wont be a problem. And yes, I plan to do it through a 100-330ohms resistor.

    EDIT : I just tried a reset by MCLR to Vss through a 100 and 330 ohm resistor, it didnt get reset. without the resistor it worked well!!

    Thank you all!!
     
  7. debjit625

    Well-Known Member

    Apr 17, 2010
    790
    186
    May be their is already a pull up resistor so with the 100 ohms pull down resistor you are creating a voltage divider circuit and as a result at the MCLR pin you are not providing a logic low...

    Good Luck
     
  8. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    Put a 1k resistor between MCLR and the output of the PICkit programmer.

    Then use your pushbutton from MCLR directly to ground.
     
Loading...