Pickit3 help

Thread Starter

kirayamato_143

Joined Jan 23, 2011
59
hi , anybody know how to connect pickit3 icsp pins in programming 16f628a, please help me but im also searching the net, please an schematic of the design will be much helpful
 

thatoneguy

Joined Feb 19, 2009
6,359
For 16F627/627A/628/628A
Pin 1 (Arrow on PICKit 2/PicKit 3) to MCLR/Vpp (uC Pin 4, RA5)
Pin 2 Vdd/V+ (uC Vdd Pin 14)
Pin 3 Ground (uC Vss, Pin 5)
Pin 4 PGD (uC RB7/Pin 13) Programming Data
Pin 5 PGC (uC RB6/Pin 12) Programming Clock

RB6 and RB7 as Clock and Data are fairly universal for the PIC16 series, exceptions are the enhanced PIC16, such as 16F690, and a few others.

MCLR is the pin that gets the higher voltage pulse to put PIC in programming mode.
V+ and GND are power
So, Programming only uses 2 uC pins, which can also be used as standard I/O if there isn't a capacitive/inductive load on the pin, and there is at least a 10k resistor between the pin and what it is connected to. If building on a PC board, you can add jumpers to disconnect loads from RB6 and RB7 during programming to simplify.

Read the Microchip ICSP App Note, as well as the documentation that came with the PIC Kit 3, and the Datasheet for your uC.

Programming on a breadboard is simple, just run lines to a 5 pin header in the order above and it is good to go.
 

thatoneguy

Joined Feb 19, 2009
6,359
You should have a 100nF/0.1uF bypass capacitor between Vdd and Vss

Your schematic doesn't show the Vss, Vdd or Ground pins, only ground connection is to the capacitors on the XTAL oscillator, which is correct, but the schematic is incomplete.

If you have it hooked up as shown, Add the connection between Vpp/MCLR using the image above, 10k for the resistor and 0.1uF for the capacitor, any small signal diode will work, but is required, as the programming voltage is 12V, and that can't be fed back into the circuit. Typically, a momentary switch is put across the 0.1uF cap on the MCLR/Vss connection for a uC reset button. That switch isn't shown in the diagram I've provided. MCLR should be tied to Vss with a 10k resistor, otherwise the uC will be in continual reset. Check the image in my previous post.

What errors do you get when you attempt to program the PIC ? Is MPLAB recognizing your PICKit 3? Is the PICKit 3 recognizing the 16F628A?

Or did programming work fine, but debugging isn't going great?

Finally, is it a Microchip Made PicKit 3 or a clone? Once the wiring is correct, most issues with programming and debugging are due to the use of clone PICKit 2/3 programmer/debuggers.
 
Last edited:

t06afre

Joined May 11, 2009
5,934
What is your problem Kirayamato_143. Can you tell us if you still have problems. If you can connect to your chip, program and then verify. That your hex code is correct in the PIC. The problem may be in your code.
 

Thread Starter

kirayamato_143

Joined Jan 23, 2011
59
@toneguy i followed your schematic, tried to use external supply,then powered by the pickit3, put a bybass capacitor between Vdd and Vcc and still the error is the same
@ to6afre my software can communicate with the pickit3 but no with the target device in my breadboard but works fine with my demoboard im using both mplab and pickit3 programmer
these are the errors:
@mplab
Programming...
The following memory regions failed to program correctly:
Program Memory
Address: 00000000 Expected Value: 00002830 Received Value: 00003fff
Programming failed
@pickit3 programmer
unknown device detected
 

takao21203

Joined Apr 28, 2012
3,702
There are these days when I get this error for 3 hours...

There are some things that can be tried!

-Check wires for correct orders
-Attach LEDs + 4.7K directly on PIC, which should flash during ICSP
-Check for MCLR resistor
-Restart the computer
-Check Vdd/GND with Ohm meter directly on PIC

If you tried all this and no result, try a different PIC chip.
 
Top