PDA

View Full Version : 18F2431 won't program or erase.



HenrikOlsson
- 25th September 2006, 18:49
Hi everybody,

I got a couple of 18F2431 (samples) I was going to play with. First I realised I had to update my PBP. Then, with that covered I had to update my PicStartPlus firmware. There I discovered that I had to order the PUM-unit from Microchip to retrofit my 1996 model PicStartPlus and now, when I finaly have everything covered they won't program - go figure....

I'm trying to flash it with the MicroCodeLoader firmware 18F2431_20.hex file that from the MCSP\MCLoader\LoaderHEX folder but no matter what I do it errors out on me when verifying, saying that loads of the configuration bits not are what they're supposed to be. As well as some of the program memory locations are bad.

I've tried to erase the device but then when blank-checking it says that it's not blank, Program memory and data memory.

I tested with a 18F4550 and it works perfect with it's corresponding .hex file.

I *would* have guessed it's a bad part if it wasn't for the fact that I've got three and they all acts the same way.

Anybody used this device? Any ideas why it won't program or even erase correctly?

I'm using MPLab7.42 with the latest PICStart firmware.

Thank you in advance for whar ever advice you may have.

/Henrik Olsson.

keithdoxey
- 25th September 2006, 19:51
Is the power supply OK to the PICStart Plus ?

I havent loaded my 4550s yet as the version of MPlab on the machine I was using didnt support them but I will give it a try.

Oops... just noticed you said 2431. I have some 2431s and 4431s so will also try them.

HenrikOlsson
- 25th September 2006, 20:16
Hi Keith,
I haven't checked the power but since the 4550's program OK I'd dare to say it's probably fine. If you get a chance to test your 2431's I'd appreciate it!

Thanks!
/Henrik Olsson.

keithdoxey
- 25th September 2006, 22:52
Hi Henrik

Bad news Im afraid. I updated this machine to MPLab 7.30 and my programmer says PICSTART Plus Firmware Version 4.40.1.

Tried the 18F2431 and 18F4431 and failed with all three chips of each type.

I couldnt find the 4550s after putting them somewhere safe when I tidied up the other day but did find something else that I had lost ^H^H^H^H put away safely :)

Successfully programmed 3 18F4520s with no hesitation.

Now the bad bit. A Googling session gave me the following information....

from http://forum.microchip.com/tm.aspx?m=189398

I have also had trouble programming the 18F2431 on Tech-Tools programmers. They (Tech Tools) have confirmed the problem, but have no solution. They are removing this part from the list of compatible parts from their list. They say that the Microchip programming equipment does not program this part.


from http://forum.microchip.com/tm.aspx?m=107927

The 18Fxx31 and several other devices in this family require the use of a capicitor between Vdd and Vss to slow down the rise time. Some will not Erase, thus will not program if not blank. PM 3 is also subject to this problem.

This workaround can be found in the Readme for PicStart Plus but has been further updated to include other devices that were found to have this problem:

Some devices require that a 0.1uF bypass capacitor be placed
from the VDD pin to the VSS pin of the device to successfully
program the device. If programming failures still arise,
try increasing this value incrementally to a maximum of 10uF.
The parts affected are:

PIC16F737 PIC16F747 PIC16F767 PIC16F777
PIC18F1220 PIC18F1320 PIC18F2220 PIC18F2320
PIC18F2331 PIC18F2431 PIC18F2410 PIC18F2420
PIC18F2455 PIC18F2480 PIC18F2510 PIC18F2515
PIC18F2520 PIC18F2525 PIC18F2550 PIC18F2580
PIC18F2585 PIC18F2610 PIC18F2620 PIC18F2680

For devices such as the 18Fxx31 which have power supply (Vdd and AVdd)
and ground (Vss and AVss), all pins must be used in order for these
devices to program.

Now the REALLY BAD NEWS.....

tried all that and it still didnt work. I started off with a 100nF cap on each set of supply pins and that didnt work so went the whole hog and stuck 4.7uF on each set of pins. At that point I got the following error message when I tried to program.

