Panic moment gets resolved

Go To Last Post
30 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I thought this might be worth sharing, FWIW.

I've been programming AVRs via ISP for a few years now, and can't remember ever having any problems. Well, I've got a bunch of prototype boards based on the ATmega48 and I started trying them out last night. Of the first 5 I tried, 3 failed to program and went dead. Definite panic moment.

But then I remembered reading here many times that such problems can often be overcome by supplying an external clock. I programmed up one of the prototype boards to output a square wave of about 500kHz and soldered that clock wire to X1 on each of the boards in turn, after which each board became programmable again. All's well that ends well, etc.

As to what went wrong, I'm not sure, but it may have been my ISP programming connection. The boards have holes for a 6-pin ISP header but I didn't mount one. Instead I made a temporary connection from the ISP cable with a 6-pin male-to-male header, which I put in the holes on the board and tilted with my finger to make contact. I've never had a problem doing this in the past, so I don't know if that was the cause of my comatose AVRs or not.

Anyway, thanks to reading this forum the whole thing was just a very temporary setback. I'd be curious to hear how others handle the ISP connection issue, and the emergency AVR programming clock issue.

Mike

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
which I put in the holes on the board and tilted with my finger to make contact.

I would use something more non-conductive for that rather than a finger. A little too much sweat, or some stray doughnut jelly and ... poof :)

Regards,
Steve A.

The Board helps those that help themselves.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Gads, I never considered the doughnut jelly factor! :)

Seriously, I usually try to push on the plastic cable connector, but I may very well have been getting sloppy and pushing on the exposed pins. I might even try that deliberately and see what happens.

Mike

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Why don't you solder the connector in?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

npat_avr wrote:
Why don't you solder the connector in?

