Solved: Once is Misfortune, twice sounds like carelessness (yep)

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

This is getting frustrating and expensive.

 

I convinced myself I mis-programmed the fuses on a mega 644P for a 20 MHz oscillator see https://www.avrfreaks.net/forum/have-i-bricked-it

 

Nothing was able to resurrect the chip, including applying an external clock.

 

Well I have done it again, with a new chip and new board. the chip literally only has SPI, power, decoupling and the crystal and its capacitors attached (yes they are 22pF).

 

It talked to the AVRISP II fine, then when I programmed the fuses:

 

FSOSC_1KCK_65MS_XOSC_SLOWPWR

 

I am 100% sure this is correct and the most conservative setting for a 20 MHz xtal.

 

The attempt to programme just generated:

 

13:39:35: [ERROR] Failed to enter programming mode. ispEnterProgMode: Error status received: Got 0xc0, expected 0x00 (Command has failed to execute on the tool), ModuleName: TCF (TCF command: Device:startSession failed.)
13:39:36: [ERROR] Execution of command canceled because of previous command failure:

Failed to enter programming mode. ispEnterProgMode: Error status received: Got 0xc0, expected 0x00 (Command has failed to execute on the tool)
13:39:43: [ERROR] Internal error: null sent as device context when trying to tear down programming session.
13:39:47: [ERROR] Failed to enter programming mode. ispEnterProgMode: Error status received: Got 0xc0, expected 0x00 (Command has failed to execute on the tool), ModuleName: TCF (TCF command: Device:startSession failed.)
13:40:15: [ERROR] Failed to enter programming mode. ispEnterProgMode: Error status received: Got 0xc0, expected 0x00 (Command has failed to execute on the tool), ModuleName: TCF (TCF command: Device:startSession failed.)

 

It's me again...

Last Edited: Fri. Mar 25, 2016 - 11:38 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

An "Ext Osc" is a 4 pin device that has vcc and gnd connected and has a clock output pin that connects to xtal1 input on the MPU.

 

An "Ext Xtal" connects to pins xtal1/2 with 22pf caps to gnd.

 

Experienced freaks consult this site for proper fuse settings before burning:  http://www.engbedded.com/fusecalc/

 

We have all done what you have done before, it's where experience is learned!   Congrats, you have earned your white belt!

 

There is a tutorial here on how to "unbrick" your mpu.

 

Jim

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274

 

 

 

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

 

Take an oscillioscope and check the crystal points and see if you have signal.  If you see your crystal frequency then I would guess that you did not program that fuse setting.  But if you did, you  can unsolder the crystal and feed a clock signal int the XTAL1 pin and try fixing your boo boo.

 

I have not looked at the datasheet, but I don't think running the AVR at lo power at 20 mehahertz is a good idea.  Meaning what does the spec read for that Vcc/Frequency combination.

 

JIm

 

 

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB user

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

Update - I've tried squirting a 114KHz 5V p-p square ave into CLK1 and nothing happens.

 

I have checked all connections are correct and for shorts etc.

 

What is worrying is that in both cases the chip signature reads fine on the internal oscillator, but reprogram for a crystal and  dead. I can't see its my aVRISP as it works fine on another board.

It's me again...

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

ki0bk wrote:

An "Ext Osc" is a 4 pin device that has vcc and gnd connected and has a clock output pin that connects to xtal1 input on the MPU.

 

 

jgmdesign wrote:
I don't think running the AVR at lo power at 20 mehahertz is a good idea

 

I'm guessing you are 'AVRdudes' unfamiliar with fuse programming in Studio 6?

 

Xosc in that setup sting means crystal oscillator, not external oscillator

 

slowpwr is slowly rising power at switch on not low power - lots of caps on the board for decoupling as this will be driving steppers.

 

 

The scope isn't showing any signs of life at all.

 

It's me again...

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

Stub_Mandrel wrote:
I'm guessing you are 'AVRdudes' unfamiliar with fuse programming in Studio 6?
Quite the contrary...;I have never used AVRdude, Only Studio.

 

114khz may be too slow.  Can you come up with 1Mhz or 2 Mhz?

 

JIm

 

Edit:

The datasheet only goes up to 16Mhz for low power crystal oscillator mode.  I am not saying that you could not run at 20Mhz, but if you have a slower crystal laying around you could try that to see if the AVR comes back.  But putting a 2Mhz clock into the XTAL1 inout should do the trick.

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB user

Last Edited: Fri. Mar 25, 2016 - 03:28 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have tried a 4 MHz crystal - no luck.

 

It isn't in low power mode its in FSOSC mode (full swing oscillator) which is what is needed for >16MHz crystal or ceramic resonator.

 

Extlofxtal is for low frequency/low power crystal.

 

The fuse choice is SLOWpwr  not LOWpwr!

 

I can try 1MHz, but I suspect it's as dead as the previous chip.

 

I'm more interested in what I am doing wrong than rescuing the chip at the moment - I am 100% sure those are correct fuse options for a 20MHz cryxtal

 

Just tried 1MHz with 4KHz isp still no luck.

