Atmega64a. Bad batch? How might I recover?

Go To Last Post
56 posts / 0 new

Pages

Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just delete my posts since I'm a waste of David's time

Last Edited: Wed. Jan 9, 2013 - 06:40 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What is the clock frequency and voltage you are running the chips at?

Are you using the BOD? Is it setup correctly?

Are you using external crystals and set the fuses incorrectly?

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

i love you
you love me
were a happy family
with a great big hug
and a kiss from me 2 you
wont you say you love me 2
i love you
you love me
we are friends like friends should be with a great big hug and
a kiss from me 2 you
wont you say you love me 2

Last Edited: Wed. Jan 9, 2013 - 06:45 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You might start with one of the chips unprogrammed, and read the fuses. Does the programming software try to change the fuses without your being aware of it?

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

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

Quote:
16 mhz @ 5v ....I don't mess with the fuses at all
HUH? How can you run at 16MHz without changing the fuses? And at 16MHz you MUST run at full swing mode for the oscillator (CKOPT checked).

Also you MUST turn off the M103C fuse (unchecked).

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

i love you
you love me
were a happy family
with a great big hug
and a kiss from me 2 you
wont you say you love me 2
i love you
you love me
we are friends like friends should be with a great big hug and
a kiss from me 2 you
wont you say you love me 2

Last Edited: Wed. Jan 9, 2013 - 06:45 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

i love you
you love me
were a happy family
with a great big hug
and a kiss from me 2 you
wont you say you love me 2
i love you
you love me
we are friends like friends should be with a great big hug and
a kiss from me 2 you
wont you say you love me 2

Last Edited: Wed. Jan 9, 2013 - 06:45 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
I think you're mistakenly presuming that I'm building the devices?
Yes, I was mistakenly presuming that.
Quote:
I'm reflashing devices that come to me with fuses already set however they're set.
So you don't know if they were set correctly to start with, particularly the CKOPT fuse.

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

js wrote:
So you don't know if they were set correctly to start with, particularly the CKOPT fuse.

s_mack wrote:
It does run at 16 mhz and the fuses are set appropriately for that (otherwise it surely wouldn't work).

js, would the circuit work @16MHz if CKOPT wasn't programmed?

s_mack wrote:
How would I (or can I) recover from that?

You can make one of these http://mdiy.pl/atmega-fusebit-do... but you'll need an SMD adapter to fit your chip.

Alex

"For every effect there is a root cause. Find and address the root cause rather than try to fix the effect, as there is no end to the latter."
Author Unknown

Last Edited: Sat. Jan 5, 2013 - 09:10 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, you may find that many 16MHz crystals will 'work' without CKOPT. It is unwise though.

It seems absolutely crazy to not read fuses first. Even more crazy to not reveal what programming software you are using.

If the pcb is sensibly built and the ISP (or JTAG) connections are reliably made, everything should work fine. (and users have not hacked the board)

David.

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

i love you
you love me
were a happy family
with a great big hug
and a kiss from me 2 you
wont you say you love me 2
i love you
you love me
we are friends like friends should be with a great big hug and
a kiss from me 2 you
wont you say you love me 2

Last Edited: Wed. Jan 9, 2013 - 06:45 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Don't even dream of unsoldering. Simply attach an external clock to XTAL1 pin. Leave the crystal in-place.

I would certainly read the fuses first. Then restore them to the correct values.

I would always be suspicious of pre-owned boards. There are even instances of AVRs coming out of the Atmel distributors with wrong factory fuses.

I would put my money with js. i.e. missing CKOPT or inappropriate SUT fuses.

I would also be wary of any avrdude GUI. The regular command line should give you correct ERRORLEVEL return values. Using a .BAT file can eliminate typos.

David.

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

i love you
you love me
were a happy family
with a great big hug
and a kiss from me 2 you
wont you say you love me 2
i love you
you love me
we are friends like friends should be with a great big hug and
a kiss from me 2 you
wont you say you love me 2

Last Edited: Wed. Jan 9, 2013 - 06:46 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The simple question still has not been answered:

Are the fuses the same after programming as they were before?

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

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

No, I know that you can solder ok. I am just saying that it is unnecessary. Read Cliff's 'unbricking AVR' tutorial.

You can make a 1MHz external clock with any AVR very easily.

Quote:
The gui is just for pressing buttons. It does show the verbatim output.

What matters is the actual command given to avrdude and its response.

Yes. It would be interesting to see exactly what this is.
Yes. It would be interesting to see what the current fuses contain.

David.

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

i love you
you love me
were a happy family
with a great big hug
and a kiss from me 2 you
wont you say you love me 2
i love you
you love me
we are friends like friends should be with a great big hug and
a kiss from me 2 you
wont you say you love me 2

Last Edited: Wed. Jan 9, 2013 - 06:46 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

i love you
you love me
were a happy family
with a great big hug
and a kiss from me 2 you
wont you say you love me 2
i love you
you love me
we are friends like friends should be with a great big hug and
a kiss from me 2 you
wont you say you love me 2

Last Edited: Wed. Jan 9, 2013 - 06:46 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

i love you
you love me
were a happy family
with a great big hug
and a kiss from me 2 you
wont you say you love me 2
i love you
you love me
we are friends like friends should be with a great big hug and
a kiss from me 2 you
wont you say you love me 2

Last Edited: Wed. Jan 9, 2013 - 06:46 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

My point is that you need to do the fuse read at least once when you start with a new board to understand what is going on. I am willing to bet that after you do this little exercise, it will all be obvious, you can change your procedure, and then get on with life :)

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

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

