Guys,
I'm not that expert in arduino. But a fan of it... using mega2560. Made a device that posts some data over the http using the ethernet shield. Now, normally i run it using the USB port for testing and also see the Serial.println(). In my sketch, there are many Serrial.println() though... Now, after development complete, i run it using the 5V regulator extternally. It's running fine... except that i just saw after running for around 3-4 hours, the TX LED is fully turned ON. Even pushing RESET pin didnt helped. When I made a power down and re power, then it's fine till now.
What this can be? And what can be a solution?
PS. This never happened when using serial monitor..
It wouldn't surprise me if that confused the 16u2 on an official board or faithful clone (they have the 16u2 control the LEDs). The fact that it persisted after pressing the reset button IMO is the giveaway here... because that doesn't reset the 16u2.
I do not see any way for the behavior you describe to be generated on a clone that uses a different serial adapter IC. Nothing you can do will hose it so hard that pressing the reset button won't tristate the TX pin and turn off the light (since the light on anything without a 16u2 is an LED + resistor connected between Vcc and Tx, so it lights up when the line goes low).
Grumpy_Mike:
In what way does your post comply with that?
Considering that the matter at hand is the behavior of the firmware on the on-board USB serial adapter, I think it's entirely appropriate here.
Considering that the matter at hand is the behavior of the firmware on the on-board USB serial adapter, I think it's entirely appropriate here.
In the light of that last post do you want to reconsider.
Everything has a reason, things do not just happen at random. It sounds like you might have a memory leak due to poor code. This is not a problem for this section.
I just discovered the code is not running at all... (the way it seems).
This code I dont know why will not run... memory issue i suspected... but then again, i added to check the memory and SRAM was same for more than 2 days... just when I dont use the USB, the game starts... if I use the USB, and put a terminal to read the data sent to PC, it runs for 2-3 days (2-3 days i checked).
I also used serial.flush() at the end of the loop but no luck.
OK, summerize again, reagrdless of the debate whether this should be where (which sub forum):
I when use USB and open a terminal, it runs as serial data is pulled (or pushed) to the PC
I when power the arduino via usb but no terminal opened, and also if powered by 5V directly, both case the issue arises... D13 lights up after say 1-2 hour and code stops running. I though used a serial.flush() at the end of the loop for clearing buffer, and also at the end of the loop there is a code for measuring RAM, RAM i found did not changed (when it was running and i was reading via terminal for serial) even after 4 hours...
Now what this might be and then what should I do??
Do you think the FT232 or CH340 will solve this issue?
Grumpy_Mike:
No.
It is clear from the above comments that you have not much idea of what you are doing, and no idea of what a memory leak is.
So you need to post a schematic of your hardware and post your code it you are to have any hope of solving this.
Serial flush dose not clear the buffer, look up in the referance what it does.
Why are you so hard on me?? I'm a poor newbie trying to solve some issues...