fat16lib wrote:Even connecting reset to a digital pin is not reliable according to Atmel because the digital pin goes tristate and releases reset too soon. You need an external circuit that will hold reset low for sufficient time.
void (*softReset) (void) = 0; //declare reset function @ address 0
softReset();
void (*softReset) (void) = 0;
Re: arduino reset -- working hack!
//digitalPin 7 is connected to the RESET pin on Arduino
//NOTE: you CANNOT program the board while they are connected
//by default digitalPin 13 will blink upon reset, so stick an LED in there
int interval = 5000;
long int time = 0;
void setup(){
digitalWrite(7, HIGH); //We need to set it HIGH immediately on boot
pinMode(7,OUTPUT); //We can declare it an output ONLY AFTER it's HIGH
// (( HACKHACKHACKHACK ))
Serial.begin(9600); //So you can watch the time printed
}
void loop(){
time = millis();
Serial.println(time);
if(time > interval){
Serial.println("RESET!");
digitalWrite(7, LOW); //Pulling the RESET pin LOW triggers the reset.
}
}