Go Down

Topic: arduino with debugwire possible? (Read 3525 times) previous topic - next topic

famco

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





westfw

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

famco

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.

Tom Carpenter

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).
~Tom~

famco

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

Tom Carpenter

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.
~Tom~

famco

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

Tom Carpenter

#7
Aug 20, 2012, 04:22 pm Last Edit: Aug 20, 2012, 04:40 pm by Tom Carpenter Reason: 1
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!
~Tom~

famco

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


Tom Carpenter

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.
~Tom~

Tom Carpenter

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.
~Tom~

famco

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

Tom Carpenter

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.
~Tom~

famco

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

famco

Thank you, I didn't saw your picture this morning, because I wasn't logged in   :~
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

Go Up