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.

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?
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top