PDA

View Full Version : 18F4431 and Melabs USB programmer ?



AndrewC
- 24th March 2009, 14:57
Anyone have unblemished success programming an 18F4431 on a MELABS USB programmer ? Any hints to share ?

I can get 3 out of 5 devices to program, the others just throw programming errors. I've tried adding the infamous capacitor. Melabs are strangely silent when asked for support.

I checked the MC programming notes today and I'm going to check the analog supplies (AVdd and AVss) are connected tonight.

Last other check I threw up searching today was to try programming with MCLR ON ?

Otherwise I guess I'll need to buy a PicKIT 2 ?

Andrew

Darrel Taylor
- 24th March 2009, 19:04
Do you have anything on RB5/PGM?
If it's left floating during programming it can cause problems.

A pull-DOWN resistor will help if it's floating.
<br>

AndrewC
- 24th March 2009, 19:40
Hi Darrel,

I meant to mention that I had tried that as well.
So the analogue supplies are connected, I've tried with MCLRE_ON and _OFF, I've tried with RB5/PGM pulled down to Vss. No joy.

There seems to be a lot of noise floating around the net with people having trouble programming this PIC.

It looks like I might be having to give MC some money :(

Andrew

Darrel Taylor
- 24th March 2009, 20:47
Have you tried the latest version of meProg?

http://melabs.com/support/progsoft.htm (4.3 with firmware)
<br>

AndrewC
- 24th March 2009, 21:06
Yup, 4.30beta and upgraded the firmware to meup54
The "volts" check in meProg shows Vdd = NA and Vpp = 13.18 when I "READ ACTUAL"

Darrel Taylor
- 24th March 2009, 21:30
I found this in the A2 silicon Errata ...
http://ww1.microchip.com/downloads/en/DeviceDoc/80180c.pdf

<img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=3277&stc=1&d=1237929980" />

Not sure if it only applies to the ICD2 or not. But the USB programmer might have a similar problem if it's an A2 chip.

A3 silicon doesn't seem to have the problem anymore.
<br>

AndrewC
- 24th March 2009, 21:51
Sounds plausible, alas I don't think I can adjust Vdd on the USB programmer. What I might do is try and program it using ICSP on a breadboad with it's own power supply.

Andrew

nope - didn't work either

Darrel Taylor
- 25th March 2009, 00:35
nope - didn't work either
Bummer!

I was just reading Melanie's post ...
http://www.picbasic.co.uk/forum/showthread.php?p=71847#post71847

Thought hmmmm,
You have "Erase before Programming" turned on ... right?

So many straws to grab, not enough heads to make straw hats for. :)

Maybe time to break out my virgin 4431 from the parts bin, and try the U2 and PICkit2.
Do you have the original USB programmer or a U2?
<br>

AndrewC
- 25th March 2009, 09:05
Hi Darrell, yes - erase before programming is on. If I read the device after erasing it comes back as 3FFF's , Meprog also correctly recognises the device as an 18F4431,

The programming error I get seems to flip between 0000 and 0018. It seems that sometimes it manages to start programming and then gives up after a few words.

I do have the original USB programmer. My dilemma now is trying to decide:

1) Is it the PIC itself - in which case I might try my luck at complaining to Microchip and getting some replacements.

2) Is it the programmer - in which case I need to decide whether to go to a U2 or a PicKIT

3) Is it the user - in which case I'm going to go and chop up some wood on my bandsaw and then spend several hours planing and sanding it and getting back into equilibrium with my inner self. Or have a few beers and a curry :)

Thanks for your persistence in trying to help me :)

Andrew

mister_e
- 26th March 2009, 01:34
Try few 0.1 uF + 10uF tantalum close to your pic when programming. If you have 2 Vdd, then you use 2 0.1+10uF. PGM pin load to gnd with <10k.

Try to measure the MCLR line, and see if it's high enough... >12 V at very least.

I already had some weird issue in the pas when the PIC programmer was too close of the PIC... weird, but happen.

