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
 
Thread Tools Display Modes
Old 15th February 2008, 12:03 PM   (permalink)
Default PIC programming problems

Hi Folks.

I have a problem with programming various types of dsPICs, in a development environment

There seem to be a very limited number of times that the PIC can be reprogrammed.

Has anybody else encountered this problem, and or found a fix, (apart from replacing the PIC)?

Thanks

Roger
rogerjef is offline   Reply With Quote
Old 15th February 2008, 12:34 PM   (permalink)
Default

Quote:
Originally Posted by rogerjef
Hi Folks.

I have a problem with programming various types of dsPICs, in a development environment

There seem to be a very limited number of times that the PIC can be reprogrammed.

Has anybody else encountered this problem, and or found a fix, (apart from replacing the PIC)?
Never used a dsPIC, but the minimum number of times a PIC can be reprogrammed is listed in the datasheets, and is usually well in the thousands - I've never heard of anyone 'wearing one out'.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline   Reply With Quote
Old 15th February 2008, 02:27 PM   (permalink)
Default

You're doing something wrong or foolish if you're wearing out the Flash. Most modern PICs have 100,000 write cycles. What's the application?
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com
blueroomelectronics is offline   Reply With Quote
Old 16th February 2008, 01:26 AM   (permalink)
Default

I've had similar issues. Your programmer connector is not getting a good connection, or if you're doing in-circuit programming, you might have a power supply issue. I've found that with ICP, I have to have the whole system powered up for it to work.
Reuel is offline   Reply With Quote
Old 16th February 2008, 04:17 PM   (permalink)
Default

I have managed to hit the eeprom write limit on a PIC. My program was writing to the same location as fast as possible and after an hour or so that location was stuck.

However, some PICs, such as the 18F25J10 are a lot more limited and have a minimum endurance or 100, with a typical value of 1000.

It is also possible to have a PIC in an application that stops it being programmed. During programming the programmer briefly releases the reset line, and if the program / circuit does something odd immediately, the programmer gets upset.

On one application, we have a power reset that causes a system reboot. We reallocated the pin that drives that between hardware versions. If we program one hardware version with the software of the other, this kicks in immediately, so the power is only on for 1/2 a second at a time. With a 18F25J10 the maximum voltage is only 3.6V so we can't power it from the ICD2. We have to physically disable the power reset before we can reprogram.
Diver300 is offline   Reply With Quote
Old 18th February 2008, 03:16 PM   (permalink)
Default

Thanks guys.

The application is for a rotary steerable down hole tool.

We use a dsPIC30F6015 for our main processor, and a dsPIC30F3010 for the motor controller.

All voltages seem ok, including during programming. I have ,however, Just found that during programming the MCLR\ is going negative by some 1V.

I have just fitted a 100R resistor to limit the current out of the pin during these negative excursion.

Any other thoughts would be appreciated.

Regards

Roger
rogerjef is offline   Reply With Quote
Old 18th February 2008, 03:39 PM   (permalink)
Default

MCLR should be tied to ground with a 4.7K resistor.
Reuel is offline   Reply With Quote
Old 18th February 2008, 03:42 PM   (permalink)
Default

Quote:
Originally Posted by Reuel
MCLR should be tied to ground with a 4.7K resistor.
You mean tied to VDD. 4.7K might be a little low for some ICPs, the PICkit2 recommends 22K.
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com
blueroomelectronics is offline   Reply With Quote
Old 18th February 2008, 04:59 PM   (permalink)
Default

Oops. Yes. VDD. I have a MikroE programmer. 1K - 10K is the suggested range.
Reuel is offline   Reply With Quote
Old 18th February 2008, 05:15 PM   (permalink)
Default

Thanks guys.

I will change the 4k7 that is currently fitted to 22k. We use an ICD2 programmer.

Regards

Roger
rogerjef is offline   Reply With Quote
Old 18th February 2008, 05:19 PM   (permalink)
Default

If it works at 4.7K there's really no need to change it. If you have a hard time getting debug to work then it's worth a try.
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com
blueroomelectronics is offline   Reply With Quote
Old 22nd February 2008, 09:04 PM   (permalink)
Default

Quote:
Originally Posted by Driver300
I have managed to hit the eeprom write limit on a PIC. My program was writing to the same location as fast as possible and after an hour or so that location was stuck.
I didn't know you could program a PIC to reprogram itself.

How did you resolve the issue?

Did you spread the writing across many locations, cut down on the frequency and only wright when the value actually changed.?
__________________
I also post at the following sites:
http://www.stop-microsoft.org http://www.heated-debates.com
Screen name: Aloone_Jonez
Hero999 is offline   Reply With Quote
Old 23rd February 2008, 10:25 PM   (permalink)
Default

You can program PICs to program their own program memory. That is what bootloaders do.

On some PICs, such as pic18F24J10, the only EEPROM is the program memory.

I wasn't actually programming the program space. I was writing to the data EEPROM. That has a larger endurance, but it is still only 1,000,000 or so.

My code wrote to a couple of locations as fast as possible, so about every 2 ms, or 4ms for two locations. That is 250 times per second, so 1,000,000 in 4000 seconds, or about an hour.

My code was faulty. I was trying to get it to write only when the data wasn't correct, but that obviously didn't work. I changed it to write when the data was new.
Diver300 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Latest
problems with programming a pic 16f628a tanilas Micro Controllers 18 29th April 2008 10:46 PM
Quik PIC Programming kit Krumlink General Electronics Chat 5 27th January 2008 11:27 PM
Problems switchin relay with PIC Andy1845c General Electronics Chat 5 17th November 2007 06:13 PM
Question about Inchworm+ Quan Micro Controllers 54 28th October 2007 12:20 AM
Programming PIC to generate square wave elec123 Micro Controllers 11 13th October 2007 01:15 PM



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


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