
Originally Posted by
Melanie
If you set the CONFIG for the PIC to handle MCLR internally, then FORGET about MCLR being high or low... it's all handled for you behind the scenes.
Thereafter the pin (that was formally the MCLR pin) is treated as a regular I/O (except that on some PICs it's INPUT ONLY - check with your PICs Datasheet).
If you need the pin to be normally HIGH and it's pulled down by your switch, then you need a PULL-UP Resistor (usually connected between the PIC pin concerned and +5V). Some PICs have internal Pull-Ups you can enable either on a pin-by-pin basis, or globally for an enitire Port. Again check with your Datasheet if the pin you want to use has Pull-Up's available on it - not all pins have them.
If you need the pin to be normally LOW and pulled-up by your switch (not a recommended way of connection - but it will work), then you need a PULL-DOWN Resistor (usually connected between the PIC pin concerned and 0v). You will have to provide one of those yourself externally as the PIC will not provide one internally. Any value between 4K7 and 22K would probably suffice.
Bookmarks