PIC18F628A serial programming help!!

Status
Not open for further replies.
Hi,

I've finally gotten HV programming to work. There was a problem with the a circuit on MCLR. We have an open collector implementation of controlling Mclr via the CPLD. This way we can set it at 5V or the ICD 2 to raise it to 13Vpp for Hv programming. The problem is the ICD 2 was isolated from this open collector tranistor via a diode, and was never able to provide a ground on the nMCLR pin for the PIC. If the open collector transistor was on then nMCL would always see 0V and the ICD2 could not overide it. When it was off, the nMCLR line was pulled to 5V. So I guess when the device was never programmed the 5V to Vpp on nMCLR was o.k to get it into program/Verify mode but after the device was programmed, the code would have already been executing before nMCLR was pulled ot vpp. I've currently removed the 5V pull-up that was connected to the open collector transistor, and by-passed the diode in the circuit so that ICD 2 can provide a ground on nMCLR (on pic pin not header pin). At least this way I can LVP and and HV program (erase part), to try and debug why once I have programed in lvp I cannot get back into lvp mode. Since I can connect know with ICD 2, I've dumped the memory contents to file and the confiugration bits look fine 0x3FAA.
 
"Because PGD and PGC pins have ST (Schmitt Trigger) input with Vil of 0.2V*Vdd and Vih of 0.8*Vdd, the voltage level on theese should be 4V (at 5V Vdd) minimum, but the chance is it will work with 3.3V, no pull-ups are needed."

Apparenlty I need these pull-ups in order to for it (lvp) to work after the first time the device was programmed. I thought that I wasn't entering lvp mode after raising PGM then MCLR but it was because of the missing pull-ups that I was not able to read/write to memory. The weird thing is that it worked with out the pull-ups if the device was erased (so that led me to believe that this wasn''t the problem).

Either way its all working now. Been a frustrating couple of days. Still having flaky behaviour with ICD 2 (hvp) but I'm pretty sure its circuit related on MCLR pin. I depopulated certain parts and that appeared to give more consistent programming results with HV. (prevented lvp though).

Thanks for all your help.... I thought there was no end in sight.
 
recylcing power to lvp device

It seems that after I have lvp the device and pulled nMCLR high to have it run, I need to recycle power to the device in order to get lvp programming to work. Its not a big deal right now just not sure why that is the case? Has anyone had any problems like this?

The state of power up is PGM high and nMCLR (low). Actually wether I have nMCLR low or high doesn't seem to matter (I ran a test where I removed nMCLR (pull-up) on power up). The only scenario I see is that VDD is comming up before PGM and nMCLR when I cycle power, and since I have no control over VDD, I cannot perform this sequence otherwise after the device has been programmed.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…