PDA

View Full Version : Problem with ICSP & PIC16F628A



Tissy
- 11th March 2005, 20:17
I have a working circuit where i would like to use In-Circuit Serial Programming. I am using MeLABS EPIC Serial Programmer.

Unfortuanatly, i am not getting very far. I have attached a circuit diagram of the ICSP part (main circuitry not shown).

The PIC is a 16F628A.

Has anyone successfully used this combination, if so, what am i doing wrong. Its basically saying the PIC is not detected.

Many thanks,

Steve

BobK
- 11th March 2005, 20:26
Hi Tissy,

I am using the EPIC parallel programmer with ICSP and I used the drawing from the MELABS site that shows 5vdc connected to pin1 of the ICSP connector. I am using this setup on 16F74's. The only thing I have noticed that is different on my ICSP setup is one of the led's on the EPIC board stays on even when I am not programming. I do have my board removed from the normal power source of my product so it only gets its power through the ICSP connector. Try it and see if it makes a difference.

Regards,

BobK.

Tissy
- 11th March 2005, 20:55
Thanks RobK,

I took the 5v line from the EPIC Programmer to the In-Circuit PIC, still no luck.

The prgrammer comes up with the message:

'Target Device does not match selected device'

Do you have to change any settings with the programmer or is it just the same as if the PIC was in the programmer on its own?

I read somewhere that i think you don't supoossed to use the 5v line from the EPIC to power your circuit due to the possible current drain.

Any other ideas? Does your connections look the same as mine. Do you also use only the four lines from the EPIC - Vpp, RB6, RB7 and Gnd.

Many thanks.

Steve.

BobK
- 11th March 2005, 21:13
Hi Steve,

This statement should tell you what is wrong:

'Target Device does not match selected device'

This tells me that the pic you are trying to program is not the same as what you are telling the programmer to program. Make sure the PIC is what the programmer is set for.

Yes the pin layout is the same as I am using. The load on my product is very low so I'm not putting any strain on the programmer.

Regards,

BobK.

Tissy
- 11th March 2005, 21:30
Definately not that. I can put the ZIP adaptor on with the 16F628A, it'll program fine. Take the Adaptor off, put the iCSP lead on, try to program and that error comes up immediately, its as if its not even trying to program. Take the lead off, put the ZIP bag on, programs fine.

Any other ideas, can you send me a copy of your diagram so i can compare the ICSP side?

I've sent you a PM with me emails address if required.

Many thanks.

Steve

BobK
- 11th March 2005, 21:54
Hi Steve,

My ICSP connector is wired as follows:

1-5vdc from EPIC
2-no connection
3-no connection
4-no connection
5-ground
6-ground
7-RB6
8-RB7
9-no connection
10-Vpp

I have a blocking diode between the MCLR pull up 1K resistor to prevent the programming voltage from damaging my circuit. I have another board that has ICSP on it and there I have a VFDisplay data lines on RB6 and RB7 so I put a DPDT toggle switch between the display and the ICSP connector so I don't cause any problems with the display while programming. It works okay also.

I did notice on your schematic that it shows a 16F628 and your posts mention a 16F628A. I'm assuming that this was the only label of the chip diagram being different.

Perhaps this could be of help: (From MELabs help support)

Note for PIC16F62x: RB4 should be connected to ground to prevent interference from the Low Voltage Programming pin.

If you can program through the ZIF but not the ICSP connection them maybe there is something wrong between the ICSP and the PIC.

At this point I'm out of ideas. I know I've had my share of head scratchers lately too!

BobK.

Tissy
- 11th March 2005, 23:34
I thought i was going mad, but a short break solved the problem !!

It was operator error. I messed up the numbering system on the IDC header.

I had the numbering system as


1 6
2 7
3 8
4 9
5 10

When it actually is:

1 2
3 4
5 6
7 8
9 10

It now works perfectly !!

Cheers for your help.

Steve.

BobK
- 12th March 2005, 13:32
Hi Steve,

So the drawing you posted was wrong? You showed:

1 10
2 9
3 8
4 7
5 6

This is also how mine are wired which matches MELabs.

I'm glad you did get it to work though!

It was a great exercise for me.

Have a nice day!

BobK.