AVR dragon problem

Go To Last Post
54 posts / 0 new

Pages

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

hi,
what is the use of diode in the reset circuit?
what kind of diodes can we use for this reset circuit?

If anybody knows then inform to me.

Last Edited: Tue. Mar 27, 2007 - 06:08 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If the reset circuit has a capacitor and resistor, a diode is often used to discharge the capacitor when the supply is removed. Without the diode, the MCU might not reset properly when power is applied, because of the capacitor holding its charge.

Leon

Leon Heller G1HSM

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

Also, /RESET is one of the pins usually found on a programming connector, to which a production person wearing rubber shoes and a woolen sweater attaches the programming cable. All the I/O pins on the AVRs have ESD protection diodes to GND and VCC to prevent the woolen sweater from killing the device, but /RESET does not have a protection diode to VCC since it must accept 12V HV-programming voltage.

Thus the 1-cent diode from /RESET to VCC.

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

The application note AVR042 is worthwhile reading. It has a section titled “Connection of RESET pin on AVRs”, as well as lots of other good information.

http://www.atmel.com/dyn/resourc...

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

Hi,anybody Please me on this issue.
while i connecting my target to AVRdragon and tried to debugging i got some error message,that is written below.

unable to connect to device .
This could be caused by reset line circutiry or disabled debugWIRE(actually i had not enabled the debugWIRE).
make sure that the reset line is free before continuing.

[]retry debug wire connection
[]use SPI to enable debugWIRE interface.

i selected 2nd option(use SPI to enable debugWIRE).
after clicking ok i got one more message,that is below.

The debugWIRE interface is now enabled.please cycle target power to continue debugging.
you may now disconnet the additional SPI lines.

after clicking ok i got one more msg that is below.

Failed to re-enter DebugWIRE mode.make sure that the reset line is clear.

what can i do for this message?
i had connected 100 ohm resistor to the reset pin in the 6 ISP connection.(in toolkit they mentioned to use above 10K ohm resistor).
i am using 4v power supply to MCU.

is there any problem in reset circutiry?

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

I'd suggest you add that schematic you posted to the other thread here too.

Oh and I'd go back up to post #1, click the [edit] button and change the subject (which appears as the thread title) to something like "Dragon problem / _reset circuit"

Cliff

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

The schematics of my project is attached here.
please let me know if there is any problems with reste circuit.

Attachment(s): 

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

Quote:
i had connected 100 ohm resistor to the reset pin in the 6 ISP connection.(in toolkit they mentioned to use above 10K ohm resistor).

Don't know if you missed K when typing...
If you use 100 Ohm resistor change to 10K

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

Your reset circuit is missing a connection. The junction between capacitor and resistor should also connect to the reset pin/diode/switch junction.

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

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

@Mike B: Thanks. Good document.

@Prabu: I think the anode of the diode needs to be connected to the positive side of the reset cap. I don't think that's what you have on your schematic.

Regards,
Paul

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

hi can anybody help me on this issue.

while i trying to debug the code using AVR dragon .i got a message like"Failed to re-enter debugWIRE mode.make sure the reset line is clear".

I already posted my schematics in this topic.i removed resistor,capacitor and diode in the reset circuit and tried to debugging but i am getting the same message above.

what is the problem with the target?
can anybody help me on this one please.

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

Quote:
Failed to re-enter debugWIRE mode
Have you cycled the power to off and on as requested when enabling the DW fuse?

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

yes,i cycled the power.after that also i am getting the same message.

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

Your reset pin is not right if the diagram is up to date, it needs just a 10K resistor to +5V and no diode or cap for DW debugging. You MUST have a decent pull up resistor on the reset line, I use 4K7 whithout problems but Atmel recomends 10K.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

actually i already changed that resistor to 10k.after that also i am getting the same message.
please help me...

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

the reset line must only have this 10k resistor. nothing else at all. no diodes, no caps, no nothing. also make sure your power capacitor gets empty when you do the switch on-switch off routine.

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

nothing is connected to the reset circuit except 10K resistor.you mentioned that,"also make sure your power capacitor gets empty when you do the switch on-switch off routine.i didnt get which one is my power capacitor.i had already attached my schematics in this post could you please tel me what is the problem?

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

As I said in the old thread the chip starts in ISP mode and needs to have an ISP connection to switch it into dW mode in the first place. I'm guessing that you aren't getting ISP communication. Now that you have removed the rubbish from the _RESET pin can you read the signature bytes from the chip in ISP mode? If not, then, like I said previously, I think that's because you have MOSI and MISO the wrong way round. So switch those and try again.

Cliff

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

by power caps i mean all those "big" capacitors after your voltage regulation. almost every electrolytic capacitor that is. all you have to do is to switch the power back on after a small delay (5 sec would be nice).

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

When doing ISP also make sure the ADE7758 chip which is also connected to the ISP pins can not interfere, as far as I can see its CS# pin is floating. A pullup on that pin may be required.

And about the power cycling: if you are using the battery BT1, did you remove that after you (according to your earlier message successfully?) enabled debugwire before?

Martin.

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

@clawson:actually my Debug wire interface is enabled,the message comes like"The debugWIRE interface is now enabled.please cycle target power to continue debugging.
you may now disconnet the additional SPI lines.
after that only i am getting message like"Failed to re-enter DebugWIRE mode.make sure that the reset line is clear".

And i am using SPI interface to another chip also that is ADE7758.is the problem is because of this SPI interface.(SPI toADE7758)?
@Martin:if want to do DW interface means then should i remove the ADE7758 interface(through SPI)?
And on power cycling i switch off and on the power supply.(i am not connecting any battery at this stage).

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

Well if you succeed in doing dW then the only active pin it uses is _RESET so the SPI device shouldn't be a problem as MOSI, MISO and SCK (also used for ISP) aren't involved in dW

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

My avr dragon would not do ISP right out of the box. Don't have time for this nonsense!

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

outer_space,

Are you sure that wasn't the Studio bug where the ISP frequency would keep revertinfg to 8MHz ?

Cliff

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

Quote:
the message comes like"The debugWIRE interface is now enabled
At that point the ISP connection is still there so it should be easy to double-check if the DWEN fuse is indeed programmed?

Accoding to the mega168 datasheet, debugwire section:

Quote:
Pull-up resistors on the dW/(RESET) line must not be smaller than 10k. The pull-up resistor is not required for debugWIRE functionality.
so you could even try dW without the pull-up: just 1 wire from dragon's reset to mega168's reset (no 100 ohm series resistor like in your schematic, no capacitor, no pull-up) and of course another wire to connect both grounds. Talking about grounds... I see you have 3 separate ground symbols, I assume these are connected together at some point?

I have heard reports of problems when the dW cable is over 30cm long?

Martin.

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

I can read signature bytes .but a warning is comming like"signature does not match the selected device"

And one more thing in connect Dialog menu---> while i am watching the --->fuses,The --->Serial programming Downloading(SPI) option is Highlited with ?(question mark in red color).

what is the problem,can any body tell me please...

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

If you get non-zero signature bytes without any warning that means ISP is still active, the mega168 is not in dW mode. Please check the correct device is selected in the leftmost tabsheet of that dialog. If another device was selected then select ATmega168 and try reading the signature again.

The SPIEN fuse is not accessible in serial programming mode, that is why it is disabled like that. This is normal.

Martin.

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

Quote:
"The debugWIRE interface is now enabled.please cycle target power to continue debugging. you may now disconnet the additional SPI lines.
Let's take it from here. When this happens DO NOT click on the ok button, turn the power off to the target for a few seconds, maybe even measure the VCC to make sure it is down to 0, power up the target and the press OK to the dialog box above.
Do you have a firmware ready to debug? ie are doing a "build and run" or just "start debug"? In either case you must have successfully built code for it to work.
Also the diagram is VERY confusing can you please update it and post it again? For example you seem to have 2 reset set ups (r44 and c18??) and 2 AVCC setups.
Quote:
so you could even try dW without the pull-up:
I would not be too sure about this even if Atmel says so, there was thread a while back where waveform where taken of the signals at the rest pin and din't look too good without the pullup resistor. It may have been an early Dragon of course and there may have been some improvements.
It is always possible that you have a faulty Dragon too.

