Electronic – PIC18F44K22: Can’t use MCLR/RE3 pin as input. MCU resets when RE3 is held down

picpickitreset

I'm trying to use the 4-bit wide PORTE on a PIC18F44K22 MCU. This port contains the RE3/MCLR pin which can be configured as a reset pin or as an input pin by setting/clearing the MCLRE bit on CONFIG3H.

No matter what value is set on the MCLRE bit, if the RE3/MCLR pin is held LOW, the MCU refuses to execute any instruction. Setting the RB3/MCLR pin up and the MCU works as expected (with one less onput pin).

This has been tested using a pickit 2 programmer and a multimeter, powering the MCU with the programmer itself. power pins on the MCU are decoupled using 1pF capacitors and an aditional 22uF capacitor on the board power input.

BOR is disabled and the program loaded is as simple as it can posibly be (set RB3 UP). Tested using both 5V and 3.2V

I have read of ESD ocasionally triggering resets but in this case is a low value keeping the device on reset.


Solution:
For MCLRE to have any effect, LVP bit must be disabled. In gpasm:

    CONFIG MCLRE  = INTMCLR
    CONFIG LVP    = OFF

Best Answer

If you haven't disabled "Single-Supply ICSP Programming" in your config bits (CONFIG4L.LVP) then this would explain the behavior you're seeing.

Section 24.9 of the datasheet reads "While in Low-Voltage ICSP mode, MCLR is always enabled, regardless of the MCLRE bit, and the RE3 pin can no longer be used as a general purpose input."