i love you
you love me
were a happy family
with a great big hug
and a kiss from me 2 you
wont you say you love me 2
i love you
you love me
we are friends like friends should be with a great big hug and
a kiss from me 2 you
wont you say you love me 2

Last Edited: Wed. Jan 9, 2013 - 06:47 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Your fuses look 'quite' sensible. Although I would be happier with a longer SUT (start up time)

I still suspect that your misbehaving AVRs have 'different' fuses.

Sorry. I googled "cliff unbricking avr tutorial" and it was not too good!
Googling "clawson unbricking avr tutorial" got: Cliff's tutorial

You could have just looked in the Tutorial section of this website and found it. Personally, I find google is better for most searches even when you are already on the actual website.

David.

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

Are those the fuse values before trying to reprogram or after?

On the non-functioning ones, can you verify (perhaps with an oscilloscope) whether or not the crystal oscillator is oscillating. You can easily tell by looking at the oscillator output pin, XTAL2 = pin23.

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

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

i love you
you love me
were a happy family
with a great big hug
and a kiss from me 2 you
wont you say you love me 2
i love you
you love me
we are friends like friends should be with a great big hug and
a kiss from me 2 you
wont you say you love me 2

Last Edited: Wed. Jan 9, 2013 - 06:43 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, just looking at whether or not there IS a square wave there would be a big step. If you can estimate the frequency, so much the better.

I unders tand your frustration. One of your biggest challenges (I have it also) is getting over what it SHOULD do. The most positive thing you can do is to determine what IS it doing as a result of the programming.,

Be aware that the fuses are read on boot-up; they (mostly) do not take effect at the instant they are programmed. So, you can program one the way you have been doing, reading the fuses before and after WITHOUT cycling the power or resetting it. If there IS something wrong, you still have a chance to change it. And, that would also tell you what is happening.

As far as not wanting to change procedures, I can understand that, also. However, if these boards came from a different programming environment (say Studio4 instead of Studio6, for example), all bets are off. Likewise if they were programmed somewhere else. This is economic issue and when it comes to that, it is (almost) any port in a storm. You do what you gotta do!

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

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

i love you
you love me
were a happy family
with a great big hug
and a kiss from me 2 you
wont you say you love me 2
i love you
you love me
we are friends like friends should be with a great big hug and
a kiss from me 2 you
wont you say you love me 2

Last Edited: Wed. Jan 9, 2013 - 06:43 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Take a look at the fuse settings in the programming dialog!

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

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

i love you
you love me
were a happy family
with a great big hug
and a kiss from me 2 you
wont you say you love me 2
i love you
you love me
we are friends like friends should be with a great big hug and
a kiss from me 2 you
wont you say you love me 2

Last Edited: Wed. Jan 9, 2013 - 06:43 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