It's me again...

Last Edited: Fri. Mar 25, 2016 - 03:56 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Stub_Mandrel wrote:
I can try 1MHz, but I suspect it's as dead as the previous chip.

Remember when you inject that clock, you need to slow down your bit rate.

 

Indeed confusing -- a square wave into XTAL1 pin should sidestep clock selection issues, with crystal mounted or not.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

Oops just edited the above to add: Just tried 1MHz with 4KHz isp still no luck. and crossed your post in the ether.

 

It's me again...

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

What other fuses do you alter at program time? Can you make up a screen shot? Since you are locked out of the AVR you can use Simulator as your programmer so there will not be any errors.

With regards to using SLOW power rise time...does your power supply really come up so slow that you need this option?

Jim

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB user

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

jgmdesign wrote:
With regards to using SLOW power rise time...does your power supply really come up so slow that you need this option?

That is the "safe" option IMO/IME.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

jgmdesign wrote:
What other fuses do you alter at program time? Can you make up a screen shot? Since you are locked out of the AVR you can use Simulator as your programmer so there will not be any errors. With regards to using SLOW power rise time...does your power supply really come up so slow that you need this option? Jim

 

I usually use slow rising power to be on the safe side, I don't think it causes a fail if power comes up quickly. The board has several large caps on it (or going on it) to decouple stepper motors (polulus off the 12V supply).

settings

It's me again...

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

Do you have both vcc and avcc pins tied to vcc power along with both gnd pins tied to ground with bypass caps 100nf to ground placed near the vcc and avcc pins?

 

AVCC must be connected to power for the external xtal to work!

 

Jim

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274

 

 

 

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

Just read the fuses on a MEGA16 to 'prove' the AVRISP.

 

Could my problem be that JTAGEN is set by default? But this only disables four pins on portC

 

Just discovered I had AVCC connected by only an airwire (but not on the previous board). Hooked it up to no effect.

 

 

My worry is that, even if I unbrick the chip, it will just brick again when I reprogram it. :(

It's me again...

Last Edited: Fri. Mar 25, 2016 - 05:00 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is this mounted on a pcb or pluged into a proto board?

 

Can you post a pic of the h/w?

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274

 

 

 

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

On a PCB, so popping it in the STK500 is not a preferred option :-(

 

Trailing white wire was used for injecting a clock -with xtal removed.

 

It's me again...

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

Thanks for the pics, I don't see pin 30 (AVCC) connected to vcc power? 

The external xtal will not work with out power on this pin.

 

 

Jim

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274

 

 

 

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

Of course the XTAL will work without AVCC. PORTA will not work.
Check your pcb for shorted / broken traces.
Check your soldering.
The crystal might be duff, but your external clock would override it. A duff crystal is likely to be inactive or open-circuit.
It is unlikely to be shorted.

David.

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

It was unconnected.

 

That's the manky little jumper wire between pins 30 and 32. Somehow I deleted the trace between the two pins :-(

 

Been over all the traces with a meter, no shorts or O/C.

 

Checked pin assigments

 

Tried with a brand new 4MHz crystal as well.

 

This has me tearing my hair out - I have had exactly the same issue with a different board but using the same layout around the crystal (and AVCC wired up).

 

The first error message I got seemed to suggest that the fuse programming was unsuccessful; - BUT that may have been because it couldn't read them.

It's me again...

Last Edited: Fri. Mar 25, 2016 - 06:03 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

AREF is not VCC, connect pin 30 to your vcc rail!   The Vpot (Power on Reset) circuit is powered from the AVCC pin, if this pin is not supplied power, no worky!

 

 

Jim

 

 

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274

 

 

 

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

ki0bk wrote:

AREF is not VCC, connect pin 30 to your vcc rail!   The Vpot (Power on Reset) circuit is powered from the AVCC pin, if this pin is not supplied power, no worky!

Jim

 

There's a trace joining AREF to VCC, so wiring AVCC to AREF ties all three together.

 

Neil

It's me again...

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

Post #4 says "CLK1", you do mean XTAL1 don't you? 

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

You should not connect AREF to vcc, you should have a 100nf to gnd connected to AREF only.    Depending on how you program the internal ref, you will damage the internal voltage ref circuit with it connected to VCC! 

Ok with both pins high (vcc, Avcc), do you have bypass caps (100nf) on both pins?  These are important.

 

 

Jim

 

 

 

 

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274

 

 

 

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

Oh how embarrassing... XTAL2 was shorted to ground.

 

I couldn't see the short with a loupe and suspected the capacitor. But the beeper never lies so I solder suckered the pins, went over teh space between them with a sharp point, then resoldered carefully.

 

Either a very small copper or solder whisker.

 

Sorry for assuming the crystal traces MUST be ok because they looked OK and wasting your collective time :-(

 

As Sherlock Holmes said "How often have I said to you that when you have eliminated the impossible, whatever remains, however improbable, must be the truth?"

 

 

Now the hard bit - coding!

It's me again...

Last Edited: Fri. Mar 25, 2016 - 06:45 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yea!

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274