Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
LinkBack Thread Tools Display Modes
Old 17th November 2007, 08:54 PM   (permalink)
Default Odd problem, My program kills pics

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?
__________________
The first rule of mstechca club is do not talk about mstechca club.
http://www.electro-tech-online.com/s...induser&u=1245
2camjohn is offline  
Old 17th November 2007, 08:59 PM   (permalink)
Default

Can you post the code?
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com
blueroomelectronics is online now  
Old 17th November 2007, 11:48 PM   (permalink)
Default

They tell me it shouldn’t happen but check this thread out. http://www.electro-tech-online.com/m...t-working.html
__________________
C:\WHUT ?
Beware the asterisk *
ClydeCrashKop is offline  
Old 18th November 2007, 12:28 AM   (permalink)
Default

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.
__________________
--- The days of the digital watch are numbered. ---

Last edited by kchriste; 18th November 2007 at 12:31 AM.
kchriste is offline  
Old 18th November 2007, 12:48 AM   (permalink)
Default

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?
donniedj is offline  
Old 27th November 2007, 06:28 PM   (permalink)
Default

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
__________________
The first rule of mstechca club is do not talk about mstechca club.
http://www.electro-tech-online.com/s...induser&u=1245
2camjohn is offline  
Old 27th November 2007, 06:30 PM   (permalink)
Default

Quote:
Originally Posted by 2camjohn
It is strange that MPLAB wouldnt erase them anyway seeing as I was telling it to ignore all the errors.
Yea what does MPLAB know
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com
blueroomelectronics is online now  
Reply

Bookmarks

Thread Tools
Display Modes



Similar Threads
Title Starter Forum Replies Latest
Help with problem programming 16F628A ukatv Micro Controllers 8 25th September 2007 09:23 PM
Newcomers, please read! (PIC regarded) Upd. 0xD Jay.slovak Micro Controllers 0 17th April 2005 02:05 PM
Problem; Random pic performance timothyjackson Micro Controllers 7 19th February 2005 07:20 PM
Program Address for 16F628A johnnyquest Micro Controllers 1 11th January 2005 07:47 PM
Big thermocouple ADC problem Oznog General Electronics Chat 9 4th May 2004 09:42 PM



All times are GMT. The time now is 12:52 AM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker