Pages: [1] 2   Go Down
Author Topic: arduino with debugwire possible?  (Read 3084 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

I would like to use the debugWire of the mega328 on Arduino Ethernet to do some debugging with AVR Dragon.
I connected the ISP with the dragon and this part seems to work.
Entering debugWire looks ok, but stepping into the code (written with avrstudio and gcc) does not work.

Are modifications on the Arduino Ethernert required to make debugWire run?

Thank you
Peter
 



 
Logged

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 135
Posts: 6782
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Did you enable the debug wire fuse?  Iirc, you won't be able to use the bootloader.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

yes, the fuses ar ok. The bootloader don't mind me at this moment because this time I will make a piece of software without all the good Arduino-stuff. 
Any ideas are welcome.
Logged

Leeds, UK
Offline Offline
Edison Member
*
Karma: 80
Posts: 1728
Once the magic blue smoke is released, it won't go back in!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

If you want, I can give you a copy of optiboot which supports the debugWire being enabled - basically it allows the use of the power on flag to enter the bootloader instead of the Reset pin flag (actually both of them, so it can be used when debug wire is disabled as well).
Logged

~Tom~

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello Tom,
sounds good. But will that solve my Problem?

Should the Arduino-Ethernet hardware (!) work with debugWire without any modification on the board?

Peter
Logged

Leeds, UK
Offline Offline
Edison Member
*
Karma: 80
Posts: 1728
Once the magic blue smoke is released, it won't go back in!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The only thing likely to interfere with the debugWire is the capacitor between the DTR pin and reset. I believe somewhere on the playground there is some information about disabling the autoreset feature.

Once that is done, the only problem is that the optiboot bootloader installed on the atmega chip requires the reset pin functionality to enter programming mode. However I modified optiboot to allow simply turning the power off and on to enter programming mode, which would allow you to disable the reset pin - which is essentially what enabling the debugWire does.
Logged

~Tom~

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello Tom,

i downloaded the schematic from here: http://arduino.cc/en/uploads/Main/arduino-ethernet-schematic.pdf
and it looks like you are talking about C3 (100nF). Can you confirm this?
Unfortunately my hardware knowledge  are relatively underdeveloped. So I could not localize C3 on the board.
It would be great if someone can give me hint.
Thank you very much
Peter
 
Logged

Leeds, UK
Offline Offline
Edison Member
*
Karma: 80
Posts: 1728
Once the magic blue smoke is released, it won't go back in!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I believe it is actually C23, next to the programming header (J4) on the schematic. It is the capacitor right next to the programming header on the circuit board.

Edit:
Correction, C3 as well you are correct. In fact from the pictures on the arduino website, C3 isn't actually soldered onto the board!


* ethernet reset capacitor.png (448.25 KB, 614x458 - viewed 54 times.)

* ethernet reset capacitor.png (65.45 KB, 324x195 - viewed 42 times.)
« Last Edit: August 20, 2012, 09:40:15 am by Tom Carpenter » Logged

~Tom~

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Tom, thank you very much for your help.  J4 would be unused in my configuration because I connect the AVR Dragon on the ICSP.
Do I have to remove C23 ? or can I possible do "something" on the connector J4 ? And whats about C3?
Peter
 
Logged

Leeds, UK
Offline Offline
Edison Member
*
Karma: 80
Posts: 1728
Once the magic blue smoke is released, it won't go back in!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Having set that however, I notice from the schematic that the Wiznet chip's reset is connected essentially to the Atmega chips reset, which means as you try and use debugWire, it will be constantly reseting the ethernet module. That is something which, having looked at the pcb design, cannot easily be changed.

It would require cutting a trace which would also disconnect the reset button at the same time, along with the pullup resistor on the reset pin.
Logged

~Tom~

Leeds, UK
Offline Offline
Edison Member
*
Karma: 80
Posts: 1728
Once the magic blue smoke is released, it won't go back in!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I get what you are doing now. For some reason I thought you were using the J4 header. I which case if you are using an ICSP, then you don't need the modified bootloader either.

You wont need to remove C23 in this case as the debugWire is going through the ICSP header. You need to make sure that the bottom pin on J4 (closest to the ICSP header) is not connected to anything as if it were, then C23 would interfere.

You are still going to need to find a way to disconnect the Wiznet chips reset from the debugWire.
Logged

~Tom~

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Tom,

bad news for me! Looks like I cannot make the changes you developed. On the schematic I see *RESET fro wiznet is connected to RES of the CAT811. Whats about cutting PIN3 of CAT811 ? Would this make ist? And can it done more easly?

Peter
 
Logged

Leeds, UK
Offline Offline
Edison Member
*
Karma: 80
Posts: 1728
Once the magic blue smoke is released, it won't go back in!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

There is a trace you can cut which would require no other modification to components. The only thing you would then need is a pullup resistor on the debugWire - but that is probably included as part of you ISP programmer.

If you are careful about how you cut it, you can repair the cut later if you need to by either soldering the two parts of the trace back together, or adding a jumper wire between the via near to the cut and one of the components on the other side of the cut.


* ethernet reset.png (602.31 KB, 645x466 - viewed 81 times.)
Logged

~Tom~

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks Tom,
can you make a description of the best point to cut the line? Would be a great help for me due my little hardware-knowledge.
Peter
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you, I didn't saw your picture this morning, because I wasn't logged in   smiley-confuse
I will try to make the cut tommorow (today I am very busy ...)
The conclusion for me is, that debugWire should work anyway with the Board, but the w5100 only after making the cut?
Did I understand this right?

Peter
Logged

Pages: [1] 2   Go Up
Jump to: