MCLR is the Master Clear or Reset. Most PIC's have them, although not all PICs have the ability to handle MCLR internally.
For example, the 16F84, 16F872, 16F877 etc etc all need you to handle MCLR externally, whilst newer chips like the 16F628, the 12F675 etc have the additional ability to handle internally and that pin can be otherwise assigned for I/O (although usually INPUT ONLY).
There are times when you have poor supply lines, the PIC cannot Power-Up cleanly. Or there are circumstances when the PIC must power-up AFTER all kinds of other circuits that need to power-up first. In those instances, Power-On must be delayed (so that the external PSU or hardware has time to settle), by holding MCLR down, you in effect 'freeze' the PIC, only releasing it when MCLR reaches Vdd.
If your PSU is well designed, you can dispose of your Resistor and tie MCLR directly to Vdd (or have MCLR handled internally by the PIC if it is capable of doing so, and free yourself another pin for use elewhere). If your PSU is a little shitty, you might need that Resistor and also a Capacitor from that pin down to Vss. The size of the Capacitor will determine the ON delay. Note that some newer PIC's also have programmable On-Delay.
So, in effect, the kind of MCLR you employ is determined solely by your application and it's environment. There is no right or wrong path here. Your experience as an engineer will dictate what should be done under what circumstances.
1. Do I need both a Resistor and a Capacitor, and what size of Cap?
2. Can I get away with just a Resistor?
3. Can I tie MCLR straight to Vdd?
4. Can I use Internal MCLR (MCLR=OFF) and gain an extra I/O pin?
MCLR however must never be used to 'FREEZE' a program and expect it to continue from where it left off on release. MCLR changes internal registers, and when the PIC restarts, it's immediate operating environment will have changed. The Datasheet tells you which registers and conditions are affected.
Melanie
Bookmarks