Program Memory or EEPROM Data is protected. Reprogram
the entire part. If "Auto select memory areas and range"
on the Memory Ranges tab of the programmer settings
is enabled, it must be disabeled before proceeding..

Removing the caps took me back to the original "going through the motions" before failing verification. Decided to go a bit more gently with the caps and used a 1.0uF. Still failed. Added a 100nF as well... still failed.

Decided to go for a 2.2uF and got the "protected" message again.

Reverted to the smaller caps and checked the voltages while programming. 4.97v on one set of pins, 5.01 on the other set. Wasnt sure if this was because only one set were powered and the lower voltage was fed through the PIC so I removed it and attempted to check the voltages.

Without a PIC you instantly get the "protected" message again but I did see a breif change on the multimeter on both sets of pins.

Dont know what to do now :(

keithdoxey
- 25th September 2006, 23:09
For devices such as the 18Fxx31 which have power supply (Vdd and AVdd) and ground (Vss and AVss), all pins must be used in order for these devices to program.

Reverted to the smaller caps and checked the voltages while programming. 4.97v on one set of pins, 5.01 on the other set. Wasnt sure if this was because only one set were powered and the lower voltage was fed through the PIC so I removed it and attempted to check the voltages.


Had another thought after posting that. Maybe the different voltages on the two sets of pins could have been causing a problem so I connected them together and stuck 1.0uF on there as well. Still didnt work :(

mister_e
- 26th September 2006, 04:58
Did you also tried ICSP too?

I have the same problem with PICSTART on this device here too. But not on another programmer.

I'll send a mail NOW to their tech-support to know if there's a known working solution.

HenrikOlsson
- 26th September 2006, 06:25
Wow, thanks for the effort Keith!
Too bad it didn't work, I was hoping I was doing something wrong at my end. I'm a bit suprised that Microchips own programer have problems flashing the device. I'll try the cap aproach here as well to see if I can get it to work, not that I think it will but....

Mister_e,
I did not try ICSP, never used it actually. Please let us know what you find out from the tech support. I may end up contacting them as well If I continue to have problems.

I'd really like to get this chip going....

Thanks again, both of you!
/Henrik Olsson.

HenrikOlsson
- 26th September 2006, 07:44
Hi again guys,
The help file for the PicStartPlus said to put a 1k resistor between pin 7 (AVdd) and pin 11 (RC0) on the 2431 when programing. I did that and now the device erases and blank checks OK. RTFM, RTFM, RTFM..... ;-)

I don't have the bootloader hex file with me at the moment but trying to program a blank file works now! No more errors on config fuses and such. I will try flashing it with the bootloader file when I get home tonight, I'll let you know how it works out.

Thanks again!
/Henrik Olsson.

keithdoxey
- 26th September 2006, 09:12
The help file for the PicStartPlus said to put a 1k resistor between pin 7 (AVdd) and pin 11 (RC0) on the 2431 when programing.

Where did you find that and in which help file ?

I just checked the release notes for 7.40 and 7.42 and the only reference to a resistor is

Programming PIC16F818/819 Devices
When programming a PIC16F818 or PIC16F819, you must add a 1kohm resistor between MCLR and GND. This can be placed in the socket with the device.

However in the 7.42 release notes I noticed the following...

Firmware version 4.50.01 will be available in the near future.

... hopefully that will fix some of these problems.



I did that and now the device erases and blank checks OK. RTFM, RTFM, RTFM..... ;-)

Yabba Dabba Doo :)

Will try it on mine later. Did you just need the resistor or did you need capacitors as well.


There I discovered that I had to order the PUM-unit from Microchip to retrofit my 1996 model PicStartPlus

I wonder if this specific problem is related to early programmers. Mine isnt quite that old but I did once replace the PIC and then later fitted the PUM unit. Not entirely sure when I got mine but the label on the bottom says

10-00157-R9
JIT980123357

So having seen lots of serial number labels over the years I am going to hazard a guess at "Jan 1998" or "1998 Week 01"

HenrikOlsson
- 26th September 2006, 11:35
Keith,
I found the info about the resistor in the file hlpPSPlus.chm in the ...MPLAB IDE\PicStartPlus folder. I tried with only the resistor and it SEEMED to work but I'll try to actually put a real file in it when I get home.