i love you
you love me
were a happy family
with a great big hug
and a kiss from me 2 you
wont you say you love me 2
i love you
you love me
we are friends like friends should be with a great big hug and
a kiss from me 2 you
wont you say you love me 2

Last Edited: Wed. Jan 9, 2013 - 06:43 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You are out of my territory now.

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

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

I always use a GUI when I program MCU's. I usually take a screen shot of the GUI showing the virgin fuse configuration and the fuse configuration when the project is working correctly.
I can come back a year or so later & quickly get the fuses configuration set up again! A picture is worth a 1000 words! :)

Charles Darwin, Lord Kelvin & Murphy are always lurking about!
Lee -.-
Riddle me this...How did the serpent move around before the fall?

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

Quote:
what you mean by "in the programming dialog"?
What sane people use, Studio's programming interface with real Atmel programmers. :wink:

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

i love you
you love me
were a happy family
with a great big hug
and a kiss from me 2 you
wont you say you love me 2
i love you
you love me
we are friends like friends should be with a great big hug and
a kiss from me 2 you
wont you say you love me 2

Last Edited: Wed. Jan 9, 2013 - 06:44 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I suspect that you have bad/intermittent wiring connections.

I can't see any reason to use a -B# greater than -B5. This should cope with any virgin 1MHz chips. -B100 is only ever appropriate for a 32kHz watch crystal.

Yes, I have occasionally received a "avrdude: safemode: lfuse changed!" message. IME, it is best to kill avrdude completely. It generally means that your SPI commands have gone out of sync. Answering 'yes' is guaranteed to do something fatal. Answering 'no' is guaranteed to be almost as risky.

I am quite happy using a GUI like http://www.engbedded.com/fusecalc to choose the fuse settings in the first place.
Then use a command line or .BAT to perform the necessary actions.

I can't see any point in being disparaging about "Bloated software and overpriced hardware."
Surely what matters is "what works reliably".

If you waste an hour of your paid time, it rather rules out the cost advantage of 'unsupported' tools.

All the same, usbasp and avrdude work very well. And allow you to work outside of Windoze (if that is your desire)

David.

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

i love you
you love me
were a happy family
with a great big hug
and a kiss from me 2 you
wont you say you love me 2
i love you
you love me
we are friends like friends should be with a great big hug and
a kiss from me 2 you
wont you say you love me 2

Last Edited: Wed. Jan 9, 2013 - 06:44 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
I can then program them normally without incident provided I set the -B switch to 11 or higher (32kHz or slower).

This implies a problem with hardware SPI. 11 and above uses sofware SPI.

As we have posted before, there is a minor problem with the official usbasp firmware. fixed by clearing the SPI flags at initialisation.

   dummy = SPSR;
   dummy = SPDR;

From memory, it only causes problems with the Tiny1634. Of course, it may give problems with the A chips.

Quote:
I've tried multiple pcs, multiple software setups, multiple programmers...

Have you tried a regular STK500 or AVRISP-2 ?

I remain sceptical. There must be thousands of usbasp devices in regular use throughout the world. We would have heard about any special ATmega64A difficulties. I don't possess a 64A. I do have a regular 128, which programs fine with a usbasp. As do every other tiny and mega that I possess.

David.

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

i love you
you love me
were a happy family
with a great big hug
and a kiss from me 2 you
wont you say you love me 2
i love you
you love me
we are friends like friends should be with a great big hug and
a kiss from me 2 you
wont you say you love me 2

Last Edited: Wed. Jan 9, 2013 - 06:44 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is the anything wired up to the ISP lines? As the M64 uses the USART0 pins is not uncommon that people have a RS232 chip wired up in parallel with those pins which messes up ISP.

I know, I have boards which were purchased by a client for a project which did exacly that!! The newer version of the board has links and a resistor in series with the output of the RS232 chip to prevent problems but I had a heck of a time trying to program the first board I was given until I discovered what was going on.

Worked OK with a parallel port programmer the client had which pumped a couple of hundred mA into those pins but worked very randomly with proper tools.

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

i love you
you love me
were a happy family
with a great big hug
and a kiss from me 2 you
wont you say you love me 2
i love you
you love me
we are friends like friends should be with a great big hug and
a kiss from me 2 you
wont you say you love me 2

