I was trying to program a PIC microcontroller with MPLabX 5.1 and PICKIT3. I'm having a weird problem. After flashing the program, with PICKIT connected, the MCU works fine but after disconnecting it from PICKIT, making it work standalone, the MCU stops working. I have no clue what's going on. I have previous experience with AVR and new to PIC world. Please help me solve this issue.
Thanks!
Update
MCLR is pulled up, debug bit is turned off in the config file in order to make PICKIT work as a programmer rather than a debugger.
Does work with PICKIT connected, Does not work standalone i.e., with external supply connected with PICKIT disconnected.
MCU is – PIC18LF45K40 (PDIP)
The circuit does not have much going on,Power supply and Pull up resistor is connected and Pin-3 is supposed to give out pulses. Configured to work with internal oscillator. MCLR pin is pulled up with 10K resistor.
Best Answer
You really need to read the help on how to ask a better question.
For best results post a small but complete example application that show exactly how you have initialized your PIC18F45K50 with a simple demo application like a GPIO pin toggle.
A description of this is in your question the only thing missing is how you did your PIC setup.
Creating this kind of example for someone new to Microchips MPLABX tool chain this is an almost impossible task.
Developers that use the Microchip MCC (MPLAB Code Configurator) tool find that the generate code is too complex to post here as an example.
This is the kind of example you should post here:
This is a complete application that has no dependency on any peripheral library code. The functionality described in your question is implemented. Unless there is a fault with how you have wired up your circuit this code should work with and without the PICkit3 connected.