Odd problem, My program kills pics

Status
Not open for further replies.

2camjohn

Member
Ive run into a strange problem with some code on a PIC18f1320

After I program the chip with a particular code (just a test program that flashes LEDs etc), the pic can no longer be recognised by the programmer.

The test code works as it should, but once programmed MPLAB cant recognise the chip anymore. So now I have accumulated several chips and boards (with soldered on chip), that are stuck with this flashing LED software.

It does the same thing with a fresh DIP package PIC18f1320 in my ICD2 programmer.

My hardware works fine with other code.


I want to look into the software, to see what the problem is, but im confused as to whats going on below the surface. My questions are:
#1 How is this behaviour possible?

#2 How can I restore the chips?
Ive tried erasing, and reprogramming through MPLAB, and just skipping past all the errors but that doesnt work.
Can I just stick the programming voltage into the MCLR pin to erase the chip?
 
If you've programmed the PIC so that it uses the internal oscillator AND have programmed the MCLR pin as an IO you'll have this problem. This is because the programmer will no longer be able to reset the PIC or stop the oscillator before entering programming mode. Usually MPLAB will warn you about this when you configure the PIC in this way. I think there is a mod for the ICD2 so that it switches Vdd to the PIC so programming can be entered before the internal oscillator can run.
 
Last edited:
True MPLAB warns but you may still bypass the warning and program the chip.
Having internal oscillator and MCLR pin as an IO is the bulk of PIC usage. Microchip as a company would have never grown to the level they are now if this condition was a blockade. A.K.A flash not being flash.


Send code if you would like, I wish to try this myself. What is the warning, and do you have all warnings disabled from Programmer->Settings->Warnings?
 
Hey Guys,

Just got chance to reply.


The link provided by ClydeCrashKop pointed me in the direction of timer1 which was indeed misconfigured.


It is strange that MPLAB wouldnt erase them anyway seeing as I was telling it to ignore all the errors.


Thanks to all.
John
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…