PDA

View Full Version : ICSP with MCLR as input



Luckyborg
- 4th June 2013, 16:52
I am converting a project into a surface mount version and wanted to add the ability to do ICSP since you never know when you need to update code. I have two 18F45K22 chips and one 12F629 chips. I was able to get the two 40 pin guys working, but the 8 pin is giving me trouble. I have removed all the extra hardware from the circuit that connects to the MCLR line and the data/clock lines so they go only to the header. If I put a blank chip in I can get the ICSP to work once, but have to take the chip out and blank it to program it again in circuit. I believe the problem is related to my setting the MCLR (GPIO3) as an input.

I saw on the melabs website they recommended

TRISIO = $FF
PAUSE 1000
to allow for programming on power up. I went to 5000 just because and had no luck.
My configs are set up as:

#CONFIG
__config _HS_OSC & _WDT_ON & _PWRTE_ON & _MCLRE_OFF & _BOREN_ON & _CP_ON & _CPD_ON
#ENDCONFIG

I have attached the schematic 7002, though I have pulled the LED on the clock line, the resistor on the VPP line and I took out the microchip that is connected to the data line just to be safe.

Thanks for taking a look
David

longpole001
- 5th June 2013, 09:02
try setting _MCLRE_OFF in config to _MCLRE_ON , as it is looking for a digital input

ardhuru
- 13th June 2013, 16:40
If you are using a Pickit2, try enabling the 'Use Vpp first program entry' option under tools; I suspect that should solve the problem, from the symptoms you describe.