Go Down

Topic: How to send a reset request from C# like Arduino 1.0 IDE? (Read 901 times) previous topic - next topic

d0773d

I created a Serial read/write in C#.  I would like to add the Arduino reset feature to my C# application like the Arduino 1.0 IDE serial application does on start-up and exit.  Does anyone have an example that I could work from?

d0773d

I got it working in about 5 minutes by hooking up a wire from PWM Port12 to the RESET Port.  On the Arduino I checked for the text RESET on the incoming SerialEvent3.  When RESET is found do: pinMode(7, OUTPUT);  digitalWrite(7, LOW);  As for as the C# it was as simple as:
if (serialPort1.IsOpen) { serialPort1.Write("RESET"); }.  Reset seems to work as expected.

d0773d

An even better approach is configure  serial1.DtrEnable = true; in c#.

retrolefty


I got it working in about 5 minutes by hooking up a wire from PWM Port12 to the RESET Port.  On the Arduino I checked for the text RESET on the incoming SerialEvent3.  When RESET is found do: pinMode(7, OUTPUT);  digitalWrite(7, LOW);  As for as the C# it was as simple as:
if (serialPort1.IsOpen) { serialPort1.Write("RESET"); }.  Reset seems to work as expected.


The AVR datasheet and related application notes are pretty clear that driving the reset pin from a digital output pin is not recommended practice and can result in incomplete hardware reset function. Upon reset first all I/O pins are  defaulted to input mode thus removing the active low reset signal. This results in a reset pulse width too narrow to accomplish a full proper reset. So use at your own risk but it's something the chip manufacture explicitly states you should not do.


Go Up