toodles said:
Isn't the MCLR line pulled low by ICSP programmers/debuggers? Wouldn't that make a short between Vdd and Vss if there's no pull up resistor?
It's pulled to a special high voltage high- way above 5v- for
programming. If in-circuit, we put a 10k resistor in there so the pin can be pulled up to what- 12V- so only 0.7mA of current pulling up the 5v rail which won't be enough to either load down the high voltage source or pull up the 5v rail.
You omit that 10k, the programmer's MCLR pin goes straight to the 5V rail and it could raise the Vdd voltage and cause a latchup or magic smoke, but generally programmers are made so the MCLR can only put out a few mA at most and thus usually the hv source will drag down before dragging the Vdd up. So, no ICSP without a resistor!
Usually when we disable "MCLR on pin", it's because we're out of pins and need to use the MCLR pin for something else. Well, we make MCLR an output to an LCD's data bus, holy cow when I put on an ICSP cable I'm putting 12V on that pin which is still wired to the LCD which tolerates 5v tops. It'll damage the LCD, I can never do ICSP with this. Or say I've got an external ADC chip and hook up its SDO to the MCLR, so MCLR is an input. Guess what, that 5v ADC isn't going to appreciate 12V applied to its output either, that's a limitation many people may not realize at first. Anyhow the ADC will probably be trying to drive the line to 0v or 5v any time it's powered up, won't work with ICSP, or maybe you can ensure it's in tristate (SPI can usually be disabled to tristate) but the presence of 12V on the ADC output is probably gonna damage the ADC.
On the other hand, maybe I'm gonna hook up a user's button (not a reset button)- the pin has a 10k pullup and pressing the button grounds it. Look here- that's sweet! As long as the button isn't pressed during programming this IS compatible with ICSP.