Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Programming PIC16F628A using PICKIT2

Status
Not open for further replies.

Ken Ho

New Member
I am using microchip's programmer PICKIT2 to program PIC16F628A but it fails the verification process. And I when blank check the microcontoller, it says it is not blank. Then I read the Program memory and EEPROM and it returns all 0000 instead of 3FFF. I have used the same programmer for PIC16F690 before and it works. Could it be that the microcontroller is dead when I bought it? When I read the manual it says if the Program memory is 0000 it means the microcontroller is code protected but this is a brand new microcontroller I bought from FARNELL. Have anyone experience this before? If you have probably you can shed some light on this issue. Thank you so much in advance.

I have connected the following PINs for Programming
MCLR/VPP
VDD
VSS
ICSPDAT
ICSPCLK
 
if your using old firmware it won't program 628a's.make sure youv'e got the latest.make sure you have code protection turned off in the config fuses because it can't verify what it can't read
 
I have downloaded the latest firmware which is 1.21. And the code protection is unchecked in the programmer. I am not sure what you mean by config fuses. I agree that it can not verify what it can't read but can it be programmed?
 
the config fuses are right at the top of your program here's a sample

processor 16F628A
#include <P16F628A.INC>
__config 0x3F70
; _CP_OFF & _DATA_CP_OFF & _LVP_OFF & _BODEN_ON & _MCLRE_ON & _PWRTE_ON
; & _WDT_OFF

the CP_OFF is the code protection and recheck your icsp connection like eng1 suggests there's a diagram in the user manual
 
#include <p16F628A.inc>
__config (_INTRC_OSC_NOCLKOUT & _WDT_OFF & _PWRTE_OFF & _MCLRE_OFF & _CP_OFF )

yup I just checked. CP is off.

must RB4 = PGM be pulled to gnd? From the datasheet it looks like it is used for low voltage programming only.
 
Ken Ho said:
must RB4 = PGM be pulled to gnd? From the datasheet it looks like it is used for low voltage programming only.

Yes. It better be. See the quote from the following website.

PGM should be low during programming:

The PIC PGM pin is used to enable low voltage programming on some PICs. Even though this is not one of the programming lines and is not connected to the programmer, it should be held low during programming. According to the documentation the PGM input should not matter during high voltage programming, but we have seen cases where it does anyway. A 100K ohm resistor to ground is a simple fix in most cases.
 
Ken Ho said:
must RB4 = PGM be pulled to gnd? From the datasheet it looks like it is used for low voltage programming only.

I suggest you pull PGM (RB4) to ground and also disable the LVP fuse (_LVP_OFF)
 
Last edited:
PIC16F628A programming difficulty

Whilst assisting others with this same problem, I have had the question posed
to me, why should the PIC16F628A be different from the PIC16F628 which does program OK and they both use the same process.
Well I believe that one of the major differences between the two processors , which is not well documented, is that the PIC16F628A is a nanoWatt technology device whereas the the PIC16F628 is not. The inputs will be a much higher impedance and it will be easier for noise on RB4 to cause ut to go into LVP programming mode.
In the PIC16F88 which is also a nanoWatt technology , they are a little more specific about pulling down RB3 ( RB3 used instead of RB4 in F88).

Lee
 
Status
Not open for further replies.

Latest threads

Back
Top