Reset W/O using push button & accessing registers

Dear all,

I am new to Arduino and I have two doubts, please.

  1. How can I re-run an already uploaded code in my Arduino Duemilenove without having to push the reset button on the board? In other words, can I reset my Arduino from my Desktop? In case it is possible, I would greatly appreciate if you can please include that portion of code in the example code I attached below.
    In case it is not possible, can I "create" another "reset button" outside the Arduino board (e.g. in a protoboard) to run again my already uploaded program?

  2. (This question is more curiosity than necessity) How can I access the registers of my Arduino? For example, In the code below, once I have uploaded it, I would like to just change the second entry in the "npulse" array without having to re-upload the whole code in my Arduino.

Thanks so much in advance for your time,

carlo

Example code.
//
int ledPin = 2;
int npulses[3] = {5000,10000,15000};
int counterpos = 0;
int counterpulse = 0;

void setup() {
pinMode(ledPin, OUTPUT);
}

void loop()
{
delay(3000);
while (counterpos < 3){
while (counterpulse < npulses[counterpos]){
digitalWrite(ledPin, HIGH);
delayMicroseconds(100);
digitalWrite(ledPin, LOW);
delayMicroseconds(100);
counterpulse=counterpulse+1;
}
delay(5000);
counterpos=counterpos+1;
counterpulse=0;
}
}

//

Yes you can. You just need to pull DTR to low for a small period of time. An example (in Perl) how this could be done is found here:

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1201441300

I use a python script for this purpose like so:

#!/usr/bin/python
# -*- coding: utf-8 -*-

import serial
import time
import sys

if len(sys.argv) != 3:
    print "Please specify a port and a baudrate, e.g. %s /dev/ttyUSB0 19200" % sys.argv[0]
    sys.exit(-1)

ser = serial.Serial(sys.argv[1], sys.argv[2])
ser.setDTR(1)
time.sleep(0.5)
ser.setDTR(0)
ser.close()

Udo