Last Edited: Wed. Jan 9, 2013 - 06:44 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I can understand that you need to get to the bottom of this problem.

It does seem very unlikely to be an AVR problem unless they all came from the same batch. After all, they are digital circuits. So they either work or fail.

Crystals can have a range of activity. You can probably detect iffy specimens by disabling CKOPT.

Otherwise, sensible fuses with good ISP connections should be 100% reliable.

David.

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

i love you
you love me
were a happy family
with a great big hug
and a kiss from me 2 you
wont you say you love me 2
i love you
you love me
we are friends like friends should be with a great big hug and
a kiss from me 2 you
wont you say you love me 2

Last Edited: Wed. Jan 9, 2013 - 06:45 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What happens when chip "dies"? Is there a running crystal oscillator?

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

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

It is simple enough to recover.

The first step is to check the data sheet of the particular crystal you are using. Have you followed every rule/suggestion in the Atmel design notes?

You should be able to see how sensitive the crystal is for reliable oscillation. e.g. by varying VCC, CKOPT etc. You can see the results via an OCx pin.

David.

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

Quote:
Nothing's changed. If that were a problem, then it would have always been a problem.
Not necessarily! A BAD design like the one I mentioned above, the CKOPT fuse not being programmed by accident or other, will do the exact things you are experiencing, will work correctly some times and it will not at other times.

But you refuse to accept things as usual. :-) Anyway I think I have annoyed you enough so I'm out.

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

s_mack wrote:
Nothing's changed. If that were a problem, then it would have always been a problem.

You also said there was no way the fuses were being changed, yet here we are.

If you do have a device using the UART lines and that device gets a die shrink or other change, you may or may not know about it. So I wouldn't just assume nothing else has changed.

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

i love you
you love me
were a happy family
with a great big hug
and a kiss from me 2 you
wont you say you love me 2
i love you
you love me
we are friends like friends should be with a great big hug and
a kiss from me 2 you
wont you say you love me 2

Last Edited: Wed. Jan 9, 2013 - 06:42 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
there's a 47uF tant on the reset
hmm I vaguely remember someone saying something about bad board design. :?

It's amazing that your programmers have not blown the reset control pin while discharging such a huge cap!!

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

i love you
you love me
were a happy family
with a great big hug
and a kiss from me 2 you
wont you say you love me 2
i love you
you love me
we are friends like friends should be with a great big hug and
a kiss from me 2 you
wont you say you love me 2

Last Edited: Wed. Jan 9, 2013 - 06:42 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

We currently have 46 messages in this thread.

Several members have spent their time offering advice.

It would be very useful to have a schematic (or honest description) or the circuitry around RESET, XTAL1, XTAL2, DI, DO, SCK.

This is the first that we hear about a 47uF tantalum capacitor. Also the change of crystal part number.

Yes, you can get around some hardware design 'features' in software. And some of them will make no practical difference to 'run' but seriously compromise ISP.

David.

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

i love you
you love me
were a happy family
with a great big hug
and a kiss from me 2 you
wont you say you love me 2
i love you
you love me
we are friends like friends should be with a great big hug and
a kiss from me 2 you
wont you say you love me 2

Last Edited: Wed. Jan 9, 2013 - 06:42 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I would expect 22pF rather than 30pF for a 16MHz crystal, but this should be ok. Crystals vary in activity. I would look up the data sheet for the particular SMD crystal that is used.

A 47uF tantalum is really wierd. This gives a RC time constant of approx 470ms. (the internal pull-up will reduce this. most tantalums have a higher capacitance than nominal. this would increase RC)

I really don't understand what a "r200" is. 0R2 would be 200 milli-ohms. 200R would be 200 ohms. Neither would be very appropriate in a series RC with 100nF.

I doubt if any standard ISP programmer or standard software would work. Perhaps the Chinese manufacturer intentionally made their product 'unusual'.

Now that we can see these 'features', you can understand js's advice.

David.

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

i love you
you love me
were a happy family
with a great big hug
and a kiss from me 2 you
wont you say you love me 2
i love you
you love me
we are friends like friends should be with a great big hug and
a kiss from me 2 you
wont you say you love me 2

Last Edited: Wed. Jan 9, 2013 - 06:41 PM

Pages

Topic locked