I'm working on my first project with PIC18F4620. I'm using Dataman 48pro2C programmer and it's software. I'm using 5 pin header to connect the microcontroller to the programmer. The pins are VPP, GND, VDD, PGD, PGC. I uploaded other code to the microcontroller before but I had to remove the header and reconnect it. (I connected the header directly to the microcontroller with jumper cables because I forgot to add the programming pins to the PCB) Now whenever I try to upload the code, I get this error:
I don't think I made a mistake when connecting the pins, I checked them many times. And I don't think the problem is bad device either. Because when I power up the circuit with the old code it works fine.
My questions are:
1- Should I try to upload the code while the circuit is powered up? (I just tried without voltage input)
2- VPP pin is connected directly to the header, without any resistor. It worked that way before but should I put a resistor in between microcontroller and the header?
3- Could there be any other reason why microcontroller can't connect? Thanks
I color coded the jumper cable locations: (Please ignore the 16F877 label)


