This program only works (run one time) when the Pickit 2 is connected. If I disconnect the Pickit 2 the program runs nonstop and regardless of the switch.
I have placed the program in this message and post some screenshots from the schematic.
Thanks for helping me out.


