Author Topic: PIC MCLR circuit help  (Read 7164 times)

0 Members and 1 Guest are viewing this topic.

Offline AlfBazTopic starter

  • Super Contributor
  • ***
  • Posts: 2181
  • Country: au
PIC MCLR circuit help
« on: February 05, 2013, 06:52:17 am »
I'm working with a PIC32 and and didn't want to dick around with a jumper, as suggested in the data sheet, to disconnect the filter cap whenever you wanted to program/debug the thing.

I decided to look at my PIC16 explorer board and see how MC did it. This is the circuit I have deciphered from the user guide's schematic



I think I understand most of it. R5 pulls MCLR high for normal operation, C18 mitigates any spikes that may cause spurious resets, R7 limits current into MCLR pin if it fails, according to data sheet it should be less than 470 ohms but I'm guessing that its high enough to protect any of the programmer/debuggers attemting to pull it high if the Reset button is stuck low.

What I dont get is the diode D1 and R22. FOr some pics, programming the chip involves raising MCLR to a higher programming voltage. In that case D1 will be forward biased but I don't understand why they would want that. For the PIC32 there is no need for a higher programming voltage, its a matter of holding it low, pulsing it high and sending some ascii code to the pgd pin

Does anybody have any clues as to the purpose of D1 and R22


 

Offline AndyC_772

  • Super Contributor
  • ***
  • Posts: 4206
  • Country: gb
  • Professional design engineer
    • Cawte Engineering | Reliable Electronics
Re: PIC MCLR circuit help
« Reply #1 on: February 05, 2013, 07:01:33 am »
At a guess, the diode might be there to protect the PIC in the event that the programmer is set to +5V. No idea about R22, though.

Offline codeboy2k

  • Super Contributor
  • ***
  • Posts: 1836
  • Country: ca
Re: PIC MCLR circuit help
« Reply #2 on: February 05, 2013, 11:27:18 am »
At a guess, the diode might be there to protect the PIC in the event that the programmer is set to +5V. No idea about R22, though.

The diode is definitely there to keep the MCLR line a diode drop above 3.3 volts.

R5, R7 and R22 form a voltage divider which keeps the MCLR pin at about 3.0V. This may or may not
be significant.

R22 could be there as a safety, to provide a path to ground if the 3.3 volt supply is turned off, but there is
still external power applied to one of the JTAG, PICKIT2 or ICD2 pins.

The cap needs to bleed off too (but that's probably not it)







 

Offline AlfBazTopic starter

  • Super Contributor
  • ***
  • Posts: 2181
  • Country: au
Re: PIC MCLR circuit help
« Reply #3 on: February 05, 2013, 12:10:14 pm »
Thanks for your thoughts guys...

I have seen schottkey diodes used in MCLR circuits before but usually to isolate the pin from any toher connected bits from the programming voltage.

I cant see any other purpose for this diode other than what you guys have mentioned. The only other thought is incase a debugger is connected and powered on and it tries to drive MCLR high whilst the board is off, but that doesn't make sense cause I'm sure most microchip debugger/programmers can also supply power.

As for the voltage divider, i was a little concerned about the 3V given the data sheet says the min voltage on MCLRis 0.8VDD, which at 3.3 is 2.64V. I don't quite see the logic of putting a cap in to provide transient supression in an effort to avoid a reset and then go and drop the voltage at the pin so that its closer to the reset value
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf