Ciao a tutti, sto provando ad abilitare il watchdog su arduino due senza successo.
ho provato a capire qualcosa da questo: Due watchdog
ma senza successo.
Qualcuno ha degli esempi, grazie
Ciao a tutti, sto provando ad abilitare il watchdog su arduino due senza successo.
ho provato a capire qualcosa da questo: Due watchdog
ma senza successo.
Qualcuno ha degli esempi, grazie
Ricordo che un ex "admin" del forum Leo72 aveva fatto forse una libreria per questa cosa ...
... ecco, guarda QUI ![]()
Guglielmo
Grazie Guglielmo ma non funziona.
//include the library
#include "advancedFunctions.h"
const byte ledPin = 13;
byte ledStatus = 1;
//set up the sketch
void setup() {
wdt.enable(1000); //1000 ms of survival
pinMode(ledPin, OUTPUT);
Serial.begin(9600);
Serial.println("start");
}
//main loop
void loop() {
Serial.println("loop");
static byte counter = 0;
digitalWrite(ledPin, ledStatus);
delay(500);
ledStatus ^= 1;
counter++;
if (counter > 10) { //after 10 timer, we freeze the code into an infinite loop
for(;;); //this is a deadlock
}
wdt.restart(); //this ensures that the WDT will not reset the MCU
}
manda in blocco l'mcu non appena includo la libreria.
devo andare anche di 'erase' per ricaricare altri skatc
Mmmm ... ma hai fatto quanto indicato?
IMPORTANTE: per usare questo modulo è necessario modificare un file del core originale (leggi il file /doc/WDT_MODULE.txt).
IMPORTANT!
To use the Watchdog Timer module you have to edit the following file of the Arduino core:
/arduino-1.5.x/hardware/arduino/sam/variants/arduino_due_x/variant.cpp
and comment the line #377 so that it will change from
WDT_Disable(WDT);
to
//WDT_Disable(WDT);Keep in mind that after this modify, ALL of you sketches will have to disable the
WDT first in order to avoid a system reset!
Hai seguito tutto?
Guglielmo