About the age of the PicStartPlus, it says in the same help file that: Some PICSTART Plus of revision R4 or earlier have been known to have problems operating with firmware OS versions 3.11 or later; however, this should not be a deterrent from purchasing a PUM if it is needed.

If a PICSTART Plus fails to work properly after installing a PUM, such as receiving communication errors or the power light will not turn on, it can returned to Microchip for replacement.

Mine is R4 (actually from -97 if your guess is correct) but yours seems to be R9 and the errors we get when programming isn't really what the help file says could be problematic, but who knows....

About this RTFM thing, the info is scattered among so many different places that I'm not suprised I missed it in the first place. There's the PBP release notes and manual, MPLAB release notes and helpfile(s), PICStartPlus help and releas notes, MCSP and MicroCodeLoader help files and release notes, PIC datasheet and reference manuals and.....

Let me know if the resistor works for you.

/Henrik Olsson.

Acetronics2
- 26th September 2006, 12:54
Hi,Keith

Have a look here :http://www.mbtronics.com/picxx.asp

very serious guys ...

Alain

sayzer
- 26th September 2006, 13:29
Hi Alain,

On that link, 12F675 price is 2,70 €.

Roughly, three times more expensive then we have here. I am sure others are also expensive, but I did not check their prices here.

I know that the gas prices are very expensive here but I am surprised that 12F675 is that much expensive in France!


Is it correct or it is for a bundle?


----------------------------------------

keithdoxey
- 26th September 2006, 15:19
Keith,
I found the info about the resistor in the file hlpPSPlus.chm in the ...MPLAB IDE\PicStartPlus folder. I tried with only the resistor and it SEEMED to work but I'll try to actually put a real file in it when I get home.

Thanks Henrik, found it now...

PICSTART Plus Limitations for PIC18F2331/2431
All power supply (Vdd and AVdd) and ground (Vss and AVss) pins must be used in order for these devices to program. PICSTART Plus will handle Vdd, Vss and AVss properly, but you must place a 1kOhm resistor between Pin 7 (AVdd) and Pin 11 in the socket with the device for proper operation. There are other devices that may require the use of all power supply and ground pins. Consult the datasheet if an unexplained programming problem occurs, such as inconsistent programming.

In your original mention of the resistor you said "between pin 7 (AVdd) and pin 11 (RC0)". the help file just mentions "Pin 11" rather than "RC0"

Looking at the pinout of the 4431, pin 11 is actually AVdd so I wonder if the resistor is because power is supplied to the wrong pins. Also the help file does not mention problems with the 4431 which also wouldnt program for me :(

Will experiment tonight.


Hi,Keith

Have a look here :http://www.mbtronics.com/picxx.asp

Thanka Alain but I already have the upgrade fitted.

Acetronics2
- 26th September 2006, 15:39
Hi Alain,

On that link, 12F675 price is 2,70 €.

Roughly, three times more expensive then we have here. I am sure others are also expensive, but I did not check their prices here.

I know that the gas prices are very expensive here but I am surprised that 12F675 is that much expensive in France!


Is it correct or it is for a bundle?


----------------------------------------

Hi Sayzer

This link was only given for REALLY OFF THE SHELF ( Note some humour here ...) Picstart Plus Upgrade ...

My Pics come from Farnell ... or DirectµChip ... if enough to justify the posting !!!

mister_e
- 26th September 2006, 15:55
I confirm the 1K to RC0 + 1uF on Vdd/Vss (ONLY) stuff work

ICSP work as well without any care of the resistor on RC0... just the PGM pin must be loaded to GND.

Well spotted!

Another Picstart problem solved ;)

HenrikOlsson
- 26th September 2006, 19:03
Keith,
OK, I have now tried to program my 18F2431 with the resistor only (no caps) fitted between pin 7 and 11 which is AVdd and RC0/T1OSO/T1CKI on the 28pin parts and I'm happy to report that it works - at least here. I also managed to get the QEI module counting my quadrature encoder, yes....

