Force reset of Arduino mega 2560

Hello forum,

I was looking at some old posts and I wanted to ask a few questions because I was unable to reply to those posts. I am trying to find a way to force reset my Arduino without unplugging the Usb cable. I found that I could either cut the Vcc on the Usb cable so that when I remove the external power supply it will not be powered by the usb cable. I also found that I can remove F1 on the Arduino which should work similarly to cutting the Vcc on the Usb cable just that way it seems like I would have less issues with the voltage drop in the cable. I just wanted to double check with everyone to make sure it works before I drastically change my set up.

Thank You

also is there some way that the rs232 could be reset inside the code?

You can use the watchdog timer for forced reset.

would the command

wdt_enable(WDTO_2S)

work so it would give the code a 2 second time out and it could reset the board

after further research the watchdog timer will not reset communication with the rs323 on the arduino mega. Any other ideas?

setup();

could you please expand on this?

Use it as a "line of code" - you're calling the setup function.
Isn't that what you're trying to do ?

No, I am trying to remotely reset communication with the rs232. either through code or modifying my board so that once the 5v external power is removed I can leave the usb connected without having power on the board to reset the rs232.

Seems different from what you posted originally --

sorry new information has come to me since I posted I would still appreciate your help with this.

What's that supposed to mean? Spare us the use/misuse of jargon.

I am trying to reset the Arduino similarly to how it would be reset if the usb and external 5v power were to be removed. I will not be able to remove the usb because of where the Arduino is located with my project. I cannot use the reset button on the Arduino because that will not reset the rs232.

Arbitrarily?

Put an HC06 and send a "command" to 'Reset' where it will call the setup() function.
Too weird ?

Hi, @mbanks

Have you tried it?

Why do you need to reset RS232?

Tom... :smiley: :+1: :coffee: :australia:

Use a terminal emulator program that lets you control the DTR and RTS lines
Toggle DTR to do a reset

Found my solution from the forum here

I was able to remove T1 so that once I disconnected the external power the Arduino shut off with maintaining communication.