For boards I use in development I do, but for boards that will only get programmed once or twice (I've got nearly a hundred of the latter) it seems like a bother. And as I said, I had never had a problem doing it this way before. If I decide this is an unreliable method then I'll certainly abandon it.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

npat_avr wrote:
Why don't you solder the connector in?

cost, in production.

@kk6gm:
This is what I use.
http://search.digikey.com/script...

Which then solder to a standard 2x3 header and then plug into the ISP cable. The spring loaded contacts work great against the holes on the PCB.

Writing code is like having sex.... make one little mistake, and you're supporting it for life.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Mike,

Others have far more experience than I, but I find it odd than an attempted ISP programming session would mis-set the clock fuse to an external Osc source.

Were they all new chips from a tape/reel?

Any chance you had used them on an STK500 using the STK500's clock, (an External Osc source)?

I have used a temporary ISP male header to PCB holes before, as you described, with good results. If I don't have a good connection I just get an error message, no flaky mis-programming of the fuses.

Odd, also, that all 3 demonstrated the same "failure" mode.

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

For production we always make SMD pads. The boards we then use for development and testing we just solder the connector on top of the SMD pads.

production units that have to be re programmed we made a tool with test pins that are normally used inside in circuit testers, so also spring loaded.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

I find it odd than an attempted ISP programming session would mis-set the clock fuse to an external Osc source

I find it odd too, but looking at the programming instructions makes me think it is not so far-fetched after all.

The chip erase command is AC 80 00 00
The fuse write command is AC A0 00

So there is only a single bit difference between a chip erase and writing the low fuse to 00.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There are spring loaded test pins often called pogo pins that may be used to make a programming fixture. They are available with different points for pads with holes or flat pads. The gold plating and spring pressure results in good contact.

It all starts with a mental vision.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I've been using the "tilting a male header with a finger" method on several hundred boards (mega8's and mega162's)with no problems whatsoever, apart from a few boards where connection wasn't perfect so I had to readjust and reprogram. Never had a board failure like the OP describe.

/Jesper
http://www.yampp.com
The quick black AVR jumped over the lazy PIC.
What boots up, must come down.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

KitCarlson wrote:
There are spring loaded test pins often called pogo pins that may be used to make a programming fixture. They are available with different points for pads with holes or flat pads. The gold plating and spring pressure results in good contact.

Which is basically what I describe above. Mill-Max makes some nice dual row, spring-loaded headers.

Writing code is like having sex.... make one little mistake, and you're supporting it for life.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Glitch!

At one place I was working I saw something like what you link to, but with the addition of two pins that fixed the whole shebang in place. Hard to describe but they looked somewhat like a high quality banana plug (plug consists of 6 to 8 threads, slightly curved and flexing.

The "row" started with one of those, then a number of your spring loaded pins, and then another "banana". On the card was a "mirrowed" row: a hole, a number of pads and then another hole. Into the holes went the "bananas", and the whole shebang stayed there due to the hole being just the right size for the flexiness in the bananas to generate enough friction to stay, but not enough for making them impossible to pull out again.

This arrangement was made for attaching a debug cable to a board with microcontroller/dsp.

To me the advantage seems to be a very low cost per board - as the pads'n'holes are part of the normal card manufacturing process. In this sense similar to a card edge connection scheme.

Anyone seen what I am describing?

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

yeah, I've made ones with retention clips as well so I don't have to hold it in place. Though not exactly as you describe, mine has clips that when squeezed release the connector from the board. But yeah it is nice, as it is a zero cost interface for debugging & programming. When I do JTAG on boards that's what I use. For ISP programming (during development) I typically use the bare 2x6 as described earlier, as the contact only needs to be made for a few brief moments.

What we do for production now, is make test jigs, using those spring loaded headers. It has some guide pins as well. Then all the tech needs to do is drop the board in place and press a button. Testing and programming is then done in an automated fashion.

I like the banana plug retention idea.

http://search.digikey.com/script...

I might just have to use that in the next pass. Only needs 2 ~0.62 holes in the board. :) Thanks for the tip!

Writing code is like having sex.... make one little mistake, and you're supporting it for life.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

DocJC wrote:
Mike,

Others have far more experience than I, but I find it odd than an attempted ISP programming session would mis-set the clock fuse to an external Osc source.

Were they all new chips from a tape/reel?

Any chance you had used them on an STK500 using the STK500's clock, (an External Osc source)?

The chips were all new, but had been programmed once before on the boards via ISP. I had programmed the chips to test them after only the chip and crystal (and associated capacitors and resistors) were mounted, just to confirm there were no problems before completing the board assembly. And every single board programmed successfully at that time. Then I finished stuffing the boards and ran into the 3-out-of-5 failure I wrote about.

Mike

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm guessing the the holes are thru plated that way you can do the tilt the header for contact.

I just tried a little test where I squeezed the rows together with a needle nose just enough so it gives a clamping action. I just tried it on a single sided board with no thru hole plating and it actually made contact with the pads (just one of those proto boards).

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Heres a picture of the header.

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OK, so you're actually able to program with a AVRISP mk II that hangs.. [ducking]

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

UPDATE

I just tried programming 4 more boards, all with headers soldered on. Two programmed and two failed and had to be rescued with my external clock source. So I'm ruling out the "tilted header" as the problem. These boards are dirt simple, with nothing marginal that I can detect, and once programmed they seem entirely reliable.

That leads to a question: is there a correct (and thus also an incorrect) sequence to programming the device fuses and flash?

Mike

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

@Johan,
My wife loves me for the same reason (giving golden oppurtunities-also her nickname for me is the "duck").

@OP
Do you have anything else on the ISP lines (I was going to say hanging but thought better)?

Duck

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

And what is the ISP frequency used ? By default, the mega48's run on internal RC-oscillator with the /8-fuse programmed. Suppose your ISP-freq is 250kHz .... some of the mega48's may be running just 7.9MHz, and fail, where as the other ones running a bit higher will pass.
My guess: your ISP frequency *is* 250 kHz. But it's just a guess ...

Nard

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tricia, and Ulyana. You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

digitool wrote:
@OP
Do you have anything else on the ISP lines (I was going to say hanging but thought better)?

No, nothing. And the ISP programming is done through an STK-500 and the supplied cable. Seems about as by-the-book as you can get.

Mike

Last Edited: Thu. Sep 17, 2009 - 09:36 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Plons wrote:
And what is the ISP frequency used ? By default, the mega48's run on internal RC-oscillator with the /8-fuse programmed. Suppose your ISP-freq is 250kHz .... some of the mega48's may be running just 7.9MHz, and fail, where as the other ones running a bit higher will pass.
My guess: your ISP frequency *is* 250 kHz. But it's just a guess ...

Nard


115 kHz

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Are you supplying power to your boards thru the ISP header or do you have the boards with their own supply ? If the former you might be drawing to much current if your boards have a lot on them. If the latter have you removed the VTARGET jumper ?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
115 kHz
O crap, I guessed wrong then.

Next possibility: too long ISP cable.
No more guessing from my side :)

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tricia, and Ulyana. You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Good to hear you have an STK500.

Configure the STK500 to NOT use the built-in programmable frequency clock source, and TO use the uC's internal RC Osc.

Try reading the uC's signature when you plug several "NEW" chips into the STK500 and see what happens. In theory, they should be running at 1MHz, by their int RC OSC, and read fine. If several chips also don't work on the STK500 then that would point to a batch of mis-programmed / previously used chips... not a problem with your (minimally populated ) boards. Odd.

Although minimally populated, you still need the by-pass caps on the uC, don't forget these.

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Plons wrote:
Quote:
115 kHz
O crap, I guessed wrong then.

Next possibility: too long ISP cable.
No more guessing from my side :)


It's the one supplied with the STK500, about 6" long.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OK (are these char from where)

This is my last attempt at the "guessing game".

See this post and read the OP's second response about not using pullup resistors on the reset line. So my guess is you do not have them on yours.

https://www.avrfreaks.net/index.p...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

digitool wrote:
OK (are these char from where)

This is my last attempt at the "guessing game".

See this post and read the OP's second response about not using pullup resistors on the reset line. So my guess is you do not have them on yours.

https://www.avrfreaks.net/index.p...


10k :)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

what happens if you bring the programming frequency further down ?
How stable is your power supply ?