AVR dragon and Atmega328 problem

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

I've successfully read its signature, and upload a flash led program.But,after that,it cannot get into programming mode anymore.There was a window poped up says something about fuses when I was uploading the first program. The program worked well. But it cannot be accessed since that.Any idea why? I turned the debug enable fuse on.

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

Try lowering the programming speed.

Regards,
Steve A.

The Board helps those that help themselves.

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

Koshchi wrote:
Try lowering the programming speed.

I've tried all the speed levels.none of them worked.

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

Quote:
I turned the debug enable fuse on.
Then go back into a debug session and turn off DW from WITHIN the debug session or ISP will no longer work.

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:
Quote:
I turned the debug enable fuse on.
Then go back into a debug session and turn off DW from WITHIN the debug session or ISP will no longer work.

It says atmel studio cannot start your debug session.reasons are the same when i tried to connect it as isp

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

post some screen shots?

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

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"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, RSLogix user

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

jgmdesign wrote:
post some screen shots?

Actually I can use atmel studio 6 to uplaod codes using F5.
according to js. I probably entered the debug session.How do I terminate it? thanks

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

When i tried to exit debug mode(disable debugWire and exit)

it says
Failed to disable debugWire : Failed to enter programming mode. An error occured while executing command with ID0x1b. ISP command failed.Please cycle target power to restore debugWire moed.

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

Do you have ALL 6 ISP pins connected? It should work.

VERY important to follow the prompts about cycling the power when entering AND exiting DW mode .

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:
Do you have ALL 6 ISP pins connected? It should work.

VERY important to follow the prompts about cycling the power when entering AND exiting DW mode .

f
I do.I can program/debug it.The problem is I can't put it into ISP mode. disable debugWire and close dose not work on mine.I don't know why.

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

hmmm not really sure what happens with AS6, never had any problems with AS4.

Is anything else connected on the ISP lines in case they are getting loaded down?

And in case it helps you may want to try the new AS6.1 Beta if all else fails.

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:
hmmm not really sure what happens with AS6, never had any problems with AS4.

Is anything else connected on the ISP lines in case they are getting loaded down?

And in case it helps you may want to try the new AS6.1 Beta if all else fails.


I guess i mistakenly turned DWEN on.says it kills the chip.i got more chips coming in...i think i'll just leave the default fuses alone

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

No. Nothing will kill the chip not especially the DWEN.. We just have to use that as an opportunity..
The DWEN is set so we can enter the debug mode.. Go into that and access to the fuse and restore the state needed.

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

Do you have a pull up on reset and if so what value? Fo you have anything else connected to reset?

Clancy _________________ Step 1: RTFM Step 2: RTFF (Forums) Step 3: RTFG (Google) Step 4: Post

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

I have exactly the same problem!

until now I used a low cost chinese ISP interface to load my µc. it worked well but I could not make debug!

Yesterday I have try to use my new AVR DRAGON with ATMAGA328p. After connecting the two components I managed to read signature.
This step validated I switch into debug mode! The connection failed and after that it's impossible to switch in programming mode or read signature.

The clock have keep it's configuration because the old version of the code previously uploaded in the µc work properly in standalone.

For me the only thing that could block the SPI is a configuration error of the clock. But in my case it looks ok and the new version of the program has not been sent to the µc!

I tried to contact my µc with my old sensor but the SPI is also blocked. I'm sure my AVR dragon was not damaged because I repeat the process on another card and be the result was identical.

Do the pull Up resistor on RST can definitely deteriorated the μc ISP module?

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

Unsolder any capacitor(s) that is on the RESET line.
Make sure that any RESET pull-up resistor is greater than 10k in value.

Connect all 6 wires from the Dragon's ISP/dW header to your AVR.
Start an AS6 Debug session.

Be happy.

David.

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

Don't know if it's been mentioned...
But also make sure your ISP wires are not way too long.

Try to keep them as short as practical.

-carl

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

Quote:
This step validated I switch into debug mode!
Did it ask you to cycle power on off or just that it could not enter debug mode?

Did you actually go into debug mode with a properly compiled or assembled project?

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

After some tests I can enter in debug mode but it the only solution to communicate with the target. How can I disable DWEN fuse?

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

If I push the "Disable debugWIRE and close" button when i am in debug mode I receive a popup message :

"Failed to disable debugWIRE : Failed to enter programming mode. ispEnterProgMode: Error status receveid: Got 0xc0, expected 0x00. Please cycle target power to restore debugWire mode."

What can I do?

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

Your target AVR must be externally powered for the Dragon to successfully "Disable debugWIRE and close".

Have you actually cycled power and attempted "Device Programming" from Tools menu?

Have you actually removed capacitors etc?
Have you actually used the Debug session? e.g. examined Watches, breakpoints etc.

David.

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

I don't have any capacitor or resitor in my RST line.
The target is powered by the VCC ans GND pin of the dragon.
I tried to cycle power of the target and "Device Programming" but "Unable to enter programming mode."

I don't have any error message when I'm in debug mode. I think the program on the target is different to my project code. When I do a step over the next statement arrow moves incoherently!

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

Quote:
The target is powered by the VCC ans GND pin of the dragon.

Then you can't 'disable' with AS5 or AS6.

If you use AS4 and downgrade the Dragon, then it should disable ok.

Debug mode should work fine in AS4 or AS6. Note that sometimes the source lines won't correspond exactly with your breakpoints. NEVER use 'relax' in the Linker options. Choose -O1 for a more pleasant debugging experience.

David.

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

I actually Use AS6.1 I will try AS4!

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

I have use AS4 with the old USB driver and old dragon firmware.
When I launch debug everythings seems to work good! The good program is present into the target!

When I click on the "Disable DebugWIRE" button on Dragon option, the debugWire seems to be disabled!
=>If I try to configure target with ISP I get a "Entering programming mode : FAILED"
=>If I relauch a debug session AS4 ask me to Enable DebugWire. After the debugWire activation by ISP I have "The debugWIRE interface is now enabled. Please cycle target power to continue debugging. you may now disconnect the additional SPI lines". After the cycle target power the debugging session work good!

If AS4 can set DWEN fuse why I can't entering in programming mode?

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

You should obey the instructions.

1. After enabling DWEN, cycle power.
2. After leaving debugWIRE, do NOT cycle power before the DWEN fuse is cleared by SPI.

(2) fails with AS6 because the Dragon drops the power between 'leaving dW' and 'entering ISP'.

I recommend that you stick with AS6 and simply power your AVR board externally.

All this is fully explained in the Dragon online documentation. And you get prompted too.

David.

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

I have try with a new ATMEGA328p and you right David!
Everything work good!

Thank you everybody!