Jay,thank you for that script.I've kept a copy for further reference.
Alright,let's sum up everything:
It's clear that the default osc config bits are 111,designating external RC oscillator.This puzzles me about why the problem still arises that PIC12F675 will start running on its own preventing ICD2 access.Nigel has been really patient explaining everything for me but I just turned out to be thickheaded.
Having asked so much about what your circuits look like,I would like to put my scheme here in order that it will be easier to locate the cause of the problem.
As you can see from the diagram,target Vdd is set with a jumper,off control of MPLAB.And RA1,RA4 are left unused.I saw Mike's scheme implementing RA1,while in Jay's script,RA1 is not used.This makes me wonder whether RA1 functions in original ICD2.If it doesn't,did Mike modify the firmware to make use of it?BTW,Mike,could you tell me how RA1 in your circuit works?Does it activate RA4 when low and deactivate it when high?If that's the idea,please not that target chip is acting as a pull down resistor too.Even if RA1 is high,the drain current through the chip will still activate the transistor.Or,assume the chip has an extremely high impedance that you can take it as open circuit.You can successfully eliminate Vsd by holding the RA1 high,and nearly no current is supplied through the transistor.Vdd is still on,because you held the drain pin of the transistor high to do this.The target Vdd is already engaged.(Powered from RA1 through R15).I think we may put an combination of several NAND gates to generate such logic.('NOT' first,then 'NAND'output to the base of a PNP or grid of the MOSFET in your sch).Correct me if I'm wrong.
Concerning the access problem of 12F675 may be caused by the Vdd supply controlling circuitry.I added a PNP in my target board as below.The base is connected to RA4,regainning its control from MPLAB.I hoped that it would work.But it disappointed me again.
Is there anything I have neglected that makes the problem remain?People who have programmed 12F675 successfully,please bring me some clue.
Thanks.