And by the way once you are into DW mode you CANNOT read fuses or do any other programming job untill DW is turned off from whithin a debug session and revert to normal ISP.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

@martin: I adjusted the ISP frequency and set to 500Khz and read the signature bytes.No matching occurs with the ATmega168,after thet i reduced the ISP frequency to 250Khz and then read the Signature bytes it matches the Atmega168.
so i think its normal in ISP mode. but while i am trying to connect it in DW mode,i can't. the message appears like below.

"The debugWIRE interface is now enabled.please cycle target power to continue debugging. you may now disconnet the additional SPI lines".

after this i had done all suggestions posted here,but i cant Debug the code using DW interface. i got message like below

"Failed to re-enter the debugWIRE mode.
Make sure the reset line is clear"

what's the problem?

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

Now i am getting message like below.

"An device with SPI signature 0x1e7f02 was detected.this device is unknown or unsupported by this version of AVR studio.

Please check the list of supported parts in the AVR Dragon help file or visit www.atmel.com for the latest AVR studio version."

Actually i am using 4.13.528 version.

what is the problem here?

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

Quote:
An device with SPI signature 0x1e7f02 was detected
that middle byte of 7F suggests to me the ISP communication is not reliable. You need a *reliable* ISP connection to change the fuses.

I still think the ADE7758 could cause your ISP problems (of course dW is not affected by this chip, you don't need to remove it). While programming the mega168's SS pin is floating, so is the ADE7758 CS# input. Floating inputs should be avoided. If CS# is high it means its SPI interface is disabled, if it is low its SPI interface is active and Dout (connected to your MISO line) becomes an output, messing up your ISP communication. As I said earlier it could be solved by a pull-up on its CS pin (21). That way its SPI interface is disabled until your program (once you get in dW mode) pulls the SS pin low. Assuming your mega168 is the SPI master this has to be done manually anyway.

Martin.

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

Thanks for your reply,
But some times the spi signature 0x1e0102 was detected.

you said that connect a pull up resistor to SS pin.
whether this Pull up resistor will connect to Vcc?

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

[edit:]

Quote:
signature 0x1e0102
this time the second byte is 01: still an indication of unreliable ISP. The ISP frequency you mentioned looks ok but you could check that setting to make sure it was written to the dragon properly.

Yes, pull-up means to Vcc.

Martin.

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

In my ISP i didnt connect the pull-up resistors to VCC.
is because of this ,the error coming?
please see my schematics for your reference.

thanks,

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

This pull-up resistor should only be on the SS pin, not on the ISP interface signals.

Of course I can not be sure this resistor solves your problem. I think it would eliminate the ADE7758 from the list of suspects.

Martin.

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

prabu wrote:
Twhether this Pull up resistor will connect to Vcc?

There's a clue in then name - a "pull up" always connects to Vcc while a "pull down" always connects to Gnd. (cos it is up to Vcc and down to Gnd)

Cliff

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

I attached 2 ISP circuits to this message,could you please tell me which one is correct ISP circuit?

In Atmega168 datasheets they mentioned that no need of pull up resistor in reset line for DW interface.

Attachment(s): 

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

ISP2 is correct, the values of the series resistors in the ISP1 schematic are too high. In your original schematic you used 100 ohm, that may be ok. Personally I don't use series resistors in the ISP lines.

The pull-up on the reset line has been discussed before in this and other threads. Using a 10k pull-up should not be a problem, I think. My mega168 and dragon setup works fine without it but I don't see any harm in using 10k.

Martin.

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

Thanks,
In ADE7758 datasheets they mentioned like below.

"The CS logic input may be tied low if
the ADE7758 is the only device on the serial bus."

I am also using only ADE7758 to the serial bus.
so if i will connect the pull-up resistor to slave select pin (ss) means what will happen?
will my target connects to DW mode?
reply me as soon as possible please......

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

The point is that the ADE7758 is NOT the only thing on the SPI serial bus is it? Your ISP programmer is another device. So you have to keep the ADE7758 "out of the way" while ISP gets a chance to work. It is "kept out of the way" when its CS line is pulled high. You do this with a pull-up resistor to Vcc. It does mean that in your code, when you want to actually use the ADE7758 you'll need to have some additional code that ensures that a Mega168 port pin connected to the CS line on the ADE7758 is set to 0 while the device is being used. This will drive against the pull-up but will win because it's a stronger drive than the pull-up.

Cliff

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

Thanks,
so if i connect pull-up resistor to slave select(ss)pin means ,my problem will be solved, isn't it?

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

Only you can tell us that - we don't have your circuit to test - you do.

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

clawson wrote:
outer_space,

Are you sure that wasn't the Studio bug where the ISP frequency would keep revertinfg to 8MHz ?

Cliff

I did notice it likes 8mhz, but it wouldn't work after setting it at 125khz. I dont need to fool with any jumpers to make it behave like a avrisp2?

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

MartMega wrote:
[edit:]
Quote:
signature 0x1e0102
this time the second byte is 01: still an indication of unreliable ISP.

Then,Which signature bytes indicates reliable ISP?

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

Quote:
Which signature bytes indicates reliable ISP?
The one for the M168 (1E9406). You MUST be able to read this in ISP mode NOT DW mode repeatedly and correct. Unless this is the case time after time there is no point trying DW.
Quote:
ATmega168 Signature Bytes 1. 0x000: 0x1E (indicates manufactured by Atmel).
2. 0x001: 0x94 (indicates 16KB Flash memory).
3. 0x002: 0x06 (indicates ATmega168 device when 0x001 is 0x94).

ps I just put up on my website a diagram for a circuit with a Mega8 (same pinout as the Mega168) if you need to look at something that works.
http://homepages.chilli.net.au/~ampertronics/download.htm Look at MTERM2, remember that c9 must be removed for DW operation so that just r7 is used in the reset line.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Thanks to all, who are all given the suggestions to me.
After connecting the pull-up resistor to the slave select(ss)pin, i got DW connection.

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

For SPI interface in Atmega168 should it require external pull-up resistors in MOSI,MISO,SCK & SS pins?
or it may be optional?

What is difference between pull-up and series resistors?

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

Series resistors just act as current limiters while pull-up/down resistors affect the default state of a line when it is not being "driven".

Cliff

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

For SPI interface in Atmega168 should it require external pull-up resistors in MOSI,MISO,SCK & SS pins?

or the microcontroller itself having internal pull-up on MOSI,MISO & SCK?

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

Quote:
should it require external pull-up resistors in MOSI,MISO,SCK & SS pins?
No, SPI is a fully driven setup unlike say TWI (I2C) which requires the pull up resistors. If you want to partially isolate the SPI programming pins, you can put 1K resistors in series with Miso, Mosi and SCLK of the other chip but leave the 6 pin header directly connected to those pins. In fact thinking about it you will only need it in the Miso pin so that the output of the AD will not interfere with the programming comms. The Dragon MAY interfere with those pins during debug so you may want to make an adaptor so that after entering DW you will only have +,- and reset pins hooked up.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Can someone - please - guide me; how to emulate ATtiny2313 as an example with avrDragon. I was under impression that full emulation can be done with avrDragon board. I bought 2 of these boards, and no documentation arrived with them - unbelievable . Does anyone knows, what are all those pins and plated holes on the board itself ??? ports ??? can avrDragon fully replace ATtiny2313 on the target board to emulate (as motorola has done with their EVM, EVB boards) or is avrDragon device which facilitates debugging through "not-programmed" AVR device which is all ready on the target board through debugWIRE and or Jtag concept.
If that is the case, can someone please guide me how to a chive that with AvrDragon (including programming).
Does Atmel have real emulators - as motorola did.

I have to add, it is vary troublesome when deciding, to buy any other Atmel's emulator - not to get stuck, because nowhere info can be found. I did not even dream that no info would come with a product.

Anyone with ability to help

Thank you in advance

Pages