AndrewC
- 26th March 2009, 10:36
"If you have 2 Vdd, then you use 2 0.1+10uF. PGM pin load to gnd with <10k."

Not sure what you mean - on the Melabs USB programmer there is only one Vdd supplied, i've already got a 0.1uF across that on the programmer board. If I try programming it in-situ on the Melabs X2 protoboard I can use it's own Vdd and it also has 0.1uF Vdd-Vss next to the PIC. Where would you add 10uF ?

I've tried tying RB5/PGM to ground with 10k, perhaps I'll try something smaller.

MCLR is going to 13.2V

Spacing to programmer - I've seen some posts pointing at this. I'm using the short cable supplied by Melabs (<1" ?). I can try making a longer one

My biggest headache is "is it my programmer or my PICS ?". If I could be sure that the U2 programmer works with no problems I'd buy it, or the PICKIT 2, but no answer from MELABS yet. I'll email them again in case they overlooked my first three emails.

Micro chip pointed at the same note the Darrel posted - try playing with different Vdd values but could not tell me what to try and Vdd is not adjustable (to my knowledge) on the Melabs programmer. They didn't seem to buy in to my suggestion that 60% of the PICS they sent me were cxxp and they should give me some new ones. Of course I only bought 5 so I'm not very high up on their priority list :(

What alternatives would you recommend to using the ICSP serial type programmers ?

mister_e
- 26th March 2009, 16:53
PICKIT 2 usually works a treat. But yeah, if it's a silicon related issue, you may end up with the same results. I think Pickit 2 allow to play with MCLR voltage ...

What's your Vdd voltage?

Can you read the Silicon revision of your PIC?

Darrel Taylor
- 26th March 2009, 19:01
I thought trying a new 4431 here might shed some answers ... but I don't think this will help a bit.

I've programmed it here with both the U2 and PICkit2 programmers.
It works everytime no matter what I try.

Unfortunately, I only have one 4431 in my bin.

The Device ID/REV in my chip is 0882. Is yours the same?
(meProg | Program | Get Target Information)


If I could be sure that the U2 programmer works with no problems I'd buy it, or the PICKIT 2
I like the PICkit2 better, but I have several programming adapters and ICSP cables wired for meLabs 10-pin format. So I usually end up using the U2. The PICkit2 has a 6-pin connector and I'm too lazy to make new cables. :o

AndrewC
- 26th March 2009, 21:00
If I read the device I get

Device 0000- 0882
Config 0000- cf00 3f0f 9d3c 0085 c00f e00f 400f
Code all FFFF

Vdd is a nad over 5V.

Got some advice from Melabs and changed the ProgTimes - one off improvement and then none of the pesky things will program.

Went back to the original ProgTimes and now back to flakey results - some good some bad units.
However, they now all program on my X2 board either with the board Vdd or the USB prog Vdd. so the X2 board has a cap right up against Vdd/Vss so I tried that on my ZIF adapter - no improvement.

Verdict - beats me :( At least I've got a work around, that works tonight anyway. I'm wondering if Mister_E's cable length might be the clue ? I'll need to see if I can make a Melabs 10pin cable and try that.

Andrew

tenaja
- 27th March 2009, 05:20
I've programmed a LOT of 18F2331's, all of them with MELabs programmers (I have 3 versions; epic, serial and USB). Here is what I've found:

For ICSP I put in a jumper to disconnect the programming power supply from the rest of the board. That way only the PIC is powered when the programmer is in use. When I unplug the cable, the jumper is put on and the pic gets power from the board.

Today I was programming some DIPs repeatedly, using the MELabs programmer and a zif adaptor. I had to add a jumper to the adaptor, as shown on their web site. (I think my adaptor was almost 10 years old!) Because the chip was being used on a development board, I didn't have the luxury of putting on a jumper. I was not surprised to find the chip wouldn't program ICSP.

A couple months ago I did run in to a couple bad 18F2331 PICs. Some new code worked perfectly on several chips, but on several it did not. I was thankful that I didn't get the faulty chips for the first one, or I would have suspected my code!