I added the labels (AVdd & RC0) in my original post because I thought it was strange and I didn't understand what it was supposed to do there. Perhaps it is as as you say that when programming a 2431 power is applied to pin 11 (which is power for 4431) instead of pin 7 and the resistor feeds it to pin 7. But then again, why doesn't your 4431 program? To bad I don't have any to test with, sorry.

Let us know what you find.

/Henrik Olsson.

keithdoxey
- 26th September 2006, 21:24
One is NOT amused :(

What version of MPLAB are you guys running ?

I am on 7.30 and non of the "successful" methods have worked for me.

I have just logged a support ticket with Microchip to see if they have any answers.

HenrikOlsson
- 27th September 2006, 06:28
Hi Keith,
Sorry to hear it's not working for you. I'm using the latest version of MPLAB, v7.42 and the PICStart version is 4.40.01. Do you get the same result as before, even with the resistor/cap? Still can't even erase/blank check it?

Is it on a 2431 or are you trying with the 4431?

When I flashed the 2431 with the MicroCodeLoader .hex file I had to change the config for the brown out voltage. Apparently the BOD was set to on but the trip voltage wasn't specified so it complained about that. Other than that it programed and verified without further problems.

I've searched the docs further but beyond the resistor and/or cap "solution" I haven't found anything. It'll be interesting to here what Microchip says.

/Henrik Olsson.

keithdoxey
- 27th September 2006, 10:05
Sorry to hear it's not working for you. I'm using the latest version of MPLAB, v7.42 and the PICStart version is 4.40.01.

OK. Will download 7.42 and see if that makes a difference


Do you get the same result as before, even with the resistor/cap? Still can't even erase/blank check it?

Everything is identical to the initial attempt at programming. Havent tried to Erase/Blank check. Just tried programming. Will also try that


Is it on a 2431 or are you trying with the 4431? Both, and multiple devices :(


When I flashed the 2431 with the MicroCodeLoader .hex file I had to change the config for the brown out voltage. Apparently the BOD was set to on but the trip voltage wasn't specified so it complained about that. Other than that it programed and verified without further problems.
Yes, I got those messages as well. I initially DISABLED BOD with no success, then I tried leaving it enabled but setting the voltage to 4.2V still no success.


I've searched the docs further but beyond the resistor and/or cap "solution" I haven't found anything. It'll be interesting to here what Microchip says.

I spent a long time googling and searching the mchip forum to no avail.

The only reason I have those chips is because I want them for the QEI interface and now my project has hit another delay just because I cant get the bootloader files into the bloody chips :(

You have now caused me untold grief as I was blissfully unaware of the problem until you suffered from it !! I'm not really blaming you though as I would have hit this problem anyway, its just annoying that both you and Steve have got it to work and I cant :(

keithdoxey
- 27th September 2006, 12:38
Hi All,

just got the following reply from Microchip....

Could you please try out the following when you receive the message:
"Program Memory or EEPROM Data is protected. Reprogram the entire part. If Auto select memory areas and range on the Memory Ranges tab of the programmer settings
is enabled, it must be disabled before proceeding.."

Proceed to Programmer Menu -> Settings
There deselect ( don't select) Auto Memory Areas and Range.
Manually enter memory areas and range as follows:
Program Memory Start Address : 0
Program Memory End Address : 3fff
Select Program Memory
Select Configuration Bits
Select ID Locations
Select EEPROM Data
Select Erase All Before Program

Then try programming. Programming will take a while since the entire memory range is being programmed.

In addition try out the following:
Short the Vdd and AVdd pins of the microcontroller. Also separately short the Vss and AVss pins of the microcontroller. Now connect the capacitor between Vdd and Vss pins.
Ensure that the capacitor that you're connecting between Vdd and Vss is a low ESR capacitor such as tantalum. Start with 0.1uF value and if programming failures still arise, try increasing this value incrementally to a maximum of 10uF.

Will give that a try this evening to see if I get any success.

mister_e
- 27th September 2006, 13:54
I also used MPLAB 7.42 and PicStart 4.40.01 to make i work.

But forget the ZIFF socket and place it on a board normally, load the PGM pin to gnd (via 1-10K resistor) and use ICSP... it will work.

i had this reply from Microchip... but as it wasn't the solution i decided to not post it before.

Thank you for contacting microchip's technical support.

We suggest to make sure the following points to program the PIC18F2431 with picstart plus programmer:

PIC18F8F2431which have power supply (Vdd and AVdd) and ground (Vss and AVss), all pins must be used in order to program.

Devices require that a 0.1uF bypass capacitor be placed from the VDD pin to the VSS pin of the device to successfully program the device.
If programming failures still arise, try increasing this value incrementally to a maximum of 10uF. A low ESR capacitor such as a tantalum

Looking forward to your response.

Woooohoooo! it's just weird that i didn't get the same answer as Keith.

Anyways, ICSP work a treat.

HenrikOlsson
- 27th September 2006, 19:28
Hi Steve,
Could you perhaps explain how you do ICSP with the PicStart? Do you run wires from the ZIF socket or what? I've never done it myself and the other day I recieved some flyers from Microship in the mail, one of them had a table showing the various programmers features and according to that the PICStartPlus didn't support ICSP.

If you would I'd appreciate a quick tutorial on how you do it, what pins, resistors etc? I don't think I'll use in place of a bootloader on the chips that supports it but on the smaller ones it would be great not to have to swap the chip back and forth between the circuit and the PicStart.

Thank you in advance!
/Henrik.

keithdoxey
- 27th September 2006, 20:33
HOORAY !!!!!

I have programmed all my 18F2431s and 18F4431s :)

Here is my response to Microchip support.

Thanks for the suggestions.

I had already tried connecting AVdd to Vdd and AVss to Vss as I noticed that they had slightly different voltages on them (5.01 and 4.97) but that didnt make any difference.

I attempted the "manual" method you suggested but didnt have the option of "Erase all before program" (MPLAB 7.30)

I then upgraded to MPLAB 7.42 and still didnt have any luck with the 2431 so I went to the 4431. Again these failed to program. A blank check revealed that they werent blank and attempts to erase the devices failed. I removed the 2.2uF capacitor and successfully erased it. I then discovered that I could now program these WITHOUT needing the capacitor.

I returned to the 2431 WITHOUT a capacitor but WITH a 1K resistor between pins 7 and 11 as that had been succesful for others on the PBP forum, SUCCESS :)

It would appear that the root of my problem was MPLAB 7.30 as I couldnt program 4431s either. I do need the AVdd connection to program 2431s but since upgrading to MPLAB7.42 the problem seems to be sorted.

Regards

Keith

Note to Steve: I too would appreciate a tutorial on ICSP with Picstart as it is something I have never tried. Having said that, all the PICs I use now have bootloaders but I think it would be a useful to know.

mister_e
- 28th September 2006, 01:17
OK, it's really easy.

1. You need to read your datasheet to find those MCLR, PGD, PGC and Vss pins.

2. place some jumper from the PICSTART ZIFF on the pins# you find and send them on the same pins on your PIC

3. Once the PIC is programmed, just remove the wires.

Not much. The only Extra hardware you have to add, is a 10k resistor+whatever diode on the MCLR pin. If the PGM pin of your PIC is already loaded with something it will work case not, just place a pull-down resistor on it. 10K work great

well it's a variant of something like the following taken on the melabs website...
<img src="http://melabs.com/images/icsp1.gif">

Source and more explanation here (http://melabs.com/support/icsp.htm)

in the past i did few adapter using some 40pins DIP socket. you make 1 of each different pic size (8,18,28,40, etc)

Also handy to use something like...
<img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=163&d=1104851398">

if you want to avoid this 'plug/deplug' dance.

Have fun!

HenrikOlsson
- 28th September 2006, 07:55
Keith,
Glad to here it's finally working, great!!
Let's see what the upcoming firmware does. Perhaps it will let us avoid the resistor. I think we can call this issue resolved, at last.

Steve,
Thanks a lot for the ICSP info, I will try it out next time I'm on a non-bootloader-able PIC.

Thank you both!
/Henrik Olsson.