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.

ICSP with P16PRO and 18F452

Status
Not open for further replies.

Andy_123

Member
Hi everyone, need some help.

I am trying to use P16PRO parallel programmer for ICSP with 18F452.
I am using ICPROG software

The way application was designed - it is impossible to bring Vdd (5V) from programmer to the board, so board is powered from the external 5V source (USB port) (always on).

I am connecting MCLR, PGC, PGD and VSS from the P16PRO to ICSP header on the board.

Here what I got so far:
I can erase PIC at 100% rate.
I can write program to PIC at 100% rate.
I can't verify the program - if fails at address 0000h
I can't read the program - some wrong info at address 0000h aqnd rest is FFFF

I am sure this is because my Vdd line is always ON, but need to find solution. Looks like PIC is not reseting properly during "READ"

I tried both high voltage (normal) and low-voltae programming methods with same results. In low-voltage I connected PGM pin to Vdd on the P16PRO.

I am sure programmer is OK, because if I remove PIC from device and inset into ZIF on the programmer - it reads just fine.

Any Ideas?
 
Neither ICProg nor the P16PRO40 are intended for ICSP, which is probably what is causing your problems?. For a start, make the leads from the P16PRO40 to the PIC as short as possible, preferably no more than a few centimeters - decreasing the values of the pullups on the P16PRO40 might also help.

Apart from that it's probably down to design problems - to switch a PIC to programming mode you apply Vdd, then apply 13V to the MCLR pin - this must be within a short specific time (listed in the datasheets), before the clock oscillator has time to start. If the clock oscillator starts you then can't access progamming mode.

One solution is to take the MCLR pin to ground before taking it high, but neither ICProg nor the P16PRO40 are designed to do this. I have seen some clever hardware mods using a small capacitor, transistor, and couple of resistors, that pull the MCLR pin low very briefly as the Vpp line goes high. Basically an NPN transistor from MCLR to ground, with the base connected to the Vpp line via the small capacitor - this pulses the MCLR line low as Vpp goes high. You also need a current limiting resistor from Vpp to MCLR so it doesn't short out Vpp.
 
Thanks Nigel, I think you got it 100% correct:
One solution is to take the MCLR pin to ground before taking it high, but neither ICProg nor the P16PRO40 are designed to do this. I have seen some clever hardware mods using a small capacitor, transistor, and couple of resistors, that pull the MCLR pin low very briefly as the Vpp line goes high. Basically an NPN transistor from MCLR to ground, with the base connected to the Vpp line via the small capacitor - this pulses the MCLR line low as Vpp goes high. You also need a current limiting resistor from Vpp to MCLR so it doesn't short out Vpp.

I found this design at OZPIC programmer on your site and it does the job!!

I know this was a design flaw with Vdd lines and it will be fixed in a later version.
I have to use board ASIS at least for now.

This transistor trick did it and I can write code without taking PIC form the board every time I need make a change.
 

Attachments

  • icsp_209.jpg
    icsp_209.jpg
    42.8 KB · Views: 693
Status
Not open for further replies.

Latest threads

Back
Top