system
October 18, 2012, 11:55am
1
Hope I post to the right forum...
In order to be able to debug my programm I have disabled auto reset as described here: (http://www.arduino.cc/playground/Main/DisablingAutoResetOnSerialConnection )
This works BUT hangs when my programm execute the line:
digitalWrite();
I then have to navigate to Tools->Serial Port and choose again my serial port
Then I am able to choose Serial Monitor again and to see the output (arduino doesnt hangs).
I am using UNO v3 connected to http://www.amazon.com/gp/offer-listing/B0057OC5O8/ref=dp_olp_new_mbc?ie=UTF8&condition=new
Any points?
Regards,
Maoz
You have left out a lot of information.
Posting your code always helps
Why do you need to disable auto-reset?
digitalWrite(pin,value) is the correct format, but you are not showing us the PIN or VALUE you use to make it fail.
Debugging is designed to work over the serial connection and there is seldom a case where the reset that occurs creates hassle.
system
October 18, 2012, 12:28pm
3
Thanks for answering
I want to debug my program from time to time. The arduino controls an engine (depends on weather) and I need to see the output from time to time and it should be continuous. If I won't use it then connecting reset my UNO...
Well...
#define UP_OUTPUT 8
#define DOWN_OUTPUT 7
void goUP() {
digitalWrite(UP_OUTPUT, LOW);
delayMicroseconds(100);
digitalWrite(DOWN_OUTPUT, HIGH);
if(debug==1) {
Serial.println("moveUP");
}
}
The last output i see over serial is "moveUP", then if I reconnect (serial port) then I can see it wasn't hanged.
regards,
cmiyc
October 18, 2012, 12:49pm
4
Code snippets are rarely useful.
The problem isn't there. Post all your code.
GaryP
October 23, 2012, 7:33am
5
Enough power, and right way to power up your devices?
Cheers,
Kari
fungus
October 23, 2012, 10:11am
6
maozet:
3) Well...
#define UP_OUTPUT 8
#define DOWN_OUTPUT 7
void goUP() {
digitalWrite(UP_OUTPUT, LOW);
delayMicroseconds(100);
digitalWrite(DOWN_OUTPUT, HIGH);
if(debug==1) {
Serial.println("moveUP");
}
}
The last output i see over serial is "moveUP", then if I reconnect (serial port) then I can see it wasn't hanged.
Seems like a power problem to me. Whatever is connected to pin 7 does something bad when you turn it on.
In general there's no way Serial.println() can hang.
MarkT
October 23, 2012, 10:30pm
7
So the pin controls an engine. That's going to take at a guess a relay? You have separate power for the relay? Proper protection diode?
fungus
October 24, 2012, 9:38am
8
The simple way to find out is to disconnect whatever it is and